Method, device, equipment and storage medium for adding numbers to documents

By adding numbers to the document, determining the target number type based on the existing number structure in the second document, and adding target number to the first document, the problem of the complex use process of custom multi-level numbering styles and limited to the use of a single document is solved, and the intelligent, flexible and consistent processing of numbering in the document is achieved.

CN119783640APending Publication Date: 2025-04-08BEIJING KINGSOFT OFFICE SOFTWARE INC +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411842998.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

In the prior art, the use process of custom multi-level numbering styles is complicated and is limited to single document use, so it is impossible to maintain number consistency among multiple documents.

Method used

By adding numbers in the document, in response to adding instructions to add target numbers in the first document, the target number type of the target number is determined according to the existing number structure in the second document, and a number of the target number type is added at the position where the cursor is located in the first document.

Benefits of technology

It realizes an intelligent, flexible and easy-to-use multi-level numbering solution for document numbers to ensure that the newly added target numbers are consistent with the existing numbering structure in the document, improve the standardization and readability of the document, and maintain a consistent numbering structure in multiple documents to enhance consistency between documents.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119783640A_ABST
    Figure CN119783640A_ABST
Patent Text Reader

Abstract

The present application relates to a method, device, equipment and storage medium for adding numbers in a document, the method comprising: in response to an instruction to add a target number in a first document, when the numbering level of the target number is inconsistent with the numbering level of the reference number, determining the target number type of the target number according to the existing numbering structure in the second document, wherein the reference number is the number before the target number in the first document; adding the number of the target number type at the cursor position in the first document as the target number. Thus, an intelligent, flexible and easy-to-use document multi-level numbering processing solution is realized, which can significantly improve the user experience when adding multi-level numbers during document editing and improve document editing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computers, and in particular to a method, device, equipment and storage medium for adding numbers to documents. Background Art

[0002] With the development of information technology, document editing tools have become an indispensable part of modern office and learning. Document editing tools have greatly improved the efficiency and convenience of document processing, especially in the multi-level numbering function, which makes the document's hierarchical structure clearer and easier for readers to understand the logic of the document content.

[0003] In order to meet the needs of users for multi-level numbering in documents, current document editing tools provide some preset multi-level numbering styles, such as "1", "1.1", "1.1.1", etc., and allow users to create custom multi-level numbering styles in the software. Although this combination of preset multi-level numbering styles and allowing users to customize multi-level numbering styles can meet the basic multi-level numbering needs of users to a certain extent, users still face many inconveniences in the creation and use of custom multi-level numbering style sheets. For example, users usually need to go through a series of cumbersome menu navigation in the software to enter the style setting interface, and users also need to have a certain understanding of the styles and rules of multi-level numbering, which undoubtedly makes it difficult for novice users to get started and makes the cost of maintaining custom style sheets relatively high. Secondly, custom style sheets can often only be used in the documents that create them, which limits the flexibility of users to maintain numbering consistency between multiple documents, which not only affects the efficiency of user document editing, but also may lead to inconsistency in numbering. In addition, only one custom style can be used in a document, which limits the flexibility of users in using numbering. Summary of the invention

[0004] The present application provides a method, device, equipment and storage medium for adding numbers to a document to solve the technical problem in the prior art that the custom multi-level numbering style is single but the use process is complicated and is limited to a single document.

[0005] In a first aspect, the present application provides a method for adding numbers to a document, the method comprising:

[0006] In response to an instruction to add a target number in the first document, when the numbering level of the target number is inconsistent with the numbering level of the reference number, determining the target number type of the target number according to an existing numbering structure in the second document, wherein the reference number is a number located before the target number in the first document;

[0007] A number of the target number type is added at the cursor position in the first document as the target number.

[0008] In a possible implementation manner, determining the target numbering type of the target numbering according to the existing numbering structure in the second document includes:

[0009] Determining a target hierarchical relationship between the target number and the reference number, and determining a first numbering level and a first numbering type of the reference number;

[0010] determining a target numbering structure from existing numbering structures in a second document;

[0011] Determine the numbering type of the number corresponding to the second numbering level in the target numbering structure as the target numbering type;

[0012] Among them, in the target numbering structure, the second numbering type of the number corresponding to the first numbering level is consistent with the first numbering type; the second numbering level refers to the numbering level that has the target level relationship with the numbering level of the reference number.

[0013] In a possible implementation, determining the target numbering structure from the existing numbering structure in the second document includes:

[0014] searching for an existing numbering structure in the second document according to the first numbering level and the first numbering type, wherein the existing numbering structure in the second document refers to a numbering structure in the full text of the second document;

[0015] When a numbering structure that meets the set conditions is found, the found numbering structure is determined as the target numbering structure;

[0016] In the case where at least two numbering structures satisfying the set condition are found, a target numbering structure is determined from the at least two numbering structures found;

[0017] The setting condition is as follows: in the existing numbering structure, the second numbering type of the number corresponding to the first numbering level is consistent with the first numbering type.

[0018] In a possible implementation manner, determining a target numbering structure from the at least two numbering structures found includes:

[0019] According to the set priority matching rule, a target numbering structure is determined from at least two numbering structures found.

[0020] In a possible implementation manner, the second document is the first document, and determining the target numbering type of the target numbering according to the existing numbering structure in the second document includes:

[0021] Obtaining an existing numbering structure in the first document;

[0022] The target numbering type of the target numbering is determined according to the existing numbering structure in the first document.

[0023] In a possible implementation manner, the second document is an associated document of the first document; and determining the target numbering type of the target numbering according to the existing numbering structure in the second document includes:

[0024] Acquire a document associated with the first document as a second document;

[0025] Obtaining an existing numbering structure in the second document;

[0026] The target numbering type of the target numbering is determined according to the existing numbering structure in the second document.

[0027] In a possible implementation, it further includes:

[0028] In a case where the target number type of the target number cannot be determined according to the existing numbering structure in the second document, a designated numbering type is determined as the target number type of the target number.

[0029] In a possible implementation, it further includes:

[0030] In response to a numbering type modification operation on an existing numbering structure in the second document, synchronously modifying the numbering type of numbers in the first document that inherit the existing numbering structure;

[0031] The numbering that inherits the existing numbering structure refers to: a numbering that is added by applying a target numbering type determined according to the existing numbering structure.

[0032] In a possible implementation manner, adding a number of the target number type at the cursor position in the first document as the target number, further comprising:

[0033] In response to a numbering type modification operation on the target number, the numbering structure to which the target number belongs is determined to be an existing numbering structure in the first document.

[0034] In a second aspect, the present application provides a device for adding numbers to a document, the device comprising:

[0035] a numbering type determining module, configured to, in response to an adding instruction to add a target number in the first document, determine a target numbering type of the target number according to an existing numbering structure in a second document when the numbering level of the target number is inconsistent with the numbering level of the reference number, wherein the reference number is a number located before the target number in the first document;

[0036] A number adding module is used to add a number of the target number type at the position of the cursor in the first document as the target number.

[0037] In a possible implementation, the numbering type determination module includes:

[0038] A first determining unit, configured to determine a target level relationship between the target number and the reference number, and to determine a first numbering level and a first numbering type of the reference number;

[0039] A second determining unit, configured to determine a target numbering structure from an existing numbering structure in a second document;

[0040] A third determining unit, configured to determine the numbering type of the number corresponding to the second numbering level in the target numbering structure as the target numbering type;

[0041] Among them, in the target numbering structure, the second numbering type of the number corresponding to the first numbering level is consistent with the first numbering type; the second numbering level refers to the numbering level that has the target level relationship with the numbering level of the reference number.

