A number verification method, apparatus, electronic device and storage medium

By defining the document numbering structure and providing error message functionality, the problems of inconsistent and duplicate document numbers were resolved, improving the efficiency and corrective capabilities of numbering checks.

CN115310411BActive Publication Date: 2026-07-17ZHUHAI KINGSOFT OFFICE SOFTWARE +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHUHAI KINGSOFT OFFICE SOFTWARE
Filing Date
2021-05-06
Publication Date
2026-07-17

Smart Images

  • Figure CN115310411B_ABST
    Figure CN115310411B_ABST
Patent Text Reader

Abstract

This application provides a number verification method, apparatus, electronic device, and storage medium, relating to the field of computer technology. The method includes: determining the numbering structure of a document, the numbering structure containing hierarchical numbers, with each level corresponding to a numbering pattern; for multiple numbers within the same level, determining whether the multiple numbers are arranged in a specified order and whether all multiple numbers conform to the numbering pattern corresponding to the same level; if the determination result is negative, determining that there is an error in the numbering in the document. Using this application can improve the efficiency of checking the numbering in documents.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a number verification method, apparatus, electronic device, and storage medium. Background Technology

[0002] Currently, when users edit documents, they can number paragraphs to make the content hierarchy clearer. Related technologies include document software with numbering templates. Users can select a template, and if a user triggers a line break during document editing, the software will automatically use that template to number the new paragraphs, ensuring a consistent numbering format within the same level.

[0003] However, users may make numbering errors due to a lack of knowledge about using numbering templates. For example, if a user manually enters "1" for text editing and then presses Enter, the document software will automatically use the numbering template, resulting in "2" appearing at the beginning of the second paragraph. If the user then moves the cursor to the third paragraph, the automatic numbering function won't be triggered, and the user might manually enter "3" in the third paragraph. If the user then presses Enter again, the document software will continue automatically numbering from "2," resulting in "3" appearing again in the fourth paragraph, leading to duplicate numbering. Furthermore, different users have different operating habits, and improper use of the numbering template can also cause inconsistencies in numbering styles at the same level, among other numbering errors.

[0004] In cases of incorrect numbering, users can only check each number individually, which is inefficient. Summary of the Invention

[0005] The purpose of this application is to provide a number verification method, apparatus, electronic device, and storage medium to improve the efficiency of checking numbers in documents. The specific technical solution is as follows:

[0006] In a first aspect, embodiments of this application provide a number verification method, the method comprising:

[0007] The document numbering structure is determined, wherein the numbering structure includes numbering divided by levels, and each level corresponds to a numbering style;

[0008] For multiple numbers in the same level, determine whether the multiple numbers are arranged in a specified order and whether the multiple numbers all conform to the numbering pattern corresponding to the same level;

[0009] If the result is negative, then the numbering in the document is incorrect.

[0010] In one possible implementation, after determining whether the plurality of numbers are arranged in a specified order and whether the plurality of numbers all conform to the numbering pattern corresponding to the same level, the method further includes:

[0011] In the case where there are non-contiguous numbers among the plurality of numbers, it is determined that one or more adjacent non-contiguous numbers are not arranged in the specified order;

[0012] Numbers that do not conform to the numbering style corresponding to the level to which the multiple numbers belong are identified as not conforming to the numbering style corresponding to the same level.

[0013] In one possible implementation, determining the document numbering structure includes:

[0014] Extract all the numbers from the document;

[0015] The extracted numbers are arranged in the order of their appearance in the document to generate a number list;

[0016] Based on the numbering order and numbering style of each number contained in the numbering list, the level to which each number belongs and the numbering style corresponding to each level are determined to generate the numbering structure of the document.

[0017] In one possible implementation, the step of determining the level to which each number belongs and the corresponding numbering style for each level based on the numbering order and numbering style of each number contained in the numbering list, in order to generate the numbering structure of the document, includes:

[0018] Extract each number sequentially from the list of numbers and use it as the current number;

[0019] If the current number is the first number in the number list, or if the current number's sequence number belongs to a preset number sequence number set, a new number group is created, and the current number is added to the newly created number group; the preset number sequence number set contains the first number sequence number of each type in the number hierarchy;

[0020] If the current number is not the first number in the number list, and the current number's order does not belong to the preset number sequence set, then the current number is added to the target number group; the target number group is the number group that meets the matching conditions most often with the current number among the candidate number groups, and the candidate number group is the number group that has been created.

[0021] After all the numbers in the number list are added to the number groups, for each number group, all the numbers contained in the number group are determined to be numbers of the same level, and the number style corresponding to the number group is set to the number style of the first number included in the number group, so as to generate the number structure of the document.

