An automatic rearrangement method and apparatus for equation numbering
Patent Information
- Application Number
- CN202610715490.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-22
- Publication Date
- 2026-08-28
AI Technical Summary
实际应用过程中,存在两类典型的公式编号混乱场景:(1)统计制度迭代更新,两版审核规则分别转换为对应公式后,由于规则表述优化和逻辑调整等,公式编号可能发生无序重排;(2)统计制度跨报表系统迁移部署时,不同报表系统的公式语法存在固有差异,对公式的解析、适配方式不同,导致同一套统计规则转换后的公式编号出现错乱,甚至公式本身的表达式也会因语法差异发生形式上的改变
[0018] The present invention provides an automatic formula numbering rearrangement method and apparatus that, relying on the semantic understanding and structured modeling capabilities of AI large models, provides an automated and high-precision formula numbering rearrangement method. This method enables rapid and accurate matching of formulas from different systems and versions, automatically organizes and compares the results and outputs them in a structured table, reducing manual workload and verification errors. It also facilitates manual verification and ultimately efficiently completes formula numbering rearrangement, facilitating the smooth migration of statistical systems and rule integration.
Smart Images

Figure CN122653565A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and more particularly to the field of formula management and numbering optimization technology in report systems, specifically to an automatic rearrangement method and apparatus for formula numbering. Background Technology
[0002] In the field of data statistics and data analysis, the implementation of statistical systems depends on converting audit rules and calculation requirements into formulas that can be recognized by the corresponding reporting system. As the core carrier of statistical data processing and audit verification, the completeness and accuracy of the formulas directly determine the reliability of the statistical results.
[0003] Each formula corresponds to a unique number, which is used for formula identification, invocation and management. In actual application, there are two typical scenarios of chaotic formula numbering: (1) When the statistical system is updated iteratively, after the two versions of the review rules are converted into corresponding formulas, the formula numbers may be rearranged in an disordered manner due to the optimization of rule expression and logical adjustment; (2) When the statistical system is migrated and deployed across reporting systems, the formula syntax of different reporting systems has inherent differences, and the way formulas are parsed and adapted is different, which leads to the formula numbering of the same set of statistical rules being disordered, and even the expression of the formula itself may change in form due to the difference in syntax.
[0004] Currently, the industry commonly uses manual verification and rearrangement methods to address the issues of formula number rearrangement and formula matching across different versions and systems. In some scenarios, simple text comparison tools are used for initial screening. However, manual verification and rearrangement rely entirely on the subjective operation of staff, resulting in low efficiency, low accuracy, and poor adaptability. Simple text comparison tools can only perform character-level comparisons and cannot handle complex comparison scenarios. Therefore, there is an urgent need for an automatic formula number rearrangement method. Summary of the Invention
[0005] To address at least one technical problem in the existing technology, this application provides an automatic rearrangement method and apparatus for formula numbering, which can improve the efficiency and accuracy of comparison and number rearrangement.
[0006] In a first aspect, this application provides an automatic rearrangement method for formula numbering, comprising: Get the documents corresponding to the formulas in historical versions and the documents corresponding to the formulas in the current version; Based on the documents corresponding to the historical version formulas, construct a feature index model for the historical version formulas. Using the historical version formulas as a formula library, the documents corresponding to the current version formulas are traversed, and based on the feature index model, a search is performed in the formula library to output the matching results of each current version formula. In response to the matching result being no match, the formula comparison agent is invoked to analyze the current version formula that is not matched, and the processing result of the unmatched formula is output. The matching results of each current version formula and the processing results of the unmatched formulas are integrated to generate a structured comparison table; The structured comparison table is checked, and after verification, the formula numbers of the historical version formulas are rearranged based on the remaining valid information in the structured comparison table.
[0007] Optionally, the documents corresponding to the historical version formulas include the formula number, formula expression, formula description, formula type, and associated review rules for each historical version formula; the feature index model includes a first-level index model and a second-level index model, and constructing the feature index model of the historical version formulas based on the documents corresponding to the historical version formulas includes: Based on the associated review rules of the formulas in each historical version, a first-level index model is constructed; Based on the formula expressions and formula descriptions of each historical version formula, a two-level index model of the historical version formula is constructed.
[0008] Optionally, the primary index model includes a first hash table index sub-model and an HNSW index sub-model. The construction of the primary index model based on the association review rules of each historical version formula includes: Feature extraction is performed on the associated review rules of formulas in each historical version to obtain the review rule text and review rule coverage indicators; Using the audit rule text and audit rule coverage indicators as hash keys, and all formulas associated with the associated audit rules as hash values, construct a first hash table index sub-model; Using the vectors obtained from the operation of the review rule text and the review rule coverage index as nodes, and 1 / vector similarity as the node distance, an HNSW index sub-model is constructed.
[0009] Optionally, the secondary index model includes a second hash table index sub-model, a third hash table index sub-model, a fourth hash table index sub-model, a first BK tree index sub-model, and a second BK tree index sub-model; the construction of the secondary index model of the historical version formula based on the formula expression and formula description of each historical version formula includes: Determine the reverse Polish notation for each historical version of the formula; Feature extraction is performed on the formula expression, reverse Polish notation, and formula description of each historical version of the formula to obtain the formula expression text, reverse Polish notation text, and formula description text. A second hash table index sub-model is constructed using the formula expression text as the hash key and the formula number corresponding to the formula expression text as the hash value. Using the Reverse Polish Notation text as the hash key and the formula number corresponding to the Reverse Polish Notation text as the hash value, a third hash table index sub-model is constructed. Using the formula description text as the hash key and the formula number corresponding to the formula description text as the hash value, a fourth hash table index sub-model is constructed. Based on the formula expressions described above, construct the first BK tree index sub-model; Based on the described Reverse Polish notation, construct the second BK tree index sub-model.
[0010] Optionally, the document corresponding to the current version formula includes the formula number, formula expression, formula description, formula type, and associated review rules for each current version formula. The step of searching the formula library based on the feature index model and outputting the matching results for each current version formula includes: Feature extraction is performed on each of the current version formulas to obtain the associated review rule text and rule coverage indicators for each current version formula; Based on the associated review rule text, rule coverage index and first hash table index sub-model of each current version formula, determine whether there is an associated review rule in the formula library that matches the current version formula; If so, retrieve the set of candidate formulas corresponding to the associated review rules from the formula library, search within the set of candidate formulas, and output the matching results for each current version formula; If not, based on the HNSW index sub-model, the associated review rule text of each current version formula, and the vector obtained by the rule coverage index calculation, determine the semantic similarity between the associated review rule of each current version formula and the associated review rule of each historical version formula, and based on the semantic similarity, determine whether there is an associated review rule in the formula library that matches the current version formula. If so, retrieve the set of candidate formulas corresponding to the associated review rules from the formula library, search within the set of candidate formulas, and output the matching results for each current version formula; If not, output the matching result of the current version formula as "no match".
[0011] Optionally, determining whether there are any associated review rules in the formula library that match the current version formula based on the semantic similarity includes: Determine whether each of the semantic similarities is less than a preset similarity threshold; If so, determine that there is no associated audit rule in the formula library that matches the current version of the formula; If not, sort the association review rules of the historical version formula according to the semantic similarity, select a preset number of association review rules with semantic similarity greater than the preset similarity threshold, and perform semantic comparison based on the semantic comparison agent of the review rule item; If there are semantically identical related audit rules, then it is determined that there are related audit rules in the formula library that match the current version formula; If no semantically identical associated audit rules exist, it is determined that there are no associated audit rules in the formula library that match the current version of the formula.
[0012] Optionally, the step of searching the candidate formula set and outputting the matching results for each current version formula includes: Determine whether the number of formulas in the candidate formula set is consistent with the number of formulas included in the associated review rules; If they match and the number of formulas is 1, the fourth hash table index sub-model and the formula description text are matched in the formula candidate set. If they match, the matching result of the current version formula is output as a complete match; if they do not match and the text similarity is less than the preset similarity threshold, the matching result of the current version formula is output as no match. If they match and the number of formulas is not 1, match them in the candidate formula set based on the second hash table index sub-model, the third hash table index sub-model, the fourth hash table index sub-model, the formula expression text, the reverse Polish notation text, and the formula description text, and output the matching result of the current version formula; If there is a discrepancy, the matching result of the current version formula will be output as either many-to-one or one-to-many.
[0013] Optionally, the matching based on the second hash table index sub-model, the third hash table index sub-model, the fourth hash table index sub-model, the formula expression text, the reverse Polish notation text, and the formula description text in the candidate formula set, and the output of the matching result of the current version formula, includes: Based on the second hash table index sub-model and the formula expression text, determine whether there is a formula expression in the formula candidate set that matches the current version formula; If so, output the matching result of the current version formula as a match; If not, based on the third hash table index sub-model and the reverse Polish notation text, determine whether there is a reverse Polish notation in the formula candidate set that matches the current version formula; If so, output the matching result of the current version formula as a match but the formula expression is inconsistent; If not, based on the fourth hash table index sub-model and the formula description text, determine whether there is a formula description in the formula candidate set that matches the current version formula; If so, output the matching result of the current version formula as a match but the formula expression is inconsistent; If not, perform BK tree retrieval based on the formula expression, reverse Polish notation, the first BK tree index sub-model and the second BK tree index sub-model to find the item with the smallest edit distance and determine whether the similarity is greater than the preset similarity threshold. If the similarity exceeds a preset threshold, the semantic comparison agent of the review rule item is executed to compare the semantics and determine whether the semantics are consistent. If they are consistent, the matching result of the current version formula is output as a match; if they are inconsistent, the matching result of the current version formula is output as no match. If the similarity is less than the preset similarity threshold, the matching result of the current version formula is output as no match.
[0014] Secondly, this application provides an automatic rearrangement device for formula numbering, comprising: The acquisition module is configured to acquire the documents corresponding to historical version formulas and the documents corresponding to the current version formula. The feature index model building module is configured to build a feature index model of the historical version formula based on the document corresponding to the historical version formula. The matching module is configured to use the historical version formulas as a formula library, traverse the documents corresponding to the current version formulas, and search the formula library based on the feature index model, and output the matching results of each current version formula. The no-match processing module is configured to, in response to the matching result being no match, call the formula comparison agent to analyze the unmatched current version formula and output the unmatched formula processing result; The integration module is configured to integrate the matching results of each current version formula and the processing results of the unmatched formulas to generate a structured comparison table; The numbering rearrangement module is configured to check the structured lookup table and, after verifying that there are no errors, rearrange the formula numbers of the historical version formulas based on the remaining valid information in the structured lookup table.
[0015] Thirdly, this application provides a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the automatic rearrangement method for formula numbering described in the first aspect.
[0016] Fourthly, the present invention also discloses a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the automatic rearrangement method for formula numbering described in the first aspect.
[0017] Fifthly, the present invention also discloses a computer program product, including a computer program / instruction that, when executed by a processor, implements the automatic rearrangement method for formula numbering described in the first aspect.
[0018] The present invention provides an automatic formula numbering rearrangement method and apparatus that, relying on the semantic understanding and structured modeling capabilities of AI large models, provides an automated and high-precision formula numbering rearrangement method. This method enables rapid and accurate matching of formulas from different systems and versions, automatically organizes and compares the results and outputs them in a structured table, reducing manual workload and verification errors. It also facilitates manual verification and ultimately efficiently completes formula numbering rearrangement, facilitating the smooth migration of statistical systems and rule integration. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention 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 the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 A schematic flowchart of an automatic rearrangement method for formula numbering according to an embodiment of the present invention is shown; Figure 2 One of the formula comparison flowcharts of an embodiment of the present invention is shown; Figure 3 A flowchart illustrating the feature-based approval rules of an embodiment of the present invention is shown. Figure 4 A schematic diagram of the greedy search algorithm according to an embodiment of the present invention is shown; Figure 5 A schematic diagram of the wide search algorithm according to an embodiment of the present invention is shown; Figure 6 A schematic diagram of the heuristic strategy algorithm according to an embodiment of the present invention is shown; Figure 7 One of the schematic diagrams of the BK tree construction process according to an embodiment of the present invention is shown; Figure 8 This is a second schematic diagram of the BK tree construction process according to an embodiment of the present invention; Figure 9 One of the schematic diagrams showing the formula comparison results of an embodiment of the present invention is shown; Figure 10This is the second schematic diagram showing the formula comparison results of an embodiment of the present invention; Figure 11 This is the second schematic diagram of the formula comparison process according to an embodiment of the present invention; Figure 12 A schematic diagram of the HNSW indexing algorithm according to an embodiment of the present invention is shown; Figure 13 A schematic diagram of the structure of an automatic rearrangement device for formula numbering according to an embodiment of the present invention is shown; Figure 14 A schematic diagram of a computer device suitable for implementing embodiments of the present invention is shown. Detailed Implementation
[0021] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0022] The information collected in the technical solution of this application is information and data authorized by the user or fully authorized by all parties. The collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data all comply with the relevant laws, regulations and standards of the relevant countries and regions, necessary confidentiality measures have been taken, and they do not violate public order and good morals. Corresponding operation portals are provided for users to choose to authorize or refuse.
[0023] The acquisition, transmission, storage, use, and processing of data in this application comply with relevant national laws and regulations. It should be noted that certain software, components, models, and other existing industry solutions may be mentioned in the embodiments of this application. These should be considered exemplary, intended only to illustrate the feasibility of implementing the technical solution of this application, and do not imply that the applicant has already used or necessarily used such solutions.
[0024] First, let's introduce the abbreviations and key terms used in this application: Report templates: Issued along with statistical regulations, these templates define the structure and format of statistical data reports.
[0025] Report identifier: refers to the marking information used to uniquely identify a specific report form. It is used to distinguish different report objects in the system and usually includes the report name, report code or other identifiers that can uniquely locate the report. It is used to establish the association between audit rule entries, report forms and report formulas.
[0026] Formula Library: FDB (FML Database), a database that stores report formulas.
[0027] Formula Syntax Library: FSD (FML Syntax Database) is a database that stores the writing specifications, syntax rules, operators, format requirements, and legality verification standards for report formulas. It is used to support AI large models in generating report formulas that meet the requirements of the reporting system and are syntactically correct.
[0028] Report Indicator Library: FDD (Field Database) is a database that stores all report indicator items in the statistical system report templates. It contains core information such as the business meaning, cell position, and statistical scope of each indicator item, providing basic data support for AI large-scale models to identify indicators and associate them with audit rules.
[0029] The Check Rule Database (CRD) stores all check rule items extracted from the check rule documents that accompany the statistical system. These rules are organized and archived according to a unified standard, providing a core rule data source for AI models to understand the check logic and generate report formulas.
[0030] In the field of data statistics and analysis, the implementation of statistical systems relies on converting audit rules and calculation requirements into formulas that can be recognized by corresponding reporting systems. As the core carrier of statistical data processing and audit verification, the completeness and accuracy of formulas directly determine the reliability of statistical results. Formulas typically include a formula expression, a formula description, and a formula type (specifically divided into three categories: calculation formulas, audit formulas, and calculation + audit formulas). Each formula also has a unique number for identification, retrieval, and management.
[0031] In practical applications, there are two typical scenarios of chaotic formula numbering: When the statistical system is updated, after the two versions of the review rules are converted into corresponding formulas, the formula numbers may be rearranged out of order due to the optimization of rule expression and logical adjustment. When statistical systems are migrated and deployed across reporting systems, the formula syntax of different reporting systems has inherent differences. The different ways of parsing and adapting formulas can lead to confusion in the formula numbering after the same set of statistical rules is converted. Even the expression of the formula itself may change in form due to syntactic differences (for example, some systems need to break down complex formulas into multiple simple formulas, while some systems can achieve the same function with a single formula).
[0032] To reduce the costs of statistical system iteration and cross-system migration, business personnel typically need to reuse the formulas from the previous version of the statistical system. This involves matching the formulas from the historical version with the formula numbers of the new version / system, applying the new formula numbers, and preserving the core logic and results of the historical formulas to avoid redundant formula conversion work. During this process, it is essential to achieve a precise comparison between the historical formulas and the target formulas (new version / system formulas) to ensure that the logic and function of the formulas after numbering rearrangement are consistent with the original formulas, meeting the needs of statistical review and calculation.
[0033] Currently, the industry generally uses manual verification and rearrangement to address the issues of formula number rearrangement and formula matching across different versions and systems. In some scenarios, simple text comparison tools are used for preliminary screening.
[0034] The specific implementation process is as follows: Business personnel first collect complete information on all formulas in the historical version (or original system), including formula number, formula expression, formula description, formula type, and associated audit rules; at the same time, they collect corresponding information on all formulas in the new version (or new system), including new formula number, formula expression, formula description, formula type, and associated audit rules; then, they manually compare each element of the two sets of formulas one by one, combining their own understanding of statistical rules and formula syntax, to determine whether the historical formula and the new formula are formulas with the same logic and the same function, and thus determine the matching relationship between the two; after the matching is completed, they manually associate the relevant information of the historical formula with the new formula number to complete the rearrangement of the formula number, and record the differences in the comparison process; finally, they manually check all matching results, and after confirming that there are no errors, they delete the auxiliary verification information and apply the rearranged formula number to the statistical system of the new system or new version.
[0035] In addition, there are a few simple automated auxiliary methods in the existing technology, which can only realize the plain text comparison of formula descriptions or formula expressions. That is, they judge whether the formula matches by comparing the consistency of characters. They cannot identify formulas with different text forms but consistent semantics and logic. A lot of manual correction and verification of the preliminary comparison results is still required.
[0036] Based on the implementation process and application scenarios of the existing technologies described above, the existing technologies mainly have the following problems, making it difficult to meet the requirements for efficient and accurate formula number rearrangement: Extremely inefficient and poor adaptability: Manual verification and rearrangement rely entirely on staff operations. When the statistical system is complex and the number of formulas is large (such as hundreds or even thousands), the verification work takes a very long time. In cross-system migration and multi-version iteration scenarios, differences in formula syntax, formula decomposition / merging, etc., will further increase the workload of verification, resulting in low efficiency of number rearrangement and inability to adapt to the needs of large-scale formula management.
[0037] Low accuracy and high error rate: During manual verification, staff are easily affected by factors such as fatigue, subjective judgment bias, and incomplete understanding of formula syntax / statistical rules. They are unable to accurately identify formulas with different text forms but consistent semantics and logic (such as multiple formulas decomposed from the original system and a single equivalent formula in the new system). They are also prone to overlooking subtle differences in formula descriptions and expressions, leading to formula matching errors and numbering rearrangement mistakes. This affects the accuracy of subsequent statistical data processing and auditing, and may even cause errors in statistical results.
[0038] Inability to handle complex comparison scenarios and insufficient coverage: Existing simple text comparison tools can only achieve character-level comparison, and cannot achieve deep semantic-level comparison, nor can they accurately compare the indicators covered by the formula description or the logical structure of the formula expression. At the same time, for complex scenarios such as incomplete matching between formula description and expression, and inconsistent number of formulas parsed by the same review rule in different systems, existing technologies cannot effectively handle them, and a lot of complex judgments still need to be made manually, which further reduces work efficiency and accuracy.
[0039] High labor and learning costs: Formula verification and number rearrangement require staff to be familiar with the statistical rules of both historical and new versions, as well as the formula syntax of both the original and new systems. They also need strong data analysis and logical judgment abilities, which places high demands on their professional skills and leads to high labor costs. At the same time, new staff need to undergo a long period of training to be competent in the relevant work, resulting in high learning costs. Furthermore, staff turnover can easily lead to work interruptions and decreased efficiency.
[0040] The comparison results are unstructured and have poor traceability: In the existing technology, the process and results of manual verification are mostly scattered records, which cannot form a standardized and structured comparison report (such as a structured table). Subsequent manual inspection, problem tracing, and error correction are difficult. If a formula matching error occurs, it is difficult to quickly locate the cause of the error (such as not finding a similar formula, inconsistent expressions, inconsistent descriptions, inconsistent number of entries, etc.), and it is also impossible to complete the correction work efficiently.
[0041] In view of this, in order to solve at least one of the above pain points, this application provides an automatic rearrangement method for formula numbering. This invention belongs to the field of data statistics and data analysis technology, specifically involving formula management and numbering optimization technology in report systems, and particularly involving an automatic numbering rearrangement method based on formula comparison analysis. It is applicable to scenarios such as formula conversion between two versions of statistical system review rules and migration and deployment of statistical systems across report systems, achieving accurate matching and automatic rearrangement of formula numbers between different versions and different systems, and improving the efficiency and accuracy of formula reuse.
[0042] like Figure 1As shown, the automatic rearrangement methods for formula numbering include: Step 10: Obtain the documents corresponding to the formulas in the historical versions and the documents corresponding to the formulas in the current version; Step 20: Based on the documents corresponding to the historical version formulas, construct a feature index model for the historical version formulas; Step 30: Using the historical version formulas as the formula library, traverse the documents corresponding to the current version formulas, and search the formula library based on the feature index model to output the matching results of each current version formula. Step 40: In response to the matching result being no match, the formula comparison agent is invoked to analyze the unmatched current version formula and output the unmatched formula processing result. Step 50: Integrate the matching results of each current version formula and the processing results of the unmatched formulas to generate a structured comparison table; Step 60: Verify the structured comparison table, and after verifying that it is correct, rearrange the formula numbers of the historical version formulas based on the remaining valid information in the structured comparison table.
[0043] To summarize the aforementioned solutions, specifically, the overall solution of this application includes the following steps, such as... Figure 2 As shown: S01: Input formula, which is a formula document containing both historical and current versions of the formula. The document contains all the formula's attributes, including formula number, formula expression, formula description, formula category, and associated audit rules.
[0044] S02: Characterized formula model, which uses historical formulas as a formula library (FDB) and builds an index for retrieval.
[0045] S03: Pairing two versions of formulas to form a mapping, i.e., traversing the current version of formulas, searching the formula library, and outputting matching results; a "recall-ranking" information retrieval paradigm is used to implement the retrieval, wherein: "Recall" refers to the rapid and efficient retrieval of a small candidate set from the complete set of historical formulas. The core of this step is efficiency and high recall rate to ensure no omissions. The review rules associated with formulas (each review rule contains a set of formulas) are processed with noise reduction and then first used for precise searching via text hash keys (hash table mapping; the same hash algorithm produces predictable hashes, meaning the same text generates the same hash key). When no review rules with the same hash key exist, the HNSW index model is used to retrieve review rules with similarity exceeding a threshold. The semantic comparison agent (CRSA) ultimately determines the semantically consistent review rule and recalls the set of formulas under that rule. This process can achieve semantic retrieval with "high precision, high speed, and low cost." "Ranking" involves fine-tuning the recalled formula candidate set. This step uses more comprehensive and accurate features (expressions, descriptions, etc.) to find the best match, with efficiency and accuracy being the core considerations. It is implemented using formula expressions + Reverse Polish notation + formula description, as follows: Formulas whose hash keys match can be considered to be the same formula.
[0046] If the hash keys in Reverse Polish Notation are the same, they can be considered the same formula. Reverse Polish Notation describes the order of operations in a formula. For example, the hash keys of "D=ABC" and "D=(AB)-C" are different, but their Reverse Polish Notation is "AB-CD=". In fact, these two formulas are the same, and the difference is just due to the formula syntax.
[0047] Formulas with identical hash keys can be considered the same formula. For example, "D equals A minus the sum of B and C" can be expressed as "D=ABC" and "D=A-(B+C)", with Reverse Polish notation as "AB-CD=" and "ABC+-D=", respectively. They are actually the same formula, differing only due to the formula syntax.
[0048] When a formula with the same hash key cannot be found, a text similarity algorithm is used to retrieve formulas with high similarity. Since the syntax structure of the formula is relatively simple, the edit distance (LD) algorithm is used to quickly calculate the similarity between the formula expression and the reverse Polish notation. The indexing model uses a BK tree for depth-first traversal to find the formula with the highest similarity on the path. When a formula has the highest similarity to the current formula in both the expression tree and the reverse Polish notation tree, it can be determined that they are the same formula.
[0049] Because of the existence of "many-to-many matching", formula semantic retrieval cannot be completely accurate. Therefore, the algorithm first filters out formulas that can be accurately judged, and then uses the formula comparison agent (FCA) to judge the remaining results. This can greatly speed up the retrieval and reduce the retrieval cost. At the same time, the FCA's prompts can be continuously corrected based on the results of human judgment, so that the matching results are infinitely close to the accurate match.
[0050] S04: Organize and output the matching results to form a table tool that is convenient for manual verification, namely the formula mapping table.
[0051] S05: Manual verification. The form tool categorizes the results according to the matching results, making the comparison clear and the presentation complete, allowing business personnel to quickly complete the verification work.
[0052] Step 10: Obtain the documents corresponding to the formulas in the historical versions and the formulas in the current version.
[0053] In this embodiment, the documents corresponding to historical version formulas and the documents corresponding to current version formulas refer to files containing formula engines of different versions; wherein, the documents corresponding to historical version formulas include the formula number, formula expression, formula description, formula type, and associated audit rules for each historical version formula; the documents corresponding to current version formulas include the formula number, formula expression, formula description, formula type, and associated audit rules for each current version formula. Wherein: Formulas are derived from statistical report audit rules and can be directly executed in the reporting system. They serve as the carrier of report calculation / validation expressions for implementing audit logic verification, representing the formulaic presentation of audit rules. A formula should include a formula expression, a formula description, and audit rule items. The formula number is the formula's identifier, composed of letters, numbers, and connectors, typically presented as a consecutive number. The formula expression is the specific written form of the formula, a string composed of symbols, operational logic, and report indicators, which can be recognized, parsed, and executed by the reporting system to accurately implement the logical verification function of audit rules. The formula description is a textual explanation of the formula expression, clearly illustrating the corresponding audit logic, operational relationships, indicator associations, and verification purpose, making the meaning and function of the formula intuitively understandable and facilitating subsequent maintenance and verification. Audit rules are issued along with statistical regulations and are used to describe the calculation logic or verification relationships between report data. The audit rule coverage indicators are the set of all report indicators associated with, constrained, and affected by a single audit rule item in logical verification, i.e., the scope of the audit rule.
[0054] Step 20: Based on the documents corresponding to the historical version formula, construct the feature index model of the historical version formula.
[0055] In this embodiment, based on the documents corresponding to the historical version formulas, a feature index model for the historical version formulas can be constructed. The feature index model includes a first-level index model and a second-level index model. Step 20 further includes: Step 201: Based on the association review rules of each historical version formula, construct a first-level index model.
[0056] It should be noted that the first-level index model includes the first hash table index sub-model and the HNSW index sub-model. The first hash table index sub-model is used for exact matching based on the text hash key. When there are no review rules with the same hash key, the HNSW index sub-model is used to retrieve review rules with similarity exceeding the threshold.
[0057] It should be noted that the HNSW (Hierarchical Navigable Small World) vector search (indexing) algorithm used in this embodiment is a graph-indexed method that improves search efficiency by constructing a multi-layered graph structure. The top-level graph contains a small number of nodes, and the number of nodes gradually increases as the layer number decreases. Different sparsity levels between layers allow the search to first find a nearby region at a higher level, and then precisely search downwards layer by layer to find the nearest neighbor node. HNSW employs a heuristic search approach, starting from a starting node and jumping to nodes closer to the target by gradually approaching it. The hierarchical structure further optimizes this heuristic navigation, enabling rapid convergence to the target region at higher levels.
[0058] The following is a description of the terms used in HNSW in this application: N: Number of formulas, number of review rules, corresponding to the maximum number of nodes in HNSW; Node (P): The node inserted into the HNSW model, which is the vector obtained by adding the review rule text to the CRC operation; Node distance (Pd): The similarity between two node vectors, the higher the similarity, the shorter the distance; E: Neighbor, in each layer of the HNSW model, a node that has created a bidirectional index channel with a node is a neighbor to that node; M: The maximum number of neighbors that each node can have in each layer of the HNSW model; ML: The layer decay factor of the HNSW model, usually taken as ML=1 / ln(M); LEVEL: Each newly inserted node is randomly assigned a maximum layer number (the node is inserted in layers 0 to LEVEL), the formula is: LEVEL= FLOOR(-ln(random(0,1))) ML); MAX_LEVEL: the global maximum level (i.e., the highest level index). As N increases, MAX_LEVEL grows at a rate of O(log N). Theoretically, the expected value is MAX_LEVEL = ML. ln(N); Assuming M=16 (commonly used) and N=3000, then: ML=1 / ln(16)≈0.36; ln(3000)≈8.0; MAX_LEVEL=1 / ln(16) ln(3000)≈2.88≈3; EP: Global starting node, the entry node for all searches; EF: Search width, the number of result sets of the optimal solution. The larger the value, the slower the execution speed but the more accurate the result. The smaller the value, the faster the execution speed but the possibility of missing the global optimal solution.
[0059] The candidate queue (Candidates, min-heap) stores nodes to be explored, sorted by distance to the query point. The result queue (Result, max-heap, ordered list) has a capacity of EF and always contains the EF nodes that are closest to P. When a new node (Pnew) is added, if the node farthest from P in the result queue (Pfar) has Pd(P,Pfar) > Pd(P,Pnew), then Pfar is discarded, Pnew is added, and the order is reordered. The visited queue (Visited, hash set) records the IDs of nodes that have already been processed to avoid redundant expansion.
[0060] In some optional embodiments of this example, step 201 further includes: Step 2011: Extract features from the associated audit rules of each historical version formula to obtain the audit rule text and audit rule coverage indicators.
[0061] Step 2012: Using the audit rule text and audit rule coverage indicators as hash keys, and all formulas associated with the associated audit rules as hash values, construct the first hash table index sub-model.
[0062] Step 2013: Using the vector obtained from the operation of the review rule text and the review rule coverage index as nodes, and 1 / vector similarity as the node distance, construct the HNSW index sub-model.
[0063] It should be noted that, in this embodiment, when processing formula semantics, the text and semantic information of the formula description and formula expression are transformed into a quantifiable and computable vector form, which serves as the core data carrier for achieving efficient semantic comparison.
[0064] Step 202: Based on the formula expressions and formula descriptions of each historical version formula, construct a two-level index model for the historical version formula.
[0065] It should be noted that the two-level index model includes the second hash table index sub-model, the third hash table index sub-model, the fourth hash table index sub-model, the first BK tree index sub-model, and the second BK tree index sub-model. Among them, the BK tree is a tree-based data structure specifically used for approximate string matching in a metric space, such as spell correction, fuzzy search, or similar string search. Its core advantage lies in achieving efficient pruning through the mathematical "triangle inequality," avoiding full traversal and significantly improving search efficiency.
[0066] In some optional embodiments of this example, step 202 further includes: Step 2021: Determine the Reverse Polish Notation (RPN) of each historical version formula. RPN is a parenthesis-free expression that places the operator after the operand.
[0067] Step 2022: Extract features from the formula expression, reverse Polish notation, and formula description of each historical version of the formula to obtain the formula expression text, reverse Polish notation text, and formula description text.
[0068] Step 2022: Construct a second hash table index sub-model using the formula expression text as the hash key and the formula number corresponding to the formula expression text as the hash value.
[0069] Step 2023: Using the Reverse Polish Notation text as the hash key and the formula number corresponding to the Reverse Polish Notation text as the hash value, construct a third hash table index sub-model.
[0070] Step 2024: Construct a fourth hash table index sub-model using the formula description text as the hash key and the formula number corresponding to the formula description text as the hash value.
[0071] Step 2025: Construct the first BK tree index sub-model based on the formula expressions described above.
[0072] Step 2026: Construct the second BK tree index sub-model based on the described Reverse Polish notation.
[0073] To summarize the preceding steps, based on the logic of formula retrieval and formula verification rules, a primary index model is constructed, and the formula expression, reverse Polish notation, and formula description are selected as secondary index models, such as... Figure 3 As shown: S01: Enter historical version formulas. The structure includes formula number, formula expression, formula description, formula type, and associated audit rules. S02: Perform feature extraction on the review rules, including vectorization of the review rule text and the review rule coverage index (CRC). In the hash table of the exact matching index, the key is the review rule text and the review rule coverage index (CRC) after text denoising; the value is all formulas associated with the review rule. In the semantic similarity index, the review rule text and the review rule coverage index (CRC) are vectorized for subsequent similarity calculations.
[0074] Text denoising is a preprocessing operation that removes irrelevant and interfering information from the text during the comparison of formula descriptions and expressions (such as removing leading and trailing spaces, unifying capitalization, converting full-width and half-width characters, redundant expressions, format symbols, etc.), while retaining the core semantics and key features, thereby improving the accuracy of the comparison.
[0075] S03: Build an HNSW index based on the extracted review rule features, such as... Figure 4 , Figure 5 and Figure 6 As shown, based on greedy search algorithm, wide search algorithm, and heuristic strategy algorithm, the HNSW index sub-model is constructed using vectors (review rule text + review rule coverage index (CRC)) as node hash keys and 1 / vector similarity as node distance, where: Greedy search algorithms such as Figure 4 As shown, the first step is to identify the entry point as EP. Among EP's neighbors P1-Pn, P3 has the shortest distance to P. The second step is to examine P3's neighbors P31-P3n. If there exists a P3m (1≤m≤n) with a shorter distance to P than P3, then P3m replaces P3 and the second step is executed again. Otherwise, P3 is considered to have the shortest distance to P in this layer and is elected as the entry point PI for the next layer. The third step is to repeat this process until the entry point PI of the next layer is found.
[0076] Wide search algorithms such as Figure 5As shown, the first step: initialization, inserting the starting point into three queues; the second step: popping out Pc, if Candidates is not empty, Pd(P, Pc)>Pd(P, Pr) and Result has reached EF, stop the search; otherwise execute the third step; the third step: traversing the neighbor Pe of Pc, calculating Pd(P, Pe) and pushing it into the candidate queue (Candidates), the result queue (Result) and the visited queue (Visited); after completion, Candidates contains all neighbors of the original Pc node (sorted by Pd), and Pc has been removed from Candidates; Result contains m (0<m≤EF) nodes (sorted by Pd); then re-execute the second step: each time pop out the node Pc with the smallest Pd from the candidates, if Pd is already larger than the maximum Pd in Result, it indicates that all candidate nodes are beyond the scope of Result, and further retrieval is meaningless. If Result is also full at this time, Result can be output; otherwise, execute the third step to traverse the neighbors of Pc and continue adding candidate nodes; this breadth search is the core pruning strategy for improving retrieval efficiency.
[0077] Heuristic strategy algorithms such as Figure 6 shown, when Pd(Pm, E1)~Pd(Pm, Em-1) are all greater than Pd(P, Pm), add the neighbor Em; when Pd(Pn, Em) is less than Pd(P, Pm), discard Pn.
[0078] S04: constructing a BK-tree with formulas under the same audit rule, such as Figure 7 and Figure 8 shown, a BK-tree index model is constructed with the expression of the formula and the reverse Polish notation respectively.
[0079] Figure 7 In, circles are BK-tree nodes, and the attributes include: text subject (element): that is the formula expressions and reverse Polish notations in the present application; child node mapping: the key is the LD (Levenshtein Distance) from the child node to the current node, and the value is the HASH key of the child node.
[0080] It should be noted that LD, Levenshtein Distance, is a type of edit distance, which is used to measure the minimum number of edits required for two strings to be converted into each other through insertion, deletion or replacement operations.
[0081] The distance is calculated using dynamic programming, which constructs an (n+1)×(m+1) matrix to record the operation steps, and finally takes the value of the last element of the matrix as the result. Allowed operation types include insertion, deletion, and replacement of characters, with each operation counting as one edit. Application scenarios cover DNA analysis, spell checking, speech recognition, and plagiarism detection.
[0082] Figure 8 An example of a BK tree index model is shown, such as Figure 8 As shown, for a set of formula expressions [A01,A02,A03,A04,A05,A06], the first step is to make A01 the root node; the second step is to insert A02, LD(A01,A02)=1; the third step is to insert A03, LD(A01,A03)=2; the fourth step is to insert A04, LD(A01,A04)=2, then A04 is a subordinate of A03, LD(A03,A04)=2; the fifth step is to insert A05, LD(A01,A04)=2, LD(A03,A05)=2, LD(A04,A05)=1; the sixth step is to insert A06, LD(A01,A06)=3.
[0083] At this point, the characteristic model of the historical formula has been completed.
[0084] Step 30: Using the historical version formulas as the formula library, traverse the documents corresponding to the current version formulas, and search the formula library based on the feature index model to output the matching results of each current version formula.
[0085] In this embodiment, the approach to formula matching is to traverse the current formula list and use the features of the current formula to search in the historical formula feature model.
[0086] In some optional embodiments of this example, step 30 further includes: Step 301: Extract features from each of the current version formulas to obtain the associated review rule text and rule coverage indicators for each current version formula; Step 302: Based on the associated audit rule text, rule coverage index and the first hash table index sub-model of each current version formula, determine whether there is an associated audit rule in the formula library that matches the current version formula; Step 303: If so, obtain the set of candidate formulas corresponding to the associated review rules from the formula library, and search in the set of candidate formulas to output the matching results of each current version formula; Step 304: If not, based on the HNSW index sub-model, the associated review rule text of each current version formula, and the vector obtained by the rule coverage index calculation, determine the semantic similarity between the associated review rule of each current version formula and the associated review rule of each historical version formula, and based on the semantic similarity, determine whether there is an associated review rule in the formula library that matches the current version formula.
[0087] In some optional embodiments of this example, step 304, which involves determining whether there are any associated review rules in the formula library that match the current version formula based on the semantic similarity, includes: Step 3041: Determine whether each of the semantic similarities is less than a preset similarity threshold; Step 3042: If yes, determine that there is no associated audit rule in the formula library that matches the current version formula.
[0088] In this step, the intelligent agent for decomposing audit rules and indicators delineates the associated audit rules of the formula to determine that there are no associated audit rules in the formula library that match the current version of the formula. The intelligent agent for decomposing audit rules and indicators is a rule parsing intelligent processing unit built on an AI large model. Its core function is to logically decompose a single audit rule item, accurately identify all report indicator items covered by that rule item, form a rule indicator coverage set, and synchronously output it to the formula context information, providing indicator association basis for the generation of the formula expression.
[0089] Step 3043: If not, sort the association review rules of the historical version formula according to the semantic similarity, select a preset number of association review rules with semantic similarity greater than the preset similarity threshold, and perform semantic comparison based on the semantic comparison agent of the review rule item.
[0090] In this embodiment, the semantic comparison agent for audit rule items, CRSA (Check Rule Semantic Agent), is a semantic analysis intelligent processing unit built on an AI large model. Its core function is to perform semantic parsing and similarity comparison on each audit rule item in the audit rule base, identify the relationship between rules, duplicate logic and conflict points, and provide accurate rule filtering and matching support for the formula generation agent.
[0091] Step 3044: If there are semantically identical related audit rules, then it is determined that there are related audit rules in the formula library that match the current version formula; Step 3045: If there is no semantically identical associated audit rule, then it is determined that there is no associated audit rule in the formula library that matches the current version formula.
[0092] Step 305: If so, obtain the set of candidate formulas corresponding to the associated audit rules from the formula library, and search in the set of candidate formulas to output the matching results of each current version formula.
[0093] In some optional embodiments of this example, step 305 includes: Step 3051: Determine whether the number of formulas in the candidate formula set is consistent with the number of formulas included in the associated review rules; Step 3052: If they match and the number of formulas is 1, match the formula candidate set based on the fourth hash table index sub-model and the formula description text. If they match, output the matching result of the current version formula as a complete match; if they do not match and the text similarity is less than the preset similarity threshold, output the matching result of the current version formula as no match.
[0094] It should be noted that text similarity is a standardized indicator used to quantify the similarity between two texts in terms of wording, semantic connotation, and logical structure. In this application, it is mainly used to numerically determine the semantic matching degree, repetition degree, and relevance between formulas.
[0095] Step 3053: If the formulas match and the number of formulas is not 1, match the formula candidate set based on the second hash table index sub-model, the third hash table index sub-model, the fourth hash table index sub-model, the formula expression text, the reverse Polish notation text, and the formula description text, and output the matching result of the current version formula.
[0096] In some optional embodiments of this example, step 3053 further includes: Step 30531: Based on the second hash table index sub-model and the formula expression text, determine whether there is a formula expression in the formula candidate set that matches the current version formula; Step 30532: If so, output the matching result of the current version formula as a match; Step 30533: If not, based on the third hash table index sub-model and the reverse Polish notation text, determine whether there is a reverse Polish notation in the formula candidate set that matches the current version formula; Step 30534: If so, output the matching result of the current version formula as "matched but formula expression inconsistent"; Step 30534: If not, based on the fourth hash table index sub-model and the formula description text, determine whether there is a formula description in the formula candidate set that matches the current version formula; Step 30535: If so, output the matching result of the current version formula as "matched but formula expression inconsistent"; Step 30536: If not, perform BK tree retrieval based on the formula expression, reverse Polish notation, the first BK tree index sub-model and the second BK tree index sub-model, find the item with the smallest edit distance, and determine whether the similarity is greater than the preset similarity threshold. Step 30537: If the similarity is greater than the preset similarity threshold, execute the semantic comparison agent of the review rule item to compare the semantics and determine whether the semantics are consistent. If they are consistent, output the matching result of the current version formula as a match; if they are inconsistent, output the matching result of the current version formula as no match. Step 30538: If the similarity is less than the preset similarity threshold, output the matching result of the current version formula as "no match".
[0097] Step 3054: If there is no match, output the matching result of the current version formula as many-to-one or one-to-many.
[0098] Step 306: If not, output the matching result of the current version formula as "no match".
[0099] In conclusion, the solutions for matching the aforementioned formulas are summarized as follows: Formulas whose hash keys match can be considered to be the same formula.
[0100] If the hash keys in Reverse Polish Notation are the same, they can be considered the same formula. Reverse Polish Notation describes the order of operations in a formula. For example, the hash keys of "D=ABC" and "D=(AB)-C" are different, but their Reverse Polish Notation is "AB-CD=". In fact, these two formulas are the same, and the difference is just due to the formula syntax.
[0101] Formulas with identical hash keys can be considered the same formula. For example, "D equals A minus the sum of B and C" can be expressed as "D=ABC" and "D=A-(B+C)", with Reverse Polish notation as "AB-CD=" and "ABC+-D=", respectively. They are actually the same formula, differing only due to the formula syntax.
[0102] When a formula with the same hash key cannot be found, a text similarity algorithm is used to retrieve formulas with high similarity. Since the syntax structure of the formula is relatively simple, the edit distance (LD) algorithm is used to quickly calculate the similarity between the formula expression and the reverse Polish notation. The indexing model uses a BK tree for depth-first traversal to find the formula with the highest similarity on the path. When a formula has the highest similarity to the current formula in both the expression tree and the reverse Polish notation tree, it can be determined that they are the same formula.
[0103] Step 40: In response to the matching result being no match, the formula comparison agent is invoked to analyze the unmatched current version formula and output the unmatched formula processing result.
[0104] In this embodiment, the formula comparison agent is an intelligent processing module that relies on the semantic understanding and structured modeling capabilities of the AI large model to realize multi-dimensional comparison of formula descriptions and formula expressions, and complete the formula pairing between the original system and the new system.
[0105] Specifically, the full dataset after the initial formula comparison is subjected to difference screening and sorting. Formulas that have been accurately matched (with consistent comparison results and can be directly matched between the original and new systems) and formulas with clearly marked differences (such as inconsistent expressions, inconsistent descriptions, inconsistent number of entries, etc.) are filtered out. Only formulas that have not been matched or have no clear difference markings are retained. This allows the Formula Comparison Agent (FCA) analysis to focus on core objects and reduce usage costs.
[0106] The Formula Comparison Agent (FCA) is invoked to perform a comprehensive intelligent analysis on the unpaired formulas remaining after screening. Relying on the semantic understanding and structured modeling capabilities of the AI large model, FCA deeply analyzes the core features of the unpaired formulas, clarifies the potential reasons for the unpairing, and outputs standardized large model processing results.
[0107] Step 50: Integrate the matching results of each current version formula and the processing results of the unmatched formulas to generate a structured comparison table.
[0108] Specifically, the paired formulas output by the formula pairing algorithm are integrated with the unpaired formulas processed by FCA to generate a result such as... Figure 9 and Figure 10 The structured comparison table clearly presents the historical version information (number, expression, description, type, audit rules) and current version information (number, expression, description, type, audit rules) of each formula, comparison results, difference annotations, and reasons for non-matching.
[0109] Step 60: Verify the structured comparison table, and after verifying that it is correct, rearrange the formula numbers of the historical version formulas based on the remaining valid information in the structured comparison table.
[0110] Specifically, manually check the formula pairings against the table output in step 50, focusing on verifying the marked differences and unpaired items, and correcting pairing errors caused by algorithm or FCA analysis biases. After verification, delete the auxiliary verification information columns in the table (such as difference analysis notes, intermediate data from large model processing, etc.), and organize the remaining valid information into formulas that conform to the new system specifications and have been re-coded.
[0111] This application leverages the semantic understanding and structured modeling capabilities of AI large-scale models to provide an automated and high-precision formula numbering rearrangement method. This method enables rapid and accurate matching of formulas from different systems and versions, automatically organizes and compares the results, and outputs them in a structured table. This reduces manual workload and verification errors, while also facilitating manual inspection and verification. Ultimately, it efficiently completes formula numbering rearrangement, facilitating the smooth migration of statistical systems and the integration of rules.
[0112] In a specific example, the overall process is as follows: Figure 11 As shown, the details are as follows: S01: Traverse the current version of the formulas and extract features for each formula, including the text, vector, and rule coverage index (CRC) of the associated audit rules. S02: Related Audit Rule Retrieval: First, perform exact matching of text and rule coverage indicators in the exact match index (hash table) of historical formulas; if no exact match is found, perform a retrieval in the historical formula HNSW index using the vector formed by text + rule coverage indicator (CRC), as follows. Figure 12 As shown, the first step is to use a greedy search to quickly locate the PI of Layer 0; the second step is to use a bottom-level wide search to output the node with the smallest Pd in the Result, which is the node with the highest similarity; after finding the top few review rules with the highest similarity and greater than the threshold, the semantics are compared by the semantic comparison agent (CRSA) of the review rule items. If there is semantic similarity, the match is determined to be successful and the next step of formula retrieval is performed; otherwise, the match is determined to be unsuccessful and the formula is marked as unpaired.
[0113] S03: Formula retrieval; prepare formula expressions and reverse Polish notation; if only one formula exists under both the old and new versions of the review rules, then match directly through the formula description; if an exact match cannot be made and the similarity is less than the threshold, mark the formula as unmatched.
[0114] If the number of formulas differs between the old and new versions of the review rules, then comparing the formulas is not very meaningful; instead, mark them as one-to-many or many-to-one.
[0115] For exact matching, if the formula expression, the reverse Polish notation of the formula, or the formula description text are the same, it is marked as the same formula with inconsistent terms; if all are the same, it is marked as a match.
[0116] If none of the three are consistent, then use the formula description and reverse Polish notation to perform BK tree retrieval in sequence to find the item with the smallest edit distance (LD). If the similarity is greater than the threshold, perform semantic comparison of the review rule item (CRSA) to compare the semantics. If it is less than the threshold, determine that there is no pairing in the formula.
[0117] S04: Difference Analysis. This involves filtering and organizing the full dataset after the initial formula comparison, filtering out formulas that have been accurately matched (with consistent comparison results, directly matching the original and new system formulas) and formulas with clearly marked difference types (such as inconsistent expressions, inconsistent descriptions, inconsistent number of entries, etc.). Only formulas that have not been matched or have no clear difference markings are retained, allowing the Formula Comparison Agent (FCA) analysis to focus on core objects and reduce usage costs.
[0118] S05: Call the Formula Comparison Agent (FCA) to perform a comprehensive intelligent analysis on the unpaired formulas remaining after the screening in S04.
[0119] S06: Integration Output: Integrate the pairing results output by the formula pairing algorithm with the unpaired formula processing results generated by FCA.
[0120] S07: Manual processing. Business personnel manually check the formula pairing against the table output in S06, focusing on verifying the marked differences and unpaired items, and correcting pairing errors caused by algorithm or FCA analysis bias. After verification, delete the auxiliary verification information columns in the table (such as difference analysis notes, intermediate data from large model processing, etc.), and organize the remaining valid information into formulas that conform to the new system specifications and have been re-coded.
[0121] For manually corrected matching errors, the Prompt tool converts the error type, correction logic, and correct matching criteria into standardized prompts, which are then input into the Formula Comparison Agent (FCA). This enables iterative upgrades to the FCA's prompts. The upgraded FCA records the manually corrected errors and their corresponding processing logic. In subsequent formula matching operations, it can automatically avoid similar errors, reducing the workload of repeated manual checks and improving matching accuracy and process efficiency.
[0122] In summary, the core points of the above-mentioned scheme in this application are as follows: By using large AI models to replace traditional manual verification, and combining rule-based algorithms with the semantic understanding capabilities of large models for collaborative recognition, AI processing becomes more focused, effectively reducing computing power and time costs. The HNSW+BK tree hybrid retrieval algorithm is adopted to reduce the semantic retrieval complexity to the logarithmic level, greatly reduce the time consumption of formula matching retrieval, and improve the overall processing efficiency. Construct a multi-layered progressive comparison process from formula description to expression, verifying textual, semantic, and logical features layer by layer, reducing missing matching items and misjudgments from the root cause; Relying on large models, formula expressions are regenerated, and the consistency of formula logic under different system syntaxes is accurately identified, adapting to cross-reporting system migration scenarios. The structured tables present the formula matching results, difference types, and reasons for non-matching in a complete manner, providing sufficient reference for manual verification while balancing automation efficiency and verification rigor.
[0123] This invention, by deeply leveraging the semantic understanding and structured modeling capabilities of large AI models and combining innovative designs such as a multi-dimensional progressive comparison mechanism, effectively solves many pain points of traditional manual verification of formula number rearrangement, achieving significant technical improvements. Specific effects include: greatly improving work efficiency and reducing labor costs; enhancing the accuracy of comparison and number rearrangement, reducing errors; overcoming system adaptation bottlenecks and enhancing the method's versatility; optimizing the verification process, balancing automation and rigor; and accurately adapting to special and different scenarios, improving problem identification.
[0124] Based on the automatic rearrangement method for formula numbering provided in the foregoing embodiments, such as Figure 13 As shown in the figure, this application embodiment also provides an automatic rearrangement device for formula numbering, including: Module 701 is configured to retrieve the documents corresponding to historical version formulas and the documents corresponding to the current version formula. The feature index model construction module 702 is configured to construct a feature index model of the historical version formula based on the document corresponding to the historical version formula. The matching module 703 is configured to use the historical version formulas as a formula library, traverse the documents corresponding to the current version formulas, and search the formula library based on the feature index model to output the matching results of each current version formula. The no-match processing module 704 is configured to, in response to the matching result being no match, call the formula comparison agent to analyze the unmatched current version formula and output the unmatched formula processing result. Integration module 705 is configured to integrate the matching results of each current version formula and the processing results of the unmatched formulas to generate a structured comparison table; The numbering rearrangement module 706 is configured to check the structured lookup table and, after verifying that there are no errors, rearrange the formula numbers of the historical version formulas based on the remaining valid information in the structured lookup table. Optionally, the documents corresponding to the historical version formulas include the formula number, formula expression, formula description, formula type, and associated review rules for each historical version formula; the feature index model includes a first-level index model and a second-level index model, and constructing the feature index model of the historical version formulas based on the documents corresponding to the historical version formulas includes: Based on the associated review rules of the formulas in each historical version, a first-level index model is constructed; Based on the formula expressions and formula descriptions of each historical version formula, a two-level index model of the historical version formula is constructed.
[0125] Optionally, the primary index model includes a first hash table index sub-model and an HNSW index sub-model. The construction of the primary index model based on the association review rules of each historical version formula includes: Feature extraction is performed on the associated review rules of formulas in each historical version to obtain the review rule text and review rule coverage indicators; Using the audit rule text and audit rule coverage indicators as hash keys, and all formulas associated with the associated audit rules as hash values, construct a first hash table index sub-model; Using the vectors obtained from the operation of the review rule text and the review rule coverage index as nodes, and 1 / vector similarity as the node distance, an HNSW index sub-model is constructed.
[0126] Optionally, the secondary index model includes a second hash table index sub-model, a third hash table index sub-model, a fourth hash table index sub-model, a first BK tree index sub-model, and a second BK tree index sub-model; the construction of the secondary index model of the historical version formula based on the formula expression and formula description of each historical version formula includes: Determine the reverse Polish notation for each historical version of the formula; Feature extraction is performed on the formula expression, reverse Polish notation, and formula description of each historical version of the formula to obtain the formula expression text, reverse Polish notation text, and formula description text. A second hash table index sub-model is constructed using the formula expression text as the hash key and the formula number corresponding to the formula expression text as the hash value. Using the Reverse Polish Notation text as the hash key and the formula number corresponding to the Reverse Polish Notation text as the hash value, a third hash table index sub-model is constructed. Using the formula description text as the hash key and the formula number corresponding to the formula description text as the hash value, a fourth hash table index sub-model is constructed. Based on the formula expressions described above, construct the first BK tree index sub-model; Based on the described Reverse Polish notation, construct the second BK tree index sub-model.
[0127] Optionally, the document corresponding to the current version formula includes the formula number, formula expression, formula description, formula type, and associated review rules for each current version formula. The step of searching the formula library based on the feature index model and outputting the matching results for each current version formula includes: Feature extraction is performed on each of the current version formulas to obtain the associated review rule text and rule coverage indicators for each current version formula; Based on the associated review rule text, rule coverage index and first hash table index sub-model of each current version formula, determine whether there is an associated review rule in the formula library that matches the current version formula; If so, retrieve the set of candidate formulas corresponding to the associated review rules from the formula library, search within the set of candidate formulas, and output the matching results for each current version formula; If not, based on the HNSW index sub-model, the associated review rule text of each current version formula, and the vector obtained by the rule coverage index calculation, determine the semantic similarity between the associated review rule of each current version formula and the associated review rule of each historical version formula, and based on the semantic similarity, determine whether there is an associated review rule in the formula library that matches the current version formula. If so, retrieve the set of candidate formulas corresponding to the associated review rules from the formula library, search within the set of candidate formulas, and output the matching results for each current version formula; If not, output the matching result of the current version formula as "no match".
[0128] Optionally, determining whether there are any associated review rules in the formula library that match the current version formula based on the semantic similarity includes: Determine whether each of the semantic similarities is less than a preset similarity threshold; If so, determine that there is no associated audit rule in the formula library that matches the current version of the formula; If not, sort the association review rules of the historical version formula according to the semantic similarity, select a preset number of association review rules with semantic similarity greater than the preset similarity threshold, and perform semantic comparison based on the semantic comparison agent of the review rule item; If there are semantically identical related audit rules, then it is determined that there are related audit rules in the formula library that match the current version formula; If no semantically identical associated audit rules exist, it is determined that there are no associated audit rules in the formula library that match the current version of the formula.
[0129] Optionally, the step of searching the candidate formula set and outputting the matching results for each current version formula includes: Determine whether the number of formulas in the candidate formula set is consistent with the number of formulas included in the associated review rules; If they match and the number of formulas is 1, the fourth hash table index sub-model and the formula description text are matched in the formula candidate set. If they match, the matching result of the current version formula is output as a complete match; if they do not match and the text similarity is less than the preset similarity threshold, the matching result of the current version formula is output as no match. If they match and the number of formulas is not 1, match them in the candidate formula set based on the second hash table index sub-model, the third hash table index sub-model, the fourth hash table index sub-model, the formula expression text, the reverse Polish notation text, and the formula description text, and output the matching result of the current version formula; If there is a discrepancy, the matching result of the current version formula will be output as either many-to-one or one-to-many.
[0130] Optionally, the matching based on the second hash table index sub-model, the third hash table index sub-model, the fourth hash table index sub-model, the formula expression text, the reverse Polish notation text, and the formula description text in the candidate formula set, and the output of the matching result of the current version formula, includes: Based on the second hash table index sub-model and the formula expression text, determine whether there is a formula expression in the formula candidate set that matches the current version formula; If so, output the matching result of the current version formula as a match; If not, based on the third hash table index sub-model and the reverse Polish notation text, determine whether there is a reverse Polish notation in the formula candidate set that matches the current version formula; If so, output the matching result of the current version formula as a match but the formula expression is inconsistent; If not, based on the fourth hash table index sub-model and the formula description text, determine whether there is a formula description in the formula candidate set that matches the current version formula; If so, output the matching result of the current version formula as a match but the formula expression is inconsistent; If not, perform BK tree retrieval based on the formula expression, reverse Polish notation, the first BK tree index sub-model and the second BK tree index sub-model to find the item with the smallest edit distance and determine whether the similarity is greater than the preset similarity threshold. If the similarity exceeds a preset threshold, the semantic comparison agent of the review rule item is executed to compare the semantics and determine whether the semantics are consistent. If they are consistent, the matching result of the current version formula is output as a match; if they are inconsistent, the matching result of the current version formula is output as no match. If the similarity is less than the preset similarity threshold, the matching result of the current version formula is output as no match.
[0131] Since the principle of the automatic rearrangement device for formula numbering is similar to that of the above method, the implementation of the automatic rearrangement device for formula numbering can be found in the implementation of the automatic rearrangement method for formula numbering described above, and will not be repeated here.
[0132] According to embodiments of the present disclosure, the present disclosure also provides a computer device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the steps of an automatic rearrangement method for formula numbering according to the foregoing embodiments.
[0133] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described automatic rearrangement method for formula numbering.
[0134] This invention also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the above-described automatic rearrangement method for formula numbering.
[0135] Figure 14 A schematic block diagram of an example computer device 900 that can be used to implement embodiments of the present disclosure is shown. The computer device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The computer device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0136] like Figure 14 As shown, device 900 includes a computing unit 901, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 902 or a computer program loaded from storage unit 908 into random access memory (RAM) 903. RAM 903 may also store various programs and data required for the operation of device 900. The computing unit 901, ROM 902, and RAM 903 are interconnected via bus 904. Input / output (I / O) interface 905 is also connected to bus 904.
[0137] Multiple components in device 900 are connected to I / O interface 905, including: input unit 906, such as keyboard, mouse, etc.; output unit 907, such as various types of monitors, speakers, etc.; storage unit 908, such as disk, optical disk, etc.; and communication unit 909, such as network card, modem, wireless transceiver, etc. Communication unit 909 allows device 900 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0138] The computing unit 901 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 901 performs the various methods and processes described above, such as an automatic rearrangement method for formula numbering.
[0139] For example, in some embodiments, an automatic rearrangement method for formula numbering can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 908. In some embodiments, part or all of the computer program can be loaded and / or installed on device 900 via ROM 902 and / or communication unit 909. When the computer program is loaded into RAM 903 and executed by computing unit 901, one or more steps of the automatic rearrangement method for formula numbering described above can be performed. Alternatively, in other embodiments, computing unit 901 can be configured to perform an automatic rearrangement method for formula numbering by any other suitable means (e.g., by means of firmware).
[0140] Various implementations of the systems and techniques described above can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include: implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0141] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0142] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0143] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0144] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0145] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.
[0146] It should be noted that in the description of this application, 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.
[0147] In the embodiments of this application, the singular forms "a," "the," etc., including the plural forms, should be broadly understood as "a kind" or "a class" rather than limited to the meaning of "an." Furthermore, the term "the" should be understood to include both the singular and plural forms, unless the context explicitly indicates otherwise. Additionally, the term "according to" should be understood as "at least partially based on…," and the term "based on" should be understood as "at least partially based on…," unless the context explicitly indicates otherwise.
[0148] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this disclosure can be achieved, and this is not limited herein.
[0149] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. An automatic rearrangement method for formula numbering, characterized in that, include: Get the documents corresponding to the formulas in historical versions and the documents corresponding to the formulas in the current version; Based on the documents corresponding to the historical version formulas, construct a feature index model for the historical version formulas. Using the historical version formulas as a formula library, the documents corresponding to the current version formulas are traversed, and based on the feature index model, a search is performed in the formula library to output the matching results of each current version formula. In response to the matching result being no match, the formula comparison agent is invoked to analyze the current version formula that is not matched, and the processing result of the unmatched formula is output. The matching results of each current version formula and the processing results of the unmatched formulas are integrated to generate a structured comparison table; The structured comparison table is checked, and after verification, the formula numbers of the historical version formulas are rearranged based on the remaining valid information in the structured comparison table.
2. The method according to claim 1, characterized in that, The documents corresponding to the historical version formulas include the formula number, formula expression, formula description, formula type, and associated review rules for each historical version formula; the feature index model includes a primary index model and a secondary index model, and the construction of the feature index model for the historical version formulas based on the documents corresponding to the historical version formulas includes: Based on the associated review rules of the formulas in each historical version, a first-level index model is constructed; Based on the formula expressions and formula descriptions of each historical version formula, a two-level index model of the historical version formula is constructed.
3. The method according to claim 2, characterized in that, The primary index model includes a first hash table index sub-model and an HNSW index sub-model. The primary index model is constructed based on the association review rules of each historical version formula, including: Feature extraction is performed on the associated review rules of formulas in each historical version to obtain the review rule text and review rule coverage indicators; Using the audit rule text and audit rule coverage indicators as hash keys, and all formulas associated with the associated audit rules as hash values, construct a first hash table index sub-model; Using the vectors obtained from the operation of the review rule text and the review rule coverage index as nodes, and 1 / vector similarity as the node distance, an HNSW index sub-model is constructed.
4. The method according to claim 3, characterized in that, The secondary index model includes a second hash table index sub-model, a third hash table index sub-model, a fourth hash table index sub-model, a first BK tree index sub-model, and a second BK tree index sub-model. The construction of a two-level index model for the historical version formulas, based on the formula expressions and formula descriptions of each historical version formula, includes: Determine the reverse Polish notation for each historical version of the formula; Feature extraction is performed on the formula expression, reverse Polish notation, and formula description of each historical version of the formula to obtain the formula expression text, reverse Polish notation text, and formula description text. A second hash table index sub-model is constructed using the formula expression text as the hash key and the formula number corresponding to the formula expression text as the hash value. Using the Reverse Polish Notation text as the hash key and the formula number corresponding to the Reverse Polish Notation text as the hash value, a third hash table index sub-model is constructed. Using the formula description text as the hash key and the formula number corresponding to the formula description text as the hash value, a fourth hash table index sub-model is constructed. Based on the formula expressions described above, construct the first BK tree index sub-model; Based on the described Reverse Polish notation, construct the second BK tree index sub-model.
5. The method according to claim 4, characterized in that, The document corresponding to the current version formula includes the formula number, formula expression, formula description, formula type, and associated review rules for each current version formula. Based on the feature indexing model, a search is performed in the formula library, and the matching results for each current version formula are output, including: Feature extraction is performed on each of the current version formulas to obtain the associated review rule text and rule coverage indicators for each current version formula; Based on the associated review rule text, rule coverage index and first hash table index sub-model of each current version formula, determine whether there is an associated review rule in the formula library that matches the current version formula; If so, retrieve the set of candidate formulas corresponding to the associated review rules from the formula library, search within the set of candidate formulas, and output the matching results for each current version formula; If not, based on the HNSW index sub-model, the associated review rule text of each current version formula, and the vector obtained by the rule coverage index calculation, determine the semantic similarity between the associated review rule of each current version formula and the associated review rule of each historical version formula, and based on the semantic similarity, determine whether there is an associated review rule in the formula library that matches the current version formula. If so, retrieve the set of candidate formulas corresponding to the associated review rules from the formula library, search within the set of candidate formulas, and output the matching results for each current version formula; If not, output the matching result of the current version formula as "no match".
6. The method according to claim 5, characterized in that, The step of determining whether there are any associated review rules in the formula library that match the current version formula based on the semantic similarity includes: Determine whether each of the semantic similarities is less than a preset similarity threshold; If so, determine that there is no associated audit rule in the formula library that matches the current version of the formula; If not, sort the association review rules of the historical version formula according to the semantic similarity, select a preset number of association review rules with semantic similarity greater than the preset similarity threshold, and perform semantic comparison based on the semantic comparison agent of the review rule item; If there are semantically identical related audit rules, then it is determined that there are related audit rules in the formula library that match the current version formula; If no semantically identical associated audit rules exist, it is determined that there are no associated audit rules in the formula library that match the current version of the formula.
7. The method according to claim 5, characterized in that, The step of searching the candidate formula set and outputting the matching results for each current version formula includes: Determine whether the number of formulas in the candidate formula set is consistent with the number of formulas included in the associated review rules; If they match and the number of formulas is 1, the fourth hash table index sub-model and the formula description text are matched in the formula candidate set. If they match, the matching result of the current version formula is output as a complete match; if they do not match and the text similarity is less than the preset similarity threshold, the matching result of the current version formula is output as no match. If they match and the number of formulas is not 1, match them in the candidate formula set based on the second hash table index sub-model, the third hash table index sub-model, the fourth hash table index sub-model, the formula expression text, the reverse Polish notation text, and the formula description text, and output the matching result of the current version formula; If there is a discrepancy, the matching result of the current version formula will be output as either many-to-one or one-to-many.
8. The method according to claim 7, characterized in that, The matching process, based on the second hash table index sub-model, the third hash table index sub-model, the fourth hash table index sub-model, the formula expression text, the reverse Polish notation text, and the formula description text, performs matching within the candidate formula set and outputs the matching result of the current version formula, including: Based on the second hash table index sub-model and the formula expression text, determine whether there is a formula expression in the formula candidate set that matches the current version formula; If so, output the matching result of the current version formula as a match; If not, based on the third hash table index sub-model and the reverse Polish notation text, determine whether there is a reverse Polish notation in the formula candidate set that matches the current version formula; If so, output the matching result of the current version formula as a match but the formula expression is inconsistent; If not, based on the fourth hash table index sub-model and the formula description text, determine whether there is a formula description in the formula candidate set that matches the current version formula; If so, output the matching result of the current version formula as a match but the formula expression is inconsistent; If not, perform BK tree retrieval based on the formula expression, reverse Polish notation, the first BK tree index sub-model and the second BK tree index sub-model to find the item with the smallest edit distance and determine whether the similarity is greater than the preset similarity threshold. If the similarity exceeds a preset threshold, the semantic comparison agent of the review rule item is executed to compare the semantics and determine whether the semantics are consistent. If they are consistent, the matching result of the current version formula is output as a match; if they are inconsistent, the matching result of the current version formula is output as no match. If the similarity is less than the preset similarity threshold, the matching result of the current version formula is output as no match.
9. An automatic rearrangement device for formula numbering, characterized in that, include: The acquisition module is configured to acquire the documents corresponding to historical version formulas and the documents corresponding to the current version formula. The feature index model building module is configured to build a feature index model of the historical version formula based on the document corresponding to the historical version formula. The matching module is configured to use the historical version formulas as a formula library, traverse the documents corresponding to the current version formulas, and search the formula library based on the feature index model, and output the matching results of each current version formula. The no-match processing module is configured to, in response to the matching result being no match, call the formula comparison agent to analyze the unmatched current version formula and output the unmatched formula processing result; The integration module is configured to integrate the matching results of each current version formula and the processing results of the unmatched formulas to generate a structured comparison table; The numbering rearrangement module is configured to check the structured lookup table and, after verifying that there are no errors, rearrange the formula numbers of the historical version formulas based on the remaining valid information in the structured lookup table.
10. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the automatic rearrangement method for formula numbering as described in any one of claims 1-8.
11. A computer-readable medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the automatic rearrangement method for formula numbering as described in any one of claims 1-8.
12. A computer program product comprising a computer program / instructions, characterized in that, When executed by a processor, the computer program / instruction implements the automatic rearrangement method for formula numbering as described in any one of claims 1-8.