[0042] In a possible implementation, the numbering type determination module includes:

[0043] a searching unit, configured to search for an existing numbering structure in the second document according to the first numbering level and the first numbering type, wherein the existing numbering structure in the second document refers to a numbering structure in the full text of the second document;

[0044] A fourth determining unit, configured to determine the found numbering structure as a target numbering structure when a numbering structure that meets a set condition is found;

[0045] a fifth determining unit, configured to determine a target numbering structure from the at least two numbering structures found when at least two numbering structures satisfying a set condition are found;

[0046] The setting condition is as follows: in the existing numbering structure, the second numbering type of the number corresponding to the first numbering level is consistent with the first numbering type.

[0047] In a possible implementation manner, the fifth determining unit is specifically configured to:

[0048] According to the set priority matching rule, a target numbering structure is determined from at least two numbering structures found.

[0049] In a possible implementation manner, the second document is the first document, and the numbering type determination module includes:

[0050] A first acquisition unit, configured to acquire an existing numbering structure in the first document;

[0051] A sixth determining unit is used to determine a target numbering type of the target numbering according to an existing numbering structure in the first document.

[0052] In a possible implementation manner, the second document is an associated document of the first document; and the numbering type determination module includes:

[0053] A second acquisition unit, configured to acquire a document associated with the first document as a second document;

[0054] A third acquisition unit, used to acquire an existing numbering structure in the second document;

[0055] A seventh determining unit is used to determine a target numbering type of the target numbering according to an existing numbering structure in the second document.

[0056] In a possible implementation manner, the numbering type determination module is further used to:

[0057] In a case where the target number type of the target number cannot be determined according to the existing numbering structure in the second document, a designated numbering type is determined as the target number type of the target number.

[0058] In a possible implementation, it further includes:

[0059] A synchronous updating module, configured to synchronously modify the numbering type of the numbering that inherits the existing numbering structure in the first document in response to a numbering type modification operation on the existing numbering structure in the second document;

[0060] The numbering that inherits the existing numbering structure refers to: a numbering that is added by applying a target numbering type determined according to the existing numbering structure.

[0061] In a possible implementation, it further includes:

[0062] A numbering structure construction module is used to add a number of the target numbering type at the cursor position in the first document as the target number, and then, in response to a numbering type modification operation on the target number, determine the numbering structure to which the target number belongs as an existing numbering structure in the first document.

[0063] In a third aspect, the present application provides a device comprising: a processor and a memory, wherein the processor is used to execute a program for adding numbers to a document stored in the memory, so as to implement the method for adding numbers to a document described in any one of the first aspects.

[0064] In a fourth aspect, the present application provides a storage medium storing one or more programs, wherein the one or more programs can be executed by one or more processors to implement the method for adding numbers to a document as described in any one of the first aspects.

[0065] The above technical solution provided by the embodiment of the present application has the following advantages over the prior art: the method provided by the embodiment of the present application, by responding to the adding instruction of adding the target number in the first document, when the numbering level of the target number is inconsistent with the numbering level of the reference number, determines the target number type of the target number according to the existing numbering structure in the second document, wherein the reference number is the number located before the target number in the first document; adds the number of the target number type at the cursor position in the first document as the target number, realizing an intelligent, flexible and easy-to-use document multi-level numbering processing scheme. The processing scheme determines the numbering type of the target number by referring to the existing numbering structure in the second document, realizing the automatic reuse of the custom numbering structure in the document, which can ensure that the newly added target number is automatically consistent with the existing numbering structure in the document, thereby avoiding errors and confusion caused by manual numbering, and improving the standardization and readability of the document, and on the other hand, it can meet the demand for maintaining a consistent numbering structure in multiple documents, can enhance the consistency between documents, and allow users to quickly reuse the numbering structure in other documents, thereby meeting the diverse demands of users when writing multi-level content. At the same time, this processing solution eliminates the need for users to manually select and set the numbering type. Instead, users only need to issue an add instruction at the location where a number is required to automatically determine and add the correct numbering type based on the existing numbering structure. This greatly simplifies the user's numbering operations and improves document editing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0067] In order to more clearly illustrate the embodiments of the present application 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, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0068] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0069] Figure 1 A flowchart of an embodiment of a method for adding numbers to a document provided in an embodiment of the present application;

[0070] Figure 2 Examples of the same-level numbering structure and the depth numbering structure;

[0071] Figure 3 Examples of differentiating logic for peer numbering structures;

[0072] Figure 4 An example of differentiating logic for a depth-numbered structure;

[0073] Figure 5 One of the schematic diagrams of the effect achieved by applying the method provided in the embodiment of the present application;

[0074] Figure 6 A flowchart of an embodiment of the present application for determining a target numbering type of a target numbering according to an existing numbering structure in a second document;

[0075] Figure 7 A second schematic diagram of the effect achieved by applying the method provided in the embodiment of the present application;

[0076] Figure 8 A third schematic diagram of the effect achieved by applying the method provided in the embodiment of the present application;

[0077] Fig. 9 A fourth schematic diagram of the effect achieved by applying the method provided in the embodiment of the present application;

[0078] Fig.10 A block diagram of an embodiment of a device for adding numbers to a document provided in an embodiment of the present application;

[0079] Fig.11 A schematic diagram of the structure of a device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0080] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0081] The disclosure below provides many different embodiments or examples to realize the different structures of the present application. In order to simplify the disclosure of the present application, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present application. In addition, the present application can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.

[0082] In order to solve the technical problems in the prior art that the use of custom multi-level numbering styles is complicated and limited to a single document, the present application provides a method, device, equipment and storage medium for adding numbers to a document, which can realize an intelligent, flexible and easy-to-use document multi-level numbering processing solution, and can significantly improve the user experience when adding multi-level numbering during the document editing process, thereby improving document editing efficiency.

[0083] Figure 1 A flowchart of a method for adding numbers to a document provided in an embodiment of the present application. In one embodiment, the method is applied to a document editing terminal, which can be an application running in an independent process, a sub-application (applet) independent of the main page embedded in a client, a function running on a web browser (also known as WebApp), a applet embedded in an email, etc. Figure 1 As shown, the method comprises the following steps:

[0084] Step 101, in response to an instruction to add a target number in a first document, when the numbering level of the target number is inconsistent with the numbering level of the reference number, determine the target number type of the target number according to the existing numbering structure in the second document, wherein the reference number is the number that precedes the target number in the first document.

[0085] Step 102: Add a number of the target number type at the cursor position in the first document as the target number.

[0086] In order to facilitate understanding of the technical solution provided in the embodiment of the present application, step 101 and step 102 are explained uniformly below:

[0087] First, introduce the noun concepts involved in the technical solution provided by the embodiments of this application:

[0088] The numbering level, which can also be referred to as the numbering grade, is a method of identification used to distinguish different levels or categories in the context of document writing. This identification method can clearly represent the hierarchical structure of information, enabling readers to quickly understand the subordinate relationship and logical relationship between various parts of the document.

[0089] In the context of document writing, the numbering levels are usually arranged in descending order. For example, the first level is the highest numbering level, which can represent the main parts or chapters of the document; the second level is a further subdivision of the first level, which can represent the sub-parts or subsections under each chapter; the third level is a further refinement of the second level, which can represent the specific content or details under the subsections. And so on, the numbering levels can increase continuously to adapt to the complexity and depth of the document content.