[0022] In one possible implementation, the matching conditions include one or more of the following:

[0023] The numbering pattern of the first number in the candidate numbering group is consistent with the numbering pattern of the current number;

[0024] The distance between the order of the last number in the candidate numbering group and the order of the current number is the shortest among all created numbering groups;

[0025] The candidate number group is closest to the position of the last number in the number list and the position of the current number in the number list. The distance between the position of the last number in the candidate number group and the position of the current number in the number list is the number of numbers contained between the positions of the last number and the current number in the number list plus one.

[0026] In one possible implementation, before determining the numbering structure of all numbers included in the document, the method further includes:

[0027] Receive serial number verification instructions;

[0028] In response to the numbering verification instruction, perform the step of determining the numbering structure of the document.

[0029] In one possible implementation, after determining that the numbering in the document is incorrect, the method further includes:

[0030] An error message is displayed in the document.

[0031] In one possible implementation, error messages are displayed in the document, including:

[0032] Display an error message box in the document; or,

[0033] An error message is displayed at the error number in the document; or,

[0034] The numbers of errors in the document are highlighted.

[0035] In one possible implementation, the error message box includes an error reason, which is either an incorrect numbering order or an incorrect numbering style.

[0036] In one possible implementation, after displaying an error message at the location where the error occurred in the document, the method further includes:

[0037] In response to an operation on the error message symbol, an error message box is displayed in the document, the error message box including the error reason, which is an incorrect numbering order or an incorrect numbering style.

[0038] In one possible implementation, the error message box further includes an automatic correction option; after the error message box is displayed in the document, the method further includes:

[0039] In response to the triggering of the automatic correction option, the numbering order and / or numbering style of the erroneous numbers are modified.

[0040] Secondly, embodiments of this application provide a number verification device, the device comprising:

[0041] The determination module is used to determine the numbering structure of the document, wherein the numbering structure contains numbering divided by levels, and each level corresponds to a numbering style;

[0042] The judgment module is used to determine whether multiple numbers in the same level are arranged in a specified order and whether the multiple numbers all conform to the numbering style corresponding to the same level.

[0043] The determining module is further configured to determine that there is an error in the numbering in the document if the judgment result of the judging module is negative.

[0044] In one possible implementation, the determining module is further configured to:

[0045] In the case where there are non-contiguous numbers among the plurality of numbers, it is determined that one or more adjacent non-contiguous numbers are not arranged in the specified order;

[0046] Numbers that do not conform to the numbering style corresponding to the level to which the multiple numbers belong are identified as not conforming to the numbering style corresponding to the same level.

[0047] In one possible implementation, the determining module is specifically used for:

[0048] Extract all the numbers from the document;

[0049] The extracted numbers are arranged in the order of their appearance in the document to generate a number list;

[0050] Based on the numbering order and numbering style of each number contained in the numbering list, the level to which each number belongs and the numbering style corresponding to each level are determined to generate the numbering structure of the document.

[0051] In one possible implementation, the determining module is specifically used for:

[0052] Extract each number sequentially from the list of numbers and use it as the current number;

[0053] If the current number is the first number in the number list, or if the current number's sequence number belongs to a preset number sequence number set, a new number group is created, and the current number is added to the newly created number group; the preset number sequence number set contains the first number sequence number of each type in the number hierarchy;

[0054] If the current number is not the first number in the number list and the current number's order does not belong to the preset number sequence set, the current number is added to the target number group; the target number group is the number group that meets the most matching conditions with the current number among the candidate number groups, and the candidate number group is the number group that has been created.

[0055] After adding all the numbers in the number list to the number group, for each number group, all the numbers contained in the number group are determined to be numbers of the same level, and the number style corresponding to the number group is set to the number style of the first number included in the number group, so as to generate the number structure of the document.

[0056] In one possible implementation, the matching conditions include one or more of the following:

[0057] The numbering pattern of the first number in the candidate numbering group is consistent with the numbering pattern of the current number;

[0058] The distance between the order of the last number in the candidate numbering group and the order of the current number is the shortest among all created numbering groups;

[0059] The candidate number group is closest to the position of the last number in the number list and the position of the current number in the number list. The distance between the position of the last number in the candidate number group and the position of the current number in the number list is the number of numbers contained between the positions of the last number and the current number in the number list plus one.

[0060] In one possible implementation, the device further includes:

[0061] A receiving module is used to receive a number verification instruction; in response to the number verification instruction, the determining module is triggered to execute the step of determining the numbering structure of the document.

[0062] In one possible implementation, the device further includes:

[0063] The display module is used to display error messages in the document.

[0064] In one possible implementation, the display module is specifically used for:

[0065] Display an error message box in the document; or,