[0090] The numbering type can be regarded as a numbering rule. Common numbering rules include Chinese character numbering, numerical numbering, and alphabetical numbering (including uppercase English letters, lowercase English letters, Greek letters, etc.). Among them, Chinese character numbering usually uses Chinese characters such as "one, two, three, four, five, six, seven, eight, nine, ten" to represent the order, usually starting from the Chinese character "one" and increasing sequentially. Numerical numbering can use Arabic numerals "1, 2, 3, 4, 5..." to represent the order, usually starting from the number "1" and increasing sequentially, or use Roman numerals "I, II, III, IV, V..." to represent the order, usually starting from the number "I" and increasing sequentially. In a multi-level numbering structure, there is also a common numerical numbering method: further subdivide by adding a decimal point between the numbers. For example, the numbering of the first level is "1", the numbering of the second level is "1.1", the numbering of the third level is "1.1.1", and so on. Alphabetical numbering usually uses English letters "a, b, c, d, e..." (or English letters "A, B, C, D, E...") to represent the order, usually starting from the letter "a" (or "A") and increasing sequentially. In addition, any of the above numbering types can also be combined with "()", "( )", ")", ",", "." or a space to form a new numbering type. For example, "(one)", "one)", "(1)", "(1", "(a)", "(a", "1.", "1,", "1", etc. In practical applications, in addition to any of the above numbering types, users can also customize various numbering types as needed, and the embodiments of this application do not limit this.

[0091] In a multi-level numbering structure, different numbering types are usually combined, which is reflected in different numbering levels using different numbering types. For example, the first level uses Chinese characters for numbering (such as the Chinese character "一"), the second level uses numerical numbering (such as the number "1"), and the third level uses alphabetical numbering (such as the letter "a"). Another example is that the first level uses Chinese characters for numbering (such as the Chinese character "一"), the second level uses numerical numbering (such as the number "1"), and the third level uses a numbering type that combines numbers and decimal points (such as "1.1").

[0092] A numbering structure, which can also be called a numbering group, is a structure composed of numbers at one or more numbering levels and is used to organize and identify the information hierarchy and order in a document. Among them, in a numbering structure composed of numbers at one numbering level, all the numbers are at the same numbering level and there is no hierarchical subordinate relationship between them. Therefore, this numbering structure is called a same-level numbering structure (or same-level numbering group). For example, see Figure 2 (a), which is an example of a same-level numbering structure. In a numbering structure composed of numbers at different numbering levels, there is a hierarchical subordinate relationship between different numbering levels. For example, the second-level number is subordinate to the first-level number, the third-level number is subordinate to the second-level number, etc. As the numbering level decreases layer by layer, the information structure will be refined layer by layer. Therefore, this numbering structure is called a depth numbering structure (or depth numbering group). For example, see Figure 2 (b), which is an example of a depth numbering structure.

[0093] From Figure 2 (b)'s example, it can also be seen that in terms of typesetting, the numbering levels can be distinguished by the indentation level. For example, the first-level number has no indentation, the indentation level of the second-level number is 1, that is, indented by one unit, the indentation level of the third-level number is 2, that is, indented by two units, and so on.

[0094] From Figure 2 (b)'s example, it can also be seen that a depth numbering structure can also contain a same-level numbering structure. For example, the numbers "i.", "ii.", and "iii." in the above example two belong to a group of same-level numbering structures. They all belong to a higher-level number "a" and have the same indentation level. From this, it can also be seen that a same-level numbering structure means that all the numbers in it are at the same numbering level, not that all the numbers in it are first-level numbers. The above example one only takes the first-level number as an example.

[0095] Whether it is a same-level numbering structure or a depth numbering structure, there may be multiple in the same document, so it involves distinguishing different numbering structures in the same document. In this regard, the following discusses the distinguishing logic of the same-level numbering structure and the depth numbering structure case by case.

[0096] First, for different same-level numbering structures in the same document, the following several differentiation logics can be adopted:

[0097] The first differentiation logic: Restart numbering at the current indentation level, then start a new same-level numbering structure.

[0098] For example, see Figure 3 the example of (a). Figure 3 The example of (a) includes two same-level numbering structures, namely the same-level numbering structure 1 composed of the numbers "1." and "2." in the first two lines, and the same-level numbering structure 2 composed of the numbers "1." and "2." in the last two lines. During the document editing process, because the user enters the first-level number "1." under the first-level number "2.", that is, restarting numbering at the current indentation level, a new same-level numbering structure is started.

[0099] The second differentiation logic: Change the numbering style at the current indentation level, then start a new same-level numbering structure. Here, the numbering style includes but is not limited to styles such as font, font size, bold, italic, text type (i.e., number type), etc.

[0100] For example, see Figure 3 the example of (b). Figure 3 The example of (b) includes two same-level numbering structures, namely the same-level numbering structure 3 composed of the numbers "1" and "2" in the first two lines, and the same-level numbering structure 4 composed of the numbers "one." and "two." in the last two lines. During the document editing process, because the user enters the first-level number "one." under the first-level number "2.", that is, changing the numbering style at the current indentation level, a new same-level numbering structure is started.

[0101] The third differentiation logic: When the current numbering level is blocked by the numbering of a higher numbering level, start a new numbering structure from the blocking point.

[0102] For example, see Figure 3 the example of (c). Figure 3 In the example of (c), assume that the content "one. Content 1" is newly inserted content based on the original content "1. Content 1 2. Content 2 3. Content 4. Content 4". With the insertion of this content, the original current numbering level: the second level is blocked by the numbering of the first level. Thus, the numbers "1." and "2." in the first two lines form a same-level numbering structure, and the numbers "3." and "4." in the last two lines form another same-level numbering structure, and are renumbered as the numbers "1." and "2.".

[0103] Similar to Figure 3In example (c), during the document editing process, the user can also choose to wrap and cancel the indentation level after editing "1. Content 1 2. Content 2", and then enter the number "1.". At this time, the current numbering level: Level 2 is blocked by the numbering of Level 1, so that the numbers "1." and "2." of the first two lines form a numbering structure of the same level, and a new numbering structure starts from number "1.".

[0104] It can be seen from the above description that, through the third differentiation logic, not only two adjacent same-level numbering structures can be differentiated, but also adjacent same-level numbering structures and depth numbering structures can be differentiated.

[0105] The fourth distinction logic: If the current numbering level is blocked by a container type such as a title, highlight block / table / cell, a new numbering structure starts from the blocking point.

[0106] For example, see Figure 3 Example of (d). Figure 3 In the example of (d), the content "Title One" is newly inserted on the basis of the original content "1. Content 1 2. Content 2 3. Content 4. Content 4". With the insertion of this content, the original current numbering level: Level 2 is blocked by the title, so that the numbers "1." and "2." of the first two lines are combined into a same-level numbering structure, and the numbers "3." and "4." of the last two lines are combined into another same-level numbering structure, and are renumbered as "1." and "2.".

[0107] Similar to Figure 3 In example (d), during the document editing process, the user can also choose to wrap and enter "Title One" after editing "1. Content 1 2. Content 2". At this time, the current numbering level: Level 1 is blocked by the title, so that the numbers "1." and "2." of the first two lines form a same-level numbering structure, and a new numbering structure starts from the first number after the title. The new numbering structure can be a same-level numbering structure or a depth numbering structure, and there is no restriction here.

[0108] It can be seen from the above description that, through the fourth differentiation logic, not only two adjacent same-level numbering structures can be differentiated, but also adjacent same-level numbering structures and depth numbering structures can be differentiated.

[0109] Secondly, for different depth numbering structures in the same document, the following distinction logics can be used:

[0110] The first differentiation logic: when the number of the parent numbering level (for example, level 1) is renumbered, a new depth numbering structure begins.

[0111] For example, see Figure 4 Example of (a). Figure 4 In the example of (a), assume that the original first-level number "2." is modified to "1.", which means that the numbering of the parent-level numbering hierarchy has been renumbered. Then, starting from the modified number, a new hierarchical numbering structure is formed. After the modification, Figure 4 (a) includes two hierarchical numbering structures, namely the hierarchical numbering structure formed by the numbers in the first three lines and another hierarchical numbering structure formed by the numbers in the last three lines.

[0112] The second differentiation logic: If the numbering style of the numbers in the parent-level numbering hierarchy is changed, a new hierarchical numbering structure is started.

[0113] For example, refer to Figure 4 the example of (b). Figure 4 In the example of (b), assume that the original first-level number "Two." is modified to "(1).", which means that the numbering style of the numbers in the parent-level numbering hierarchy has been changed. Then, starting from the changed number, a new hierarchical numbering structure is formed. After the modification, Figure 4 (b) includes two hierarchical numbering structures, namely the hierarchical numbering structure formed by the numbers in the first three lines and another hierarchical numbering structure formed by the numbers in the last three lines.

[0114] The third differentiation logic: If the numbers in the parent-level numbering hierarchy are blocked by the numbers in a higher numbering hierarchy, a new numbering structure is started from the blocking point.

[0115] For example, refer to Figure 4 the example of (c). Figure 4 In the example of (c), assume that the content "Two. Content 2" is newly inserted based on the original content (other content except "Two. Content 2"). With the insertion of this content, the original numbering hierarchy of the number "2.", which is the second level, is blocked by the number in the first level. Then, starting from the newly inserted number, a new hierarchical numbering structure is formed. After the modification, Figure 4 (c) includes two hierarchical numbering structures, namely the hierarchical numbering structure formed by the numbers in the first two lines and another hierarchical numbering structure formed by the numbers in the last four lines. Here, the numbers in the newly formed hierarchical numbering structure will also be renumbered accordingly.

[0116] Similar to Figure 4(c) Example. During document editing, after the user finishes editing "1. Content 1", they can also choose to start a new line and cancel the indentation level, and then enter the number "(1)."(It can also be other numbers, which are not restricted here). At this time, the current numbering level: the second level is blocked by the numbering of the first level, so that the numbers "I." and "1." of the previous two lines form a hierarchical numbering structure, and a new numbering structure starts from the number "(1).". This new numbering structure can be a same-level numbering structure or a hierarchical numbering structure, which is not restricted here.

[0117] From the above description, it can be seen that through the third differentiation logic, not only can adjacent same-level numbering structures be differentiated, but also adjacent same-level numbering structures and hierarchical numbering structures can be differentiated.

[0118] Fourth differentiation logic: If the numbering of the parent numbering level is blocked by container types such as headings, highlighted blocks / tables / cells, etc., a new hierarchical numbering structure starts from the blocking point.

[0119] For example, see Figure 4 Example of (d). Figure 4 In the example of (d), assume that the content "Title" is newly inserted content on the basis of the original content (other content except the content "Title"). With the insertion of this content, the number "II." is blocked by the title. Then, a new hierarchical numbering structure starts from the number "II.", and after modification Figure 4 (d) includes two hierarchical numbering structures, namely the hierarchical numbering structure formed by the numbers of the first three lines and another hierarchical numbering structure formed by the numbers of the last three lines. Here, the numbers of the newly formed hierarchical numbering structure will also be renumbered accordingly.

[0120] The above introduces the noun concepts involved in the technical solutions provided by the embodiments of the present application. The following explains steps 101 and 102:

[0121] The target numbering refers to the numbering to be added in the document. For the sake of convenient description, it is called the target numbering.

[0122] The first document refers to the currently edited document. When adding content, such as numbering, in the document, first position the cursor at the addition position.

[0123] The second document can be the first document or other documents other than the first document. How to determine the second document will be explained in the following embodiments and will not be elaborated here first.

[0124] The existing numbering structure in the document refers to all numbering structures currently existing in the document, including the same-level numbering structure and the depth numbering structure. During the editing process of the document, as the document is edited, the same-level numbering structure or the depth numbering structure will be formed according to the distinction logic described above, and these numbering structures will be recorded. For example, the starting line number and the ending line number of the numbering structure and the type of numbering structure (same-level numbering structure or depth numbering structure) are recorded.

[0125] It can also be seen from this that the existing numbering structure in the document is different from the multi-level numbering style preset in the document editing tool. The existing numbering structure is gradually formed in the process of document editing, and its formation depends on the organization of the document content and the intention of the document editing user. Moreover, the existing numbering structure can be added, modified or deleted by the user in the process of editing the document as needed, and has high flexibility. The multi-level numbering style preset in the document editing tool is fixed, and the user can directly select and apply it to the document. Moreover, the hierarchical relationship, numbering style and numbering type of the preset multi-level numbering style are all fixed and cannot be changed by the user. Based on this, the existing numbering structure in the document can also be called the temporary numbering style of the document.

[0126] The reference number is the number before the target number in the first document. Here, the target number is the number to be added, so it can also be said that the reference number is the number before the cursor in the first document.

[0127] Optionally, there can be one or more reference numbers.

[0128] When there are multiple reference numbers, the number hierarchy of the target number and the number hierarchy of the reference numbers are inconsistent, which means that the number hierarchy of the target number and the number hierarchy of the reference number closest to the target number are inconsistent.

[0129] For example, see Figure 2 In the example of (b), assuming that the number "i." is the target number, the reference number can be the number "a.", or the reference number includes the number "a." and the number "1." It can be seen that the reference number can include the numbers of each numbering level before the target number, or only include the numbers of some numbering levels (such as one numbering level) before the target number. For another example, continue to refer to Figure 2 In example (b), assuming that number "b." is the target number, the reference number can be number "iii.", or the reference number includes number "iii." (or number "ii.", or number "i.") and number "a.", or the reference number includes number "iii." (or number "ii.", or number "i."), number "a." and number "1.".

[0130] It can be seen from the description of step 101 and step 102 that in the technical solution of the embodiment of the present application, there is an association between the numbering level and the numbering type, and this association is reflected in that in different numbering structures, the same numbering level can adopt the same numbering type, which means that when the user wants to add a number of a certain level to the document, that is, when adding a target number to the document, the accurate numbering type (for the convenience of description, it is called the target numbering type of the target number) can be automatically matched according to the existing numbering structure and the numbering level of the target number, so as to automatically apply the target numbering type to generate and insert the target number at the cursor position in the document.

[0131] For example, see Figure 5 The example includes a numbering structure 1 that already exists in a document. In the numbering structure 1, the numbering type of the first-level number is a numbering type that combines numbers and ".", and the numbering type of the second-level number is a numbering type that combines numbers, "()" and ".". Figure 5 In the example, suppose the user wants to start a new numbering structure below numbering structure 1. There are two cases to discuss here:

[0132] In the first case, the user first inputs the number "2." by manual numbering, and sets the numbering level of the number "2." to level 1. Then, the user triggers an instruction to add a target number of level 2 (e.g., number "(1.")) below the number "2." by using a shortcut key, a toolbar option, or other means. For example, the user sets an indentation level of 2, and triggers the addition of a number by using a shortcut key or a toolbar option. At this point, in response to the instruction to add a target number in the document, it is found that the numbering level (level 2) of the target number is inconsistent with the numbering level (level 1) of the reference number (e.g., number "2."), then it can be determined that the current numbering structure is a deep numbering structure. Since the numbering types of different numbering levels are different in the deep numbering structure, it is necessary to determine the target numbering type to be applied to the target number. Then, according to the description of steps 101 and 102, the target numbering type to be applied to the target number can be automatically determined based on the existing numbering structure 1. For example, in the numbering structure 1, the numbering type of the second level numbering is a numbering type that combines the numbers “()” and “.”, then this numbering type is determined as the target numbering type of the target number, and then the target number “(1.”) is automatically generated and inserted at the cursor position in the document, thereby obtaining a numbering effect that meets the user's expectations.