[0066] An error message is displayed at the error number in the document; or,

[0067] The numbers of errors in the document are highlighted.

[0068] In one possible implementation, the error message box includes an error reason, which is either an incorrect numbering order or an incorrect numbering style.

[0069] In one possible implementation, the display module is further configured to display an error message box in the document in response to an operation on the error message symbol, the error message box including an error reason, the error reason being an incorrect numbering order or an incorrect numbering style.

[0070] In one possible implementation, the error message box further includes an automatic correction option; the device also includes:

[0071] The modification module is used to modify the numbering order and / or numbering style of the erroneous numbers in response to the triggering operation of the automatic correction option.

[0072] Thirdly, embodiments of this application provide an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;

[0073] Memory, used to store computer programs;

[0074] When a processor executes a program stored in memory, it implements the steps of the method described in the first aspect.

[0075] Fourthly, a computer-readable storage medium is provided, wherein a computer program is stored therein, and when executed by a processor, the computer program implements the steps of the method described in the first aspect.

[0076] Fifthly, a computer program product containing instructions is provided that, when run on a computer, causes the computer to perform the method described in the first aspect.

[0077] By employing the above technical solution, the document's numbering structure can be determined. This structure includes hierarchical numbering, with each level corresponding to a specific numbering pattern. Once the document's numbering structure is determined, it can be verified whether multiple numbers within the same level are arranged in a specified order and whether all numbers conform to the corresponding numbering pattern for that level. If the verification result is negative, an error in the document's numbering can be identified. This process eliminates the need for manual user inspection, significantly improving efficiency compared to manually checking each number one by one.

[0078] Of course, implementing any product or method of this application does not necessarily require achieving all of the advantages described above at the same time. Attached Figure Description

[0079] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0080] Figure 1 A flowchart illustrating a number verification method provided in this application embodiment;

[0081] Figure 2 A flowchart illustrating another number verification method provided in this application embodiment;

[0082] Figure 3 This is a schematic diagram of the structure of a number verification device provided in an embodiment of this application;

[0083] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

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

[0085] To improve the efficiency of checking document numbers, this application provides a number verification method that can be applied to electronic devices, such as... Figure 1As shown, the method includes:

[0086] S101. Determine the document numbering structure, which includes hierarchical numbering and a corresponding numbering style for each level.

[0087] Here, the document is the document that needs to be verified. In one embodiment, the electronic device can receive a number verification instruction and, in response to the number verification instruction, execute S101.

[0088] The numbering verification instruction can be triggered by the user. For example, the document editing page can display a numbering verification function button. When the user triggers the button, the electronic device can receive the numbering verification instruction.

[0089] The embodiments of this application do not limit the appearance of the function button for number verification. For example, the function button can be displayed as a specified icon, or the function button can be an option in a drop-down menu of the menu bar.

[0090] The numbering structure can contain multiple levels of numbering, such as numbering for first-level headings, second-level headings, third-level headings, etc. Furthermore, numbering at the same level should correspond to the same numbering style; for example, first-level headings should be numbered with uppercase numbers, second-level headings with lowercase numbers, and third-level headings with letters.

[0091] S102. For multiple numbers in the same level, determine whether the multiple numbers are arranged in a specified order and whether the multiple numbers all conform to the numbering style corresponding to the same level.

[0092] In this embodiment, the electronic device needs to perform the above-mentioned judgment for multiple numbers in each level. The specified order is the natural order corresponding to the numbering format. For example, when the numbering format is numbers, the specified order is the order of numbers from smallest to largest; when the numbering format is English letters, the specified order is the order of English letters in the English alphabet.

[0093] In one embodiment of this application, it is assumed that the numbering structure includes numbers for first-level headings, second-level headings, and third-level headings. Specifically, when the numbering style for first-level headings is uppercase digits, all first-level heading numbers are uppercase digits. In this step, for each of the multiple numbers included in a first-level heading, it is necessary to determine whether the multiple numbers are arranged in ascending order and whether all multiple numbers are uppercase digits. Similarly, when the numbering style for second-level headings is English letters, all second-level heading numbers are English letters. In this step, for each of the multiple numbers included in a second-level heading, it is necessary to determine whether the multiple numbers are arranged in alphabetical order and whether all multiple numbers are English letters.

[0094] S103. If the judgment result is negative, determine that there is an error in the numbering in the document.

[0095] If, for multiple numbers within the same level, the numbers are not arranged in the specified order, or the numbers do not conform to the numbering style corresponding to that level, it can be determined that there is an error in the numbering in the document.

[0096] If the above judgment result is yes, that is, for multiple numbers in the same level, if the multiple numbers are arranged in the specified order and the multiple numbers conform to the numbering style corresponding to the level, then it can be determined that there are no errors in the numbering in the document.

[0097] By employing the above technical solution, the document's numbering structure can be determined. This structure includes hierarchical numbering, with each level corresponding to a specific numbering pattern. Once the document's numbering structure is determined, it can be verified whether multiple numbers within the same level are arranged in a specified order and whether all numbers conform to the corresponding numbering pattern for that level. If the verification result is negative, an error in the document's numbering can be identified. This process eliminates the need for manual user inspection, significantly improving efficiency compared to manually checking each number one by one.

[0098] In one embodiment of this application, such as Figure 2 As shown, in step S101 above, determining the document numbering structure can be achieved through the following steps:

[0099] S201. Extract all the numbers from the document.

[0100] Electronic devices can use regular expressions to extract all numbers from a document. A regular expression is a logical formula for manipulating strings and special characters. It uses predefined specific characters and combinations of these characters to form a "rule string," which expresses a filtering logic for the string. Applying this "rule string" can search for multiple numbers in a document and extract them.

[0101] S202. Arrange the extracted numbers according to their order of appearance in the document to generate a number list.

[0102] In an embodiment of the present application, in step S201, multiple regular expressions corresponding to different numbering styles are used to sequentially extract numbers of different numbering styles in the document. At the same time, when using regular expressions to extract numbers from the document, record the positions of the extracted numbers in the document. Among them, the position is the starting character position and the ending character position of the number in the document. Further, according to the recorded positions, determine the order of appearance of the numbers of all the extracted numbering styles in the document.

[0103] In another embodiment of the present application, in step S201, directly use a single regular expression to extract all numbers of different numbering styles from the document, and the corresponding extracted numbers are directly arranged in the order of appearance in the document.

[0104] After generating the number list, according to the number order and numbering style of each number included in the number list, determine the level to which each number belongs and the numbering style corresponding to each level, and generate the number structure of the document according to the level to which each number belongs and the numbering style corresponding to each level.

[0105] Among them, according to the number order and numbering style of each number included in the number list, determine the level to which each number belongs and the numbering style corresponding to each level, and generate the number structure of the document according to the level to which each number belongs and the numbering style corresponding to each level. Specifically, it can be implemented as the following S203 to S206.

[0106] S203. Sequentially extract each number from the number list as the current number.

[0107] S204. In the case where the current number is the first number in the number list or the number sequence number of the current number belongs to a preset number sequence number set, create a new number group and add the current number to the newly created number group.

[0108] Among them, the preset number sequence number set includes the first number sequence numbers of various types in the number level. For example, the number sequence number list set may include: one, 1, (1), a, A, etc. The number sequence numbers included in the number sequence number list set can all be ranked in the first order in a number level as the starting number sequence number in a number level.

[0109] For example, assume that the number list includes "one, 1, 2, 3, a, c, two, three". If the current number is "one", it can be determined that the current number is the first number in the number list; create a new number group and add the current number "one" to the newly created number group. For ease of description, this number group can be called number group 1.

[0110] For example, if the current number is "1", then it can be determined that the current number belongs to the aforementioned preset number set; a new number group is created, and the current number "1" is added to the new number group. For ease of description, this number group can be called number group 2.

[0111] For example, if the current number is "2", it can be determined that the current number is not the first number in the number list, and the number sequence of the current number does not belong to the preset number sequence set. Then, the next step can be executed for the current number "2", namely step S205.

[0112] S205. If the current number is not the first number in the number list and the current number's order does not belong to the preset number order set, add the current number to the target number group.

[0113] Among them, the target number group is the number group that meets the matching conditions most often with the current number among the candidate number groups, and the candidate number group is the number group that has been created.

[0114] For example, the matching criteria include, but are not limited to, one or more of the following criteria:

[0115] Condition 1: The numbering pattern of the first number in the candidate numbering group is consistent with the numbering pattern of the current number.

[0116] The numbering style of the first number in the candidate numbering group can be defined as the numbering style of the level to which the candidate numbering group belongs. Of course, condition 1 can also be changed to: the numbering style of the level represented by the candidate numbering group is consistent with the numbering style of the current number.

[0117] Condition 2: The distance between the order of the last number in the candidate number group and the order of the current number is the shortest among all created number groups.

[0118] In one embodiment of this application, when the number is a numeric number, the distance between two numeric numbers is calculated using the difference between the numeric numbers; the difference between the two numeric numbers is the distance between their order. When the number is a letter or special character, the distance between their order is calculated using the difference in their order; that is, the difference between two letters or special characters is the distance between their order. For example, if the letter 'b' is the second letter in the English alphabet and its number is 2, and the number '1' is the first number in the Arabic numerals, then the distance between the number of the letter 'b' and the number '1' is 1.