[0133] In the second case, the user triggers an instruction to add a target number (e.g., number "2.") of the first level under the numbering structure 1 through a shortcut key, a toolbar option, or other means. For example, the user does not set the indentation level and triggers the addition of the number through a shortcut key or a toolbar option. At this time, in response to the instruction to add the target number in the document, it is found that the numbering level (first level) of the target number is inconsistent with the numbering level of the reference number (e.g., number "(1." in the numbering structure 1), then it can be determined that the current numbering structure is a depth numbering structure. At this time, according to the description of steps 101 and 102, the target numbering type to be applied to the target numbering is automatically determined according to the existing numbering structure 1. For example, in the numbering structure 1, the numbering type of the first level number is a numbering type that combines numbers and ".", then the numbering type is determined as the target numbering type of the target number, and then the target number "2." is automatically generated and inserted at the cursor position in the document. The numbering effect that meets the user's expectations is obtained.

[0134] pass Figure 5 As can be seen from the example, in the technical solution of the embodiment of the present application, by automatically matching the target number type of the target number to be added in the existing numbering structure in the document, and applying the target number type to insert the target number in the document, the user does not need to manually set the numbering type, but only needs to specify the numbering level and position, thereby significantly improving the efficiency of the user in adding numbers in the document. In addition, the technical solution provided by the embodiment of the present application allows the user to quickly reuse the numbering structure in other people's documents, thereby meeting the diverse demands of users when writing multi-level content.

[0135] The technical solution provided by the embodiment of the present application, by responding to the instruction of adding a target number in the first document, when the numbering level of the target number is inconsistent with the numbering level of the reference number, the target number type of the target number is determined according to the existing numbering structure in the second document, wherein the reference number is the number located before the target number in the first document; the number of the target number type is added at the cursor position in the first document as the target number, thereby realizing an intelligent, flexible and easy-to-use document multi-level numbering processing scheme. The processing scheme determines the numbering type of the target number by referring to the existing numbering structure in the second document, and realizes the automatic reuse of the custom numbering structure in the document. On the one hand, it can automatically ensure that the newly added target number is consistent with the existing numbering structure in the document, thereby avoiding errors and confusion caused by manual numbering, and improving the standardization and readability of the document. On the other hand, it can meet the demand for maintaining a consistent numbering structure in multiple documents, enhance the consistency between documents, and allow users to quickly reuse the numbering structure in other documents, thereby meeting the diverse demands of users when writing multi-level content. At the same time, this processing solution eliminates the need for users to manually select and set the numbering type. Instead, users only need to issue an add instruction at the location where a number is required to automatically determine and add the correct numbering type based on the existing numbering structure. This greatly simplifies the user's numbering operations and improves document editing efficiency.

[0136] Above through Figure 1 The process shown in the figure explains the technical solution provided by the embodiment of the present application as a whole. Figure 6 The illustrated flow describes an exemplary implementation of determining a target numbering type of a target numbering based on an existing numbering structure in a second document.

[0137] Figure 6 A flowchart of an embodiment of the present application for determining a target numbering type of a target number based on an existing numbering structure in a second document. Figure 6 The process shown in Figure 1 Based on the process shown, the following steps are included:

[0138] Step 601: Determine a target hierarchical relationship between a target number and a reference number, and determine a first numbering level and a first numbering type of the reference number.

[0139] The target hierarchical relationship refers to the hierarchical relationship between the target number and the reference number. For the convenience of description, it is called the target hierarchical relationship.

[0140] The first numbering level refers to the numbering level of the reference number, and for the convenience of description, it is called the first numbering level. Similarly, the first numbering type refers to the numbering type of the reference number, and for the convenience of description, it is called the first numbering type.

[0141] For example, in Figure 5 In the example of the first case, the target number is number "(1).", the numbering level of the target number is level 2, the target number corresponds to a reference number "2.", the first numbering level of the reference number "2." is level 1, and the first numbering type of the reference number "2." is a numbering type that combines a number and ".". The target level relationship between the target number "(1)." and the reference number "2." is "level 2-level 1". Here, the target level relationship between the target number "(1)." and the reference number "2." can also be said to be "level 1-level 2". In the representation of the target level relationship, the order of the numbering levels of the target number and the reference number has no effect on the subsequent automatic numbering results. The target level relationship is intended to describe the relative position relationship between the target number and the reference number.

[0142] exist Figure 5 In the example of the second case, the target number is "2.", which corresponds to a reference number "(1).", the first numbering level of the reference number "(1)." is level 2, and the first numbering type of the reference number "(1)." is a numbering type that combines numbers, "()" and ".". The target level relationship between the target number "2." and the reference number "(1)." is "level 1 - level 2".

[0143] Step 602: Determine a target numbering structure from existing numbering structures in the second document.

[0144] Step 603: Determine the numbering type of the number corresponding to the second numbering level in the target numbering structure as the target numbering type.

[0145] In the target numbering structure, the second numbering type of the number corresponding to the first numbering level is consistent with the first numbering type. The second numbering type refers to the numbering type of the number corresponding to the first numbering level in the target numbering structure, and for the convenience of description, it is called the second numbering type. The above-mentioned second numbering level refers to the numbering level that has the above-mentioned target level relationship with the numbering level of the reference number, and for the convenience of description, it is called the second numbering level.

[0146] Here, combined Figure 5 The example is divided into two cases:

[0147] exist Figure 5In the example of the first case, the target number is a subordinate number of its reference number. In this case, the existing numbering structure in the second document is searched, and an existing numbering structure in which the second numbering type of the number corresponding to the first numbering level is consistent with the first numbering type is found as the target numbering structure. The numbering type of the number corresponding to the second numbering level in the target numbering structure is determined as the target numbering type.

[0148] For example, in Figure 5 In the example of the first case, the reference number is "2.", the first numbering level is level 1, and the first numbering type is a numbering type that combines numbers and ".". Since the numbering type of the numbering of level 1 in numbering structure 1 is also a numbering type that combines numbers and ".", numbering structure 1 is determined as the target numbering structure. The target hierarchy relationship is "level 2 - level 1", then, in numbering structure 1, the level 2 has a target hierarchy relationship with level 1, and therefore, the numbering type "a numbering type that combines numbers, "()" and "."" of the numbering of level 2 in numbering structure 1 is determined as the target numbering type. Use this target numbering type to generate and insert the number "(1)." at the cursor position.

[0149] exist Figure 5 In the example of the second case, the target number is the parent number of its reference number. In this case, the numbering structure to which the reference number belongs is determined as the target numbering structure, and the numbering type of the number corresponding to the second numbering level in the target numbering structure is determined as the target numbering type. The second numbering level refers to the numbering level that has a target level relationship with the numbering level of the reference number. The target level relationship refers to the level relationship between the target number and the reference number.

[0150] For example, in Figure 5 In the example of the second case, the reference number "(1)" belongs to numbering structure 1, the first numbering level is level 2, and the first numbering type is a numbering type that combines numbers and "()". The target level relationship between the target number and the reference number "(1)" is "level 1-level 2", so the second numbering level in the numbering structure 1 to which the reference number "(1)" belongs is level 1. Based on this, the numbering type "a numbering type that combines numbers and "."" of the numbering of level 1 in numbering structure 1 is determined as the target numbering type. The number "2." is generated and inserted at the cursor position using this target numbering type.