[0119] Among them, the last number in the candidate number group is the number that was last added to this candidate number group. If a new number is added, then this new number is the last number in this candidate number group.

[0120] For example, currently, number groups 1, 2, and 3 have been created. The last number in number group 1 is three, the last number in number group 2 is 2, and the last number in number group 3 is F. If the current number is 4, it can be determined that the distance between the sequence number of the last number in number group 1 and the sequence number of the current number is the shortest among all the created number groups.

[0121] Condition 3: The distance between the position of the last number in the candidate number group in the number list and the position of the current number in the number list is the shortest.

[0122] Among them, the distance between the position of the last number in the number list and the position of the current number in the number list is the number of numbers included between the position of the last number in the number list and the position of the current number in the number list plus one.

[0123] Combined with the example in S204, the currently created number groups 1 and 2 are both candidate number groups.

[0124] If the current number is "2", then the current number "2" can be matched with number group 1.

[0125] For condition 1, the first number included in number group 1 is "one". Obviously, the current number "2" does not match the number style of "one" included in number group 1, so it does not meet condition 1.

[0126] For condition 2, the last number currently included in number group 1 is "one", and the distance between the current number "2" and the number "one" is 1.

[0127] For condition 3, the last number currently included in number group 1 is "one", which is the 1st number in the number list. The current number "2" is the 3rd number in the number list. The distance between the two is 2.

[0128] Then, match the current number "2" with number group 2.

[0129] For condition 1, the first number included in number group 2 is "1", and the current number "2" is the same as the number "1" included in number group 2, so it meets condition 1.

[0130] For condition 2, the last number currently included in number group 2 is "1", and the distance between the current number "2" and the number "1" is 1.

[0131] For condition 3, the last number currently included in number group 2 is "1", which is the second number in the number list. The current number "2" is the third number in the number list. The distance between the two is 1.

[0132] By comparison, it can be seen that the matching condition satisfied between the current number "2" and number group 2 is the most. Therefore, the current number "2" is added to number group 2.

[0133] Of course, in this embodiment, the above three conditions are not limited, and more conditions can also be set to assist in determining the level to which the number belongs and the number style corresponding to each level.

[0134] S206. After all the numbers in the number list are added to the number groups, for each number group, all the numbers included in the number group are determined as numbers at the same level, and the number style corresponding to the number group is set to the number style of the first number included in the number group, thereby generating the number structure of the document.

[0135] As an example, for the number list "one, 1, 2, 3, a, c, two, three", 3 number groups can be obtained. Number group 1 includes "one, two, three", number group 2 includes "1, 2, 3", and number group 3 includes "a, c".

[0136] By using the above method, all the numbers in the document can be extracted, and the number structure of the extracted numbers in the document can be accurately restored, which is convenient for subsequently checking whether there are errors in the numbers in the document through the number structure, and can improve the checking efficiency.

[0137] In an embodiment of the present application, after determining the number structure of the document, the above S102 can be executed. For multiple numbers at the same level, it is judged whether the multiple numbers are arranged in a specified order and whether all the multiple numbers conform to the number style corresponding to the same level. After the judgment of S102, if it is determined that the multiple numbers are not arranged in a specified order, then among the multiple numbers, the numbers that are not arranged in a specified order are further determined; if it is determined that not all the multiple numbers conform to the number style corresponding to the same level, then among the multiple numbers, the numbers that do not conform to the number style corresponding to the same level can be further determined. Therefore, after the above S102, the method further includes:

[0138] In the case where there are discontinuous numbers among the above multiple numbers, it is determined that one or more adjacent discontinuous numbers are not arranged in a specified order. The numbers among the above multiple numbers that are inconsistent with the number style corresponding to the level to which the multiple numbers belong are determined as numbers that do not conform to the number style corresponding to the same level.

[0139] In one embodiment, when there is a number among the above-mentioned multiple numbers that is not consecutive with the adjacent numbers before and after, it can be determined that the number that is not consecutive with the adjacent numbers before and after is not arranged in the specified order.

[0140] For example, the numbers at a certain level include: "1, 2, 5, 4". Among them, the number "5" is not consecutive with the previous adjacent number "2" and the next adjacent number "4", so it can be determined that the number "5" is not arranged in the specified order.

[0141] In another embodiment, when there are at least two consecutive numbers among the above-mentioned multiple numbers, and the at least two consecutive numbers are not consecutive with the previous adjacent number, it is determined that the at least two consecutive numbers are not arranged in the specified order.

[0142] For example, the numbers at a certain level include: "1, 2, 4, 5". Among them, the numbers "4" and "5" are not consecutive with the previous adjacent number "2", so it can be determined that the numbers "4" and "5" are not arranged in the specified order.

[0143] In the embodiments of the present application, for multiple numbers at the same level, if there is a number whose number style is inconsistent with the number style of this level, it is determined that this number does not conform to the number style of this level.

[0144] For example, the number style at a certain level is a capital number followed by a comma. If the numbers at this level include: "one, two, 3, four. five,", it can be determined that the numbers "3," and "four." do not conform to the number style of this level.

[0145] In the embodiments of the present application, the numbers that are not arranged in the specified order and the numbers that do not conform to the number style of the same level both belong to incorrect numbers.

[0146] By using this method, not only can it be determined whether there are incorrect numbers in the document, but also the incorrect numbers in the document can be determined. Equivalent to being able to locate the positions where incorrect numbers appear, which is convenient for viewing and modifying the incorrect numbers, and can improve the efficiency of document editing.

[0147] In another embodiment of the present application, in S103 above, after determining that there are incorrect numbers in the document, the method further includes: displaying an error prompt in the document.

[0148] The embodiments of the present application provide the following three ways to display an error prompt in the document:

[0149] Way 1, display an error prompt box in the document.

[0150] Among them, the error prompt box can be in the form of a floating window or a comment. Of course, the error prompt box can also be displayed in other forms. The embodiments of the present application do not limit the display form of the error prompt box.

[0151] In one implementation, the error cause is displayed in the error prompt box. The error cause is an incorrect numbering order or an incorrect numbering style, and it shows which specific numbers are incorrect. For example, it is displayed in the error prompt box: "The numbering order of numbers 4 and 5 is incorrect."

[0152] Method 2: Display an error prompt symbol at the position of the incorrect number in the document.

[0153] Among them, the error prompt symbol can be an icon in the form of an exclamation mark, or an underline, or other forms of prompt symbols. The embodiments of the present application do not limit the display form of the error prompt symbol.

[0154] In one implementation, the error prompt symbol is an operable error prompt symbol. After displaying the error prompt symbol, in the case of recognizing an operation on the error prompt symbol, in response to the operation on the error prompt symbol, an error prompt box is displayed in the document, and the error prompt box includes the error cause, which can be an incorrect numbering order or an incorrect numbering style.

[0155] Among them, the above operation on the error prompt symbol can be a click operation or a double-click operation by the user on the error prompt symbol. Of course, it can also be other forms of operations, such as voice control. The embodiments of the present application do not limit the operation method.

[0156] The error prompt box can be the same as the error prompt box in Method 1 above. The error prompt box can also include an automatic correction option. After displaying the error prompt box in the document, if the user needs to use the automatic correction function, the automatic correction option can be triggered. Accordingly, in response to the triggering operation on the automatic correction option, the numbering order and / or numbering style of the incorrect number is modified.

[0157] For example, "1, 2, 4, 5," can be modified to "1, 2, 3, 4," and "One, Two, 3, Four. Five," can be modified to "One, Two, Three, Four, Five."

[0158] Method 3: Highlight the incorrect numbers in the document.