[0151] pass Figure 5 It can also be seen from the example that the target numbering structure determined in the second case also meets the set condition: the second numbering type of the number corresponding to the first numbering level is consistent with the first numbering type.

[0152] In addition, Figure 5 In the first case of the example, there is only one reference number for the target number. In one embodiment, for a more complex depth numbering structure, there can also be multiple reference numbers for the target number. For example, it includes the numbers of all number levels before the target number in the current numbering structure. In this case, only when the number types of the numbers of each number level in the current numbering structure and the existing numbering structure are the same, is the existing numbering structure determined as the target numbering structure, and then the number type of the target number is determined according to the target numbering structure.

[0153] For example, referring to Figure 7 the example of, there are two existing numbering structures: numbering structure 1 and numbering structure 2. In the current numbering structure, assume that the number “A.” is the target number. If a number before the target number is selected as the reference number, that is, the number “(1).” is used as the reference number, and the two existing numbering structures are searched based on the number level and number type of this reference number, it will be found that both of these two existing numbering structures can be used as the target numbering structure. However, the target number types determined according to these two target numbering structures are inconsistent. For example, the target number type determined according to numbering structure 1 is the number type using capital English letters combined with “.”, while the target number type determined according to numbering structure 2 is the number type using lowercase English letters combined with “.”, which results in a conflict. To solve this conflict, the above embodiment can be applied. According to the description of the above embodiment, the numbers of each number level before the target number are selected as reference numbers, that is, both the numbers “(1).” and “1.” are used as reference numbers. Then, based on the number levels and number types of these two reference numbers, the two existing numbering structures are searched, and it will be found that only numbering structure 1 can be used as the target numbering structure. Thus, in numbering structure 1, the number type of the third-level number: the number type using capital English letters combined with “.” is determined as the target number type of the target number, and then the number “A.” is generated and inserted at the cursor position in the document using the target number type.

[0154] Through Figure 7 the example of, it can be seen that by determining the numbers of all number levels before the target number as reference numbers, and only when the number types of the numbers of each number level in the current numbering structure and the existing numbering structure are the same, is the existing numbering structure determined as the target numbering structure, and then the number type of the target number is determined according to the target numbering structure, the number type of the target number can be determined more accurately.

[0155] Figure 6The illustrated embodiment determines the target hierarchical relationship between the target number and the reference number, determines the first numbering level and the first numbering type of the reference number, determines the target numbering structure from the existing numbering structure in the second document, and determines the numbering type of the number corresponding to the second numbering level in the target numbering structure as the target numbering type, thereby providing an implementation method for determining an accurate target numbering type for the target number. Based on this implementation method, an intelligent, flexible and easy-to-use document multi-level numbering processing scheme is implemented. This processing scheme determines the numbering type of the target number by referring to the existing numbering structure in the second document, and realizes the automatic reuse of the custom numbering structure in the document. On the one hand, it can automatically ensure that the newly added target number is consistent with the existing numbering structure in the document, thereby avoiding errors and confusion caused by manual numbering, and improving the standardization and readability of the document. On the other hand, it can meet the demand for maintaining a consistent numbering structure in multiple documents, enhance the consistency between documents, and allow users to quickly reuse the numbering structure in other documents, thereby meeting the diverse demands of users when writing multi-level content. At the same time, this processing solution eliminates the need for users to manually select and set the numbering type. Instead, users only need to issue an add instruction at the location where a number is required to automatically determine and add the correct numbering type based on the existing numbering structure. This greatly simplifies the user's numbering operations and improves document editing efficiency.

[0156] pass Figure 7 As can be seen from the example, when determining the target numbering structure from the existing numbering structures in the second document, it is also possible to find two existing numbering structures that meet the set conditions (the second numbering type of the number corresponding to the first numbering level is consistent with the first numbering type). In this case, only one of the existing numbering structures that meets the set conditions is selected as the target numbering structure.

[0157] Accordingly, in one embodiment, the specific implementation of determining the target numbering structure from the existing numbering structure in the second document includes: searching for the existing numbering structure in the second document according to the first numbering level and the first numbering type, wherein the existing numbering structure in the second document refers to the numbering structure in the full text of the second document; when a numbering structure that meets the set conditions is found, determining the found numbering structure as the target numbering structure; when at least two numbering structures that meet the set conditions are found, determining a target numbering structure from the at least two numbering structures found.

[0158] The step of determining a target numbering structure from the at least two numbering structures found includes: determining a target numbering structure from the at least two numbering structures found according to a set priority matching rule.

[0159] Exemplarily, the priority matching rule set above is: the previous context takes precedence over the next context, and the closest distance. That is, when at least two numbering structures that meet the set conditions are distributed in the previous context and the next context where the cursor is located, the numbering structure in the previous context is preferentially selected as the target numbering structure. When there are at least two numbering structures that meet the set conditions in the previous context, the numbering structure closest to the cursor location is preferentially selected as the target numbering structure.

[0160] For example, see Figure 8 Take an example in which there are two existing numbering structures, which are located in the context above and below the cursor position, respectively. Assuming that the user wants to add a target number at the cursor position, and the reference number at this time is number "1.", through the numbering level and numbering type of the reference number "1.", the two existing numbering structures can be determined as numbering structures that meet the set conditions. However, the target numbering types determined according to the two existing numbering structures are inconsistent. For example, the target numbering type determined according to the numbering structure in the preceding text is a numbering type that combines numbers and circles, while the target numbering type determined according to the numbering structure in the following text is a numbering type that combines Chinese characters and ".". In this regard, according to the priority rule that the preceding text takes precedence over the following text, the numbering structure in the preceding text is selected as the target numbering structure. Then, according to the target numbering structure, the number "①" is inserted at the cursor position.

[0161] As an optional implementation, when the second document is the first document, the same effect of selecting the target numbering structure according to the priority rule of "previous context takes precedence over next context and is closest" can also be achieved in the following manner: starting from the cursor position, the existing numbering structures in the first document are matched one by one upwards, and when a numbering structure that meets the set conditions is matched, the matching is stopped, and the numbering structure that is currently matched to meet the set conditions is determined as the target numbering structure. If a numbering structure that meets the set conditions is not matched in the previous context, the existing numbering structures in the first document are matched one by one downwards starting from the cursor position, and when a numbering structure that meets the set conditions is matched, the matching is stopped, and the numbering structure that is currently matched to meet the set conditions is determined as the target numbering structure.

[0162] Through the above implementation, there is no need to directly perform full text matching in the second document, but to perform matching one by one in order according to the set priority matching rules, and stop matching once a numbering structure that meets the set conditions is matched. This can save matching resources and improve matching efficiency.

[0163] Exemplarily, the set priority matching rule is: preferentially selecting the numbering structure that meets the set conditions under the same title or the same container (such as a table, a highlight block, a column, etc.) to determine as the target numbering structure.

[0164] For example, see Fig. 9 for an example. Fig. 9 There are two existing numbered structures in Fig. 9 , one above and one below the cursor position, and the two numbered structures are under different headings. When the user wants to add a target number at the cursor position, the reference number is "1.", and based on the number level and number type of this reference number "1.", both of these two existing numbered structures can be determined as numbered structures that meet the set conditions. However, the target number types determined based on these two existing numbered structures are inconsistent. For example, the target number type determined based on the numbered structure above the cursor is a number type that combines numbers and circles, while the target number type determined based on the numbered structure below the cursor is a number type that combines Chinese characters and ".". In this regard, according to the priority rule of preferentially selecting the same heading, the numbered structure below the cursor is selected as the target numbered structure. Then, based on this target numbered structure, the number "1." is inserted at the cursor position.