[0159] Among them, the background color of the incorrect number can be set to a color, or the font color of the incorrect number can be set to a color. The embodiments of the present application do not limit the above highlighting form. <M [[ID=M

[0160] By employing the three methods described above, when an error is detected in the document's numbering, an error message can be displayed within the document. This allows users to quickly identify the error and view its cause and location, facilitating correction and improving document editing efficiency. Furthermore, this embodiment also provides an automatic correction function. If the user triggers the automatic correction option, the incorrect numbering in the document will be automatically corrected, offering users greater convenience in using the document.

[0161] Based on the same technical concept, embodiments of this application also provide a number verification device, such as... Figure 3 As shown, the device includes:

[0162] The determination module 301 is used to determine the numbering structure of the document. The numbering structure includes numbering divided by levels, and each level corresponds to a numbering style.

[0163] The judgment module 302 is used to determine whether multiple numbers in the same level are arranged in a specified order and whether multiple numbers conform to the numbering style corresponding to the same level.

[0164] The determination module 301 is also used to determine that there is an error in the numbering in the document if the determination result of the determination module 302 is negative.

[0165] In another embodiment of this application, the determining module 301 is further configured to:

[0166] In the case of non-consecutive numbers among multiple numbers, determine that one or more adjacent non-consecutive numbers are not arranged in the specified order;

[0167] Numbers that do not conform to the numbering style corresponding to the level of the multiple numbers are identified as not conforming to the numbering style corresponding to the same level.

[0168] In another embodiment of this application, the determining module 301 is specifically used for:

[0169] Extract all the numbers from the document;

[0170] The extracted numbers are arranged in the order of their appearance in the document to generate a number list;

[0171] Based on the numbering order and style of each number in the numbering list, determine the level to which each number belongs and the corresponding numbering style for each level to generate the document's numbering structure.

[0172] In another embodiment of this application, the determining module 301 is specifically used for:

[0173] Extract each number from the list of numbers in sequence and use it as the current number;

[0174] If the current number is the first number in the number list, or if the current number's sequence number belongs to the preset number sequence number set, create a new number group and add the current number to the new number group; the preset number sequence number set includes the first number sequence number of each type in the number hierarchy;

[0175] If the current number is not the first number in the number list and the current number's order does not belong to the preset number sequence set, the current number will be added to the target number group. The target number group is the number group that matches the current number the most times among the candidate number groups, and the candidate number groups are the number groups that have been created.

[0176] After all the numbers in the numbering list are added to the numbering groups, for each numbering group, all the numbers contained in the numbering group are determined to be numbering at the same level, and the numbering style corresponding to the numbering group is set to the numbering style of the first number included in the numbering group, so as to generate the numbering structure of the document.

[0177] In another embodiment of this application, the matching conditions include one or more of the following:

[0178] The numbering style of the first number in the candidate numbering group is the same as the numbering style of the current number;

[0179] The distance between the order of the last number in the candidate numbering group and the order of the current number is the shortest among all created numbering groups;

[0180] The position of the last number in the candidate number group is closest to the position of the current number in the number list. The distance between the position of the last number in the candidate number group and the position of the current number in the number list is the number of numbers contained between the positions of the last number and the current number in the number list plus one.

[0181] In another embodiment of this application, the device further includes:

[0182] The receiving module is used to receive number verification instructions; in response to the number verification instructions, the determining module is triggered to execute the steps of determining the numbering structure of the document.

[0183] In another embodiment of this application, the device further includes:

[0184] The display module is used to show error messages in the document.

[0185] In one possible implementation, the display module is specifically used for:

[0186] Display an error message box in the document; or,

[0187] Display an error message at the error number in the document; or,

[0188] Highlight the numbers of errors in the document.

[0189] In another embodiment of this application, the error message box includes the error reason, which is either an incorrect numbering order or an incorrect numbering style.

[0190] In another embodiment of this application, the display module is further configured to display an error message box in the document in response to an operation on the error message symbol. The error message box includes the error reason, which is either an incorrect numbering order or an incorrect numbering style.

[0191] In another embodiment of this application, the error message box further includes an automatic correction option; the device also includes:

[0192] The modification module is used to modify the numbering order and / or numbering style of erroneous numbers in response to the triggering of the autocorrect option.

[0193] By employing the above technical solution, the document's numbering structure can be determined. This structure includes hierarchical numbering, with each level corresponding to a specific numbering pattern. Once the document's numbering structure is determined, it can be verified whether multiple numbers within the same level are arranged in a specified order and whether all numbers conform to the corresponding numbering pattern for that level. If the verification result is negative, an error in the document's numbering is confirmed. This process eliminates the need for manual user inspection, significantly improving efficiency compared to manually checking each number one by one.

[0194] This application also provides an electronic device, such as... Figure 4 As shown, it includes a processor 401, a communication interface 402, a memory 403, and a communication bus 404, wherein the processor 401, the communication interface 402, and the memory 403 communicate with each other through the communication bus 404.

[0195] Memory 403 is used to store computer programs;

[0196] When the processor 401 executes the program stored in the memory 403, it implements the method steps in the above method embodiments.

[0197] The communication bus mentioned in the aforementioned electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not indicate that there is only one bus or one type of bus.

[0198] The communication interface is used for communication between the aforementioned electronic devices and other devices.

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

[0200] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0201] Based on the same technical concept, this application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the above-described number verification method steps.

[0202] Based on the same technical concept, embodiments of this application also provide a computer program product containing instructions that, when run on a computer, cause the computer to execute the above-described number verification method steps.

[0203] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).

[0204] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0205] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the apparatus embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0206] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.

Claims

1. A number verification method, characterized in that, The method includes: The document numbering structure is determined, wherein the numbering structure includes numbering divided by levels, and each level corresponds to a numbering style; For multiple numbers at the same level, determine whether the multiple numbers are arranged in a specified order and whether the multiple numbers all conform to the numbering pattern corresponding to the same level. If any result is negative, it is determined that the numbering in the document is incorrect; The determination of the document numbering structure includes: Extract all the numbers from the document and arrange the extracted numbers in the order they appear in the document to generate a number list; Extract each number sequentially from the list of numbers and use it as the current number; If the current number is the first number in the number list, or if the current number's sequence number belongs to a preset number sequence number set, a new number group is created, and the current number is added to the newly created number group; the preset number sequence number set contains the first number sequence number of each type in the number hierarchy; If the current number is not the first number in the number list, and the current number's sequence does not belong to the preset number sequence set, the current number is added to the target number group. The target number group is the candidate number group that satisfies the most matching conditions with the current number. The candidate number group is a currently created number group. The matching conditions include: the number style of the first number in the candidate number group is consistent with the number style of the current number; the distance between the sequence of the last number in the candidate number group and the sequence of the current number is the shortest among all created number groups; the distance between the position of the last number in the candidate number group in the number list and the position of the current number in the number list is the closest. The distance between the position of the last number in the candidate number group in the number list and the position of the current number in the number list is equal to the number of numbers contained between the positions of the last number in the candidate number group and the current number in the number list plus one. After all the numbers in the number list are added to the number groups, for each number group, all the numbers contained in the number group are determined to be numbers of the same level, and the number style corresponding to the number group is set to the number style of the first number in the number group, thereby generating the number structure of the document.

2. The method according to claim 1, characterized in that, After determining whether the plurality of numbers are arranged in a specified order and whether the plurality of numbers all conform to the numbering pattern corresponding to the same level, the method further includes: In the case where there are non-contiguous numbers among the plurality of numbers, it is determined that one or more adjacent non-contiguous numbers are not arranged in the specified order; Numbers that do not conform to the numbering style corresponding to the level to which the multiple numbers belong are identified as not conforming to the numbering style corresponding to the same level.

3. The method according to claim 1, characterized in that, Before determining the document numbering structure, the method further includes: Receive serial number verification instruction; In response to the numbering verification instruction, perform the step of determining the numbering structure of the document.

4. The method according to claim 2, characterized in that, After determining that the numbering in the document is incorrect, the method further includes: An error message is displayed in the document.

5. The method according to claim 4, characterized in that, Error messages are displayed in the document, including: Display an error message box in the document; or, An error message is displayed at the error number in the document; or, The numbers of errors in the document are highlighted.

6. The method according to claim 5, characterized in that, When an error message box is displayed in the document, the error message box includes the reason for the error, which is either an incorrect numbering order or an incorrect numbering style.

7. The method according to claim 5, characterized in that, When an error message is displayed at the location where an error occurs in the document, the method further includes, after displaying the error message at the location where an error occurs in the document: In response to an operation on the error message symbol, an error message box is displayed in the document, the error message box including the error reason, which is an incorrect numbering order or an incorrect numbering style.

8. The method according to claim 6 or 7, characterized in that, When an error message box is displayed in the document, the error message box also includes an automatic correction option; after the error message box is displayed in the document, the method further includes: In response to the triggering of the automatic correction option, the numbering order and / or numbering style of the erroneous numbers are modified.

9. A number verification device, characterized in that, The device includes: A determination module is used to determine the numbering structure of a document, wherein the numbering structure includes numbering divided by levels, and each level corresponds to a numbering style; The judgment module is used to determine whether multiple numbers in the same level are arranged in a specified order and whether the multiple numbers all conform to the numbering style corresponding to the same level. The determining module is further configured to determine that there is an error in the numbering in the document if any of the judgment results of the judging module is negative; The determination of the document numbering structure includes: Extract all the numbers from the document and arrange the extracted numbers in the order they appear in the document to generate a number list; Extract each number sequentially from the list of numbers and use it as the current number; If the current number is the first number in the number list, or if the current number's sequence number belongs to a preset number sequence number set, a new number group is created, and the current number is added to the newly created number group; the preset number sequence number set contains the first number sequence number of each type in the number hierarchy; If the current number is not the first number in the number list, and the current number's sequence does not belong to the preset number sequence set, the current number is added to the target number group. The target number group is the candidate number group that satisfies the most matching conditions with the current number. The candidate number group is a currently created number group. The matching conditions include: the number style of the first number in the candidate number group is consistent with the number style of the current number; the distance between the sequence of the last number in the candidate number group and the sequence of the current number is the shortest among all created number groups; the distance between the position of the last number in the candidate number group in the number list and the position of the current number in the number list is the closest. The distance between the position of the last number in the candidate number group in the number list and the position of the current number in the number list is equal to the number of numbers contained between the positions of the last number in the candidate number group and the current number in the number list plus one. After all the numbers in the number list are added to the number groups, for each number group, all the numbers contained in the number group are determined to be numbers of the same level, and the number style corresponding to the number group is set to the number style of the first number in the number group, thereby generating the number structure of the document.

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

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method described in any one of claims 1-8.