[0165] As an alternative implementation, when the second document is the first document, the same effect of selecting the target numbered structure according to the priority rule of "preferentially selecting the numbered structure that meets the set conditions under the same heading or the same container (such as a table, a highlighted block, a column, etc.)" can also be achieved in the following way: Determine the heading range / container where the cursor is located, and starting from the cursor position, match the existing numbered structures one by one upward within this heading range / container. When a numbered structure that meets the set conditions is matched, stop the matching and determine the currently matched numbered structure that meets the set conditions as the target numbered structure. If no numbered structure that meets the set conditions is matched above the cursor, then within this heading range / container, starting from the cursor position, match the existing numbered structures one by one downward. When a numbered structure that meets the set conditions is matched, stop the matching and determine the currently matched numbered structure that meets the set conditions as the target numbered structure. If no numbered structure that meets the set conditions is matched within this heading range / container, then the matching can be performed in the part of the first document other than this heading range / container according to the priority rule of "above the cursor is preferred to below the cursor, and the closest one".

[0166] In addition, in one embodiment, in combination with the method of determining the target numbered structure in the second document according to the set priority matching rule, when obtaining the reference number of the target number, only one reference number can also be obtained. For example, in Figure 7In the example, only the number before the target number, i.e., "(1).", is obtained as the reference number, and based on this reference number, a match is made in the existing numbering structure of the second document. Although two numbering structures that meet the set conditions can be matched, by combining the set priority matching rules, such as the priority matching rule of "the upper text takes precedence over the lower text", a target numbering structure can be selected from them. In this way, even if only one level of reference label is obtained, it can be ensured that an accurate target number type is matched for the target number.

[0167] As can be seen from the above description, the second document can be the first document or other documents. In this regard, the following several situations can be discussed:

[0168] In one embodiment, the second document is the first document. At this time, to determine the target number type of the target number according to the existing numbering structure in the second document, it includes: obtaining the existing numbering structure in the first document and determining the target number type of the target number according to the existing numbering structure in the first document.

[0169] In one embodiment, the second document is other documents. At this time, to determine the target number type of the target number according to the existing numbering structure in the second document, it includes: obtaining the associated document of the first document as the second document, obtaining the existing numbering structure in the second document, and determining the target number type of the target number according to the existing numbering structure in the second document.

[0170] Exemplarily, the associated document of the first document is a document with the same theme category as the first document. Then, the theme category of the first document can be determined, and then the second document can be selected from the document set belonging to this theme category. For example, the most recently edited document can be selected as the second document, or the document with the most access times can be selected as the second document, etc., which are not limited here.

[0171] Exemplarily, the associated document of the first document is a pre-specified document. In this way, the user is allowed to specify a document as a model to assist in editing the first document. This method can not only greatly improve the efficiency and accuracy of document editing, but also help to maintain the consistency and professionalism of the document.

[0172] In another embodiment, the second document includes the first document and other documents. In this embodiment, as an optional implementation method, when automatically matching the target number type for the target number according to the existing numbering structure, priority is given to matching the target number with the accurate number type from the first document, that is, the document currently being edited. In the case where the accurate number type is not matched from the first document, the associated document of the first document is obtained as the second document, and the accurate number type is matched for the target number in the second document. Further, in the case where the accurate number type is not matched in the second document, that is, in the case where the target number type of the target number cannot be determined according to the existing numbering structure in the second document, the specified number type is determined as the target number type of the target number.

[0173] By applying the processing method provided in this embodiment, by giving priority to matching the numbers within the document, the standardization and consistency of the numbers in the same document can be prioritized. When the exact numbering type cannot be matched within the document, the first choice is to match the numbers in the associated documents of the document, which can meet the need to maintain a consistent numbering structure in multiple documents, enhance the consistency between documents, and allow users to quickly reuse the numbering structure in other documents, thereby meeting the diverse demands of users when writing multi-level content. When the exact numbering type cannot be matched in the document, an option to use a specified numbering type is provided to meet the automatic numbering needs in special circumstances.

[0174] Based on any of the above embodiments, the present application also provides the following embodiments:

[0175] In one embodiment, in response to a numbering type modification operation on an existing numbering structure in a second document, the numbering type of a number that inherits the existing numbering structure in a first document is synchronously modified; wherein the number that inherits the existing numbering structure refers to: a number added by applying a target numbering type determined according to the existing numbering structure.

[0176] In this regard, as an optional implementation, when a modification operation of the numbering type of an existing numbering structure in the second document is detected, a pop-up window is used to prompt the user to select whether to synchronously modify the numbering type of the numbering that inherits the existing numbering structure in the first document. If the user chooses to modify synchronously, the numbering type of the numbering that inherits the existing numbering structure in the first document is modified synchronously; if the user chooses not to modify synchronously, no processing is performed.

[0177] By applying this embodiment, the consistency of numbering in the document can be effectively ensured, confusion and errors caused by inconsistent numbering types can be reduced, and the workload of users who need to manually update numbering types can be reduced, thereby improving the work efficiency of users.

[0178] In addition, in this embodiment, the following situations can be further discussed:

[0179] Exemplarily, if the second document is the first document, in response to a numbering type modification operation on an existing numbering structure in the first document, the numbering type of the numbering that inherits the existing numbering structure in the first document is synchronously modified.

[0180] If the second document is not the first document but other documents, in response to the numbering type modification operation on the existing numbering structure in the first document, the numbering type of the numbers in the first document that inherit the existing numbering structure is not modified synchronously.

[0181] Exemplarily, in the case of synchronously modifying the numbering type of the numbering that inherits the existing numbering structure in the first document, the scope of the synchronous modification can be the entire text or a part. Optionally, the local modification can be a modification range specified by the user, or a range within the same title interval, or a range within the same container, etc., which is not limited in the embodiments of the present application.

[0182] Furthermore, after the existing numbering structure in the document is modified, a new existing numbering structure will be formed. Please refer to the above description for the specific logic of distinguishing the numbering structure, which will not be repeated here.

[0183] In one embodiment, even if the target number is automatically generated by applying the technical solution provided in the embodiment of the present application, in actual application, the user can also choose to manually modify the automatically generated target number, and the modification here includes modifying the numbering style, numbering type, etc. By allowing the user to manually modify the automatically generated number, the flexibility of the system can be greatly improved to meet the diverse needs of users.

[0184] Furthermore, in response to the numbering type modification operation on the target number, the numbering structure to which the target number belongs is determined as the existing numbering structure in the first document. By updating the existing numbering structure in the document, the consistency of the numbering in the document can be effectively ensured to avoid numbering confusion.

[0185] For example, since usually users' modifications to the automatically generated target number are mostly to modify its numbering type or other numbering styles, which will not change the numbering structure to which the target number belongs, the numbering structure to which the target number belongs can be determined here based on the starting line number and ending line number of the previously recorded numbering structure, and the numbering structure can be used as a new existing numbering structure in the document.

[0186] Fig.10 This is a block diagram of an embodiment of a device for adding numbers to a document provided in an embodiment of the present application. Fig.10 As shown, the device comprises:

[0187] A numbering type determining module 1001 is configured to, in response to an adding instruction for adding a target number in a first document, determine a target numbering type of the target number according to an existing numbering structure in a second document when a numbering level of the target number is inconsistent with a numbering level of a reference number, wherein the reference number is a number located before the target number in the first document;

[0188] The number adding module 1002 is used to add a number of the target number type at the cursor position in the first document as the target number.

[0189] In a possible implementation, the numbering type determination module 1001 includes:

[0190] A first determining unit, configured to determine a target level relationship between the target number and the reference number, and to determine a first numbering level and a first numbering type of the reference number;

[0191] A second determining unit, configured to determine a target numbering structure from an existing numbering structure in a second document;

[0192] A third determining unit, configured to determine the numbering type of the number corresponding to the second numbering level in the target numbering structure as the target numbering type;

[0193] Among them, in the target numbering structure, the second numbering type of the number corresponding to the first numbering level is consistent with the first numbering type; the second numbering level refers to the numbering level that has the target level relationship with the numbering level of the reference number.

[0194] In a possible implementation, the numbering type determination module 1001 includes:

[0195] a searching unit, configured to search for an existing numbering structure in the second document according to the first numbering level and the first numbering type, wherein the existing numbering structure in the second document refers to a numbering structure in the full text of the second document;

[0196] A fourth determining unit, configured to determine the found numbering structure as a target numbering structure when a numbering structure that meets a set condition is found;

[0197] a fifth determining unit, configured to determine a target numbering structure from the at least two numbering structures found when at least two numbering structures satisfying a set condition are found;

[0198] The setting condition is as follows: in the existing numbering structure, the second numbering type of the number corresponding to the first numbering level is consistent with the first numbering type.

[0199] In a possible implementation manner, the fifth determining unit is specifically configured to:

[0200] According to the set priority matching rule, a target numbering structure is determined from at least two numbering structures found.

[0201] In a possible implementation manner, the second document is the first document, and the numbering type determination module includes:

[0202] A first acquisition unit, configured to acquire an existing numbering structure in the first document;

[0203] A sixth determining unit is used to determine a target numbering type of the target numbering according to an existing numbering structure in the first document.

[0204] In a possible implementation manner, the second document is an associated document of the first document; and the numbering type determination module includes:

[0205] A second acquisition unit, configured to acquire a document associated with the first document as a second document;

[0206] A third acquisition unit, used to acquire an existing numbering structure in the second document;

[0207] A seventh determining unit is used to determine a target numbering type of the target numbering according to an existing numbering structure in the second document.

[0208] In a possible implementation manner, the numbering type determination module 1001 is further configured to:

[0209] In a case where the target number type of the target number cannot be determined according to the existing numbering structure in the second document, a designated numbering type is determined as the target number type of the target number.

[0210] In a possible implementation, it further includes:

[0211] A synchronous updating module, configured to synchronously modify the numbering type of the numbering that inherits the existing numbering structure in the first document in response to a numbering type modification operation on the existing numbering structure in the second document;

[0212] The numbering that inherits the existing numbering structure refers to: a numbering that is added by applying a target numbering type determined according to the existing numbering structure.

[0213] In a possible implementation, it further includes:

[0214] A numbering structure construction module is used to add a number of the target numbering type at the cursor position in the first document as the target number, and then, in response to a numbering type modification operation on the target number, determine the numbering structure to which the target number belongs as an existing numbering structure in the first document.

[0215] like Fig.11 As shown, an embodiment of the present application provides a device, including a processor 111, a communication interface 112, a memory 113 and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.

[0216] Memory 113, used for storing computer programs;

[0217] In one embodiment of the present application, the processor 111 is configured to execute a program stored in the memory 113 to implement the method for adding a number to a document provided by any one of the aforementioned method embodiments, including:

[0218] In response to an instruction to add a target number in the first document, when the numbering level of the target number is inconsistent with the numbering level of the reference number, determining the target number type of the target number according to an existing numbering structure in the second document, wherein the reference number is a number located before the target number in the first document;

[0219] A number of the target number type is added at the cursor position in the first document as the target number.

[0220] An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the method for adding numbers to a document provided in any one of the aforementioned method embodiments are implemented.

[0221] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0222] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0223] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.

[0224] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can 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 range consistent with the principles and novel features applied for herein.

Claims

1. A method for adding numbers to a document, characterized in that: The method comprises: In response to an instruction to add a target number in the first document, when the numbering level of the target number is inconsistent with the numbering level of the reference number, determining the target number type of the target number according to an existing numbering structure in the second document, wherein the reference number is a number located before the target number in the first document; A number of the target number type is added at the cursor position in the first document as the target number.

2. The method according to claim 1, characterized in that The step of determining the target numbering type of the target numbering according to the existing numbering structure in the second document includes: Determining a target hierarchical relationship between the target number and the reference number, and determining a first numbering level and a first numbering type of the reference number; determining a target numbering structure from existing numbering structures in a second document; Determine the numbering type of the number corresponding to the second numbering level in the target numbering structure as the target numbering type; Among them, in the target numbering structure, the second numbering type of the number corresponding to the first numbering level is consistent with the first numbering type; the second numbering level refers to the numbering level that has the target level relationship with the numbering level of the reference number.

3. The method according to claim 2, characterized in that The step of determining the target numbering structure from the existing numbering structure in the second document includes: searching for an existing numbering structure in the second document according to the first numbering level and the first numbering type, wherein the existing numbering structure in the second document refers to a numbering structure in the full text of the second document; When a numbering structure that meets the set conditions is found, the found numbering structure is determined as the target numbering structure; In the case where at least two numbering structures satisfying the set condition are found, a target numbering structure is determined from the at least two numbering structures found; The setting condition is as follows: in the existing numbering structure, the second numbering type of the number corresponding to the first numbering level is consistent with the first numbering type.

4. The method according to claim 3, characterized in that The step of determining a target numbering structure from the at least two numbering structures found includes: According to the set priority matching rule, a target numbering structure is determined from the at least two numbering structures found.

5. The method according to claim 1, characterized in that The second document is the first document, and the determining the target numbering type of the target numbering according to the existing numbering structure in the second document includes: Obtaining an existing numbering structure in the first document; The target numbering type of the target numbering is determined according to the existing numbering structure in the first document.

6. The method according to claim 1, characterized in that The second document is an associated document of the first document; and determining the target numbering type of the target numbering according to the existing numbering structure in the second document includes: Acquire a document associated with the first document as a second document; Obtaining an existing numbering structure in the second document; The target numbering type of the target numbering is determined according to the existing numbering structure in the second document.

7. The method according to claim 5 or 6, characterized in that: Also includes: In a case where the target number type of the target number cannot be determined according to the existing numbering structure in the second document, a designated numbering type is determined as the target number type of the target number.

8. The method according to claim 1, characterized in that Also includes: In response to a numbering type modification operation on an existing numbering structure in the second document, synchronously modifying the numbering type of numbers in the first document that inherit the existing numbering structure; The numbering that inherits the existing numbering structure refers to: a numbering that is added by applying a target numbering type determined according to the existing numbering structure.

9. The method according to claim 1, characterized in that: Adding a number of the target number type at the cursor position in the first document as the target number, further comprising: In response to a numbering type modification operation on the target number, the numbering structure to which the target number belongs is determined to be an existing numbering structure in the first document.

10. A device for adding numbers to a document, characterized in that: The device comprises: a numbering type determining module, configured to, in response to an adding instruction to add a target number in the first document, determine a target numbering type of the target number according to an existing numbering structure in a second document when the numbering level of the target number is inconsistent with the numbering level of the reference number, wherein the reference number is a number located before the target number in the first document; A number adding module is used to add a number of the target number type at the position of the cursor in the first document as the target number.

11. A device, characterized in that: include: A processor and a memory, wherein the processor is used to execute a program for adding numbers to a document stored in the memory, so as to implement the method for adding numbers to a document according to any one of claims 1 to 9.

12. A storage medium, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the method for adding numbers to a document according to any one of claims 1 to 9.