A method and device for determining the cost data coding of a hydroelectric project
By using a pre-defined data format feature library and coding rule library for cost estimation software, the coding of hydropower project cost data is automatically matched and determined, solving the problems of long processing time and high error rate of manual processing, and achieving efficient and accurate data coding processing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NORTHWEST ENGINEERING CORPORATION LIMITED
- Filing Date
- 2026-02-04
- Publication Date
- 2026-04-17
AI Technical Summary
In existing technologies, the processing of hydropower project cost data suffers from inconsistent technical standards among different software, resulting in time-consuming manual identification and coding, which seriously delays project progress and also suffers from high error rates and poor reusability.
By using a pre-defined database of cost estimation software data format features and a database of coding rules, the system automatically matches the structural features of cost estimation files exported from different software, determines the business type and the location of key data columns, constructs structured semantic path information, calculates confidence levels, and automatically determines the data encoding when the target matching degree reaches a threshold.
It has achieved automated processing of cost data encoding, avoiding manual identification and modification, improving processing efficiency, reducing error rate, and ensuring data accuracy and cross-project reusability.
Smart Images

Figure CN121638169B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of hydropower project cost data processing technology, specifically to a method and apparatus for determining hydropower project cost data encoding. Background Technology
[0002] In the current cost management process for hydropower projects, cost data serves as the core basis for project investment control, scheme comparison, and financial planning. Its accuracy and interoperability directly affect project management efficiency. However, due to the lack of unified technical standards among cost estimation software on the market, significant differences exist in the program coding systems of different software.
[0003] In related technologies, the cost management of hydropower projects mainly relies on manual operation. The specific process includes: cost personnel first open the cost files exported from different software one by one, manually identify the meaning of each data field, then compare the classification and coding standard system of hydropower project cost data or other internal coding standards of enterprises, manually modify the project code of each sub-item, and finally enter the data into a unified table.
[0004] However, the cost data for a large or medium-sized hydropower project contains thousands of sub-items. Manual identification and coding require multiple cost estimators to work continuously for a long time, which seriously delays the project schedule. Summary of the Invention
[0005] In view of this, this application provides a method and apparatus for determining the code of hydropower project cost data, so as to solve the problem that manual identification and coding in related technologies leads to long working time and seriously delays the project schedule.
[0006] Firstly, this application provides a method for determining the encoding of hydropower engineering cost data. The method includes: acquiring cost document data to be processed; based on the structural characteristics of the cost document data to be processed, using a preset cost software data format feature library for matching, determining the business type and key data column location information of the cost document data to be processed, and determining the file structure matching confidence level based on the structural characteristics, including worksheet name and header structure; based on the location information of key data columns and business type, using a preset encoding rule library, constructing structured semantic path information, and determining the confidence level of cell content information; the semantic path information is used to determine cell content; based on the file structure matching confidence level and the confidence level of cell content information, determining the target matching degree; when the target matching degree is greater than the matching degree threshold, determining the data encoding corresponding to the cost document data to be processed based on the semantic path information and the preset encoding rule library.
[0007] In one possible implementation, the confidence level of file structure matching is determined based on structural features, including: determining the matching degree of worksheet name based on the matching results of worksheet name with a preset cost software data format feature library; determining the matching degree of header structure based on the matching results of header structure with a preset cost software data format feature library; and determining the confidence level of file structure matching based on a weighted average of worksheet name matching degree and header structure matching degree.
[0008] In one possible implementation, based on the location information and business type of the key data column, a structured semantic path information is constructed using a pre-defined encoding rule library. This includes: performing data cleaning and Chinese word segmentation on the natural language text in the key data column to obtain the word segmentation results; matching and verifying the word segmentation results with the standard project names belonging to the business type in the pre-defined encoding rule library to obtain the matching and verification results; and constructing the structured semantic path information based on the matching and verification results.
[0009] In one possible implementation, determining the confidence level of cell content information includes: determining the basic confidence level of the engineering entity based on the number of successful matching verifications of the word segmentation results in the preset encoding rule library; determining the confidence level of the hierarchical relationship based on the verification results of the hierarchical relationship between engineering entities in the semantic path information; and determining the confidence level of the cell content information based on the product operation of the basic confidence level of the engineering entity and the confidence level of the hierarchical relationship.
[0010] In one possible implementation, the data encoding corresponding to the cost document data to be processed is determined based on semantic path information and a preset encoding rule library. This includes: querying the preset encoding rule library sequentially based on the entity hierarchy order in the semantic path information to determine the encoding corresponding to each level; and combining the encodings according to the hierarchy order to obtain the data encoding corresponding to the cost document data to be processed.
[0011] In one possible implementation, the method further includes: when the target matching degree is less than or equal to the matching degree threshold, outputting semantic path information as a recommendation result; and in response to a confirmation instruction for the output recommendation result, determining the data encoding corresponding to the cost document data to be processed.
[0012] In one possible implementation, the method further includes: generating a correction sample corresponding to the data encoding in response to a correction instruction for the data encoding; and updating a preset encoding rule library and / or a preset cost software data format feature library based on the correction sample.
[0013] In one possible implementation, the method further includes: acquiring update information of the cost estimation software and updating a preset cost estimation software data format feature library based on the update information; and / or receiving new format samples uploaded by users and updating the preset cost estimation software data format feature library based on the new format samples; and / or, when the data encoding corresponding to the target matching degree is inconsistent with the correction encoding input by the user, recording a correction sample containing feature information of the new format sample and the correction encoding; if the similarity between the feature information of the correction sample and any feature template in the preset cost estimation software data format feature library is less than a first threshold, marking the correction sample as a new format sample to be reviewed, and updating the preset cost estimation software data format feature library in response to the addition instruction for the new format sample to be reviewed; if the similarity between the feature information of the correction sample and the feature template in the preset cost estimation software data format feature library is greater than a second threshold, and the data encoding is inconsistent with the correction encoding, then adjusting the confidence weight of the feature template.
[0014] In one possible implementation, the pre-defined coding rule base includes: a hierarchical base table, a hierarchical relationship table, and a project coding mapping table; wherein, the hierarchical base table stores the basic attributes of each level of coding; the hierarchical relationship table defines the dependency logic between levels; and the project coding mapping table associates the project name with each level of coding.
[0015] Secondly, this application provides a device for determining the encoding of hydropower engineering cost data. The device includes: an acquisition module for acquiring cost document data to be processed; a first determination module for matching the cost document data based on its structural features using a preset cost software data format feature library, determining the business type and key data column location information of the cost document data, and determining the file structure matching confidence level based on the structural features, including worksheet name and header structure; a second determination module for constructing structured semantic path information based on the key data column location information and business type using a preset encoding rule library, and determining the confidence level of cell content information; the semantic path information is used to determine cell content; a third determination module for determining the target matching degree based on the file structure matching confidence level and the cell content information confidence level; and a fourth determination module for determining the data encoding corresponding to the cost document data to be processed based on the semantic path information and the preset encoding rule library when the target matching degree is greater than a matching degree threshold.
[0016] Thirdly, this application provides a computer device, including: a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to perform the method for determining the hydropower project cost data encoding described in the first aspect or any corresponding embodiment.
[0017] Fourthly, this application provides a computer-readable storage medium storing computer instructions for causing a computer to execute the method for determining the hydropower project cost data encoding described in the first aspect or any corresponding embodiment.
[0018] Fifthly, this application provides a computer program product, including computer instructions, which are used to cause a computer to execute the method for determining the hydropower project cost data encoding described in the first aspect or any corresponding embodiment.
[0019] The method for determining the coding of hydropower engineering cost data provided in this application embodiment utilizes a preset cost software data format feature library to automatically match the structural features of cost files exported from different software. This replaces the process of manually opening files one by one and manually identifying data fields, directly determining the business type and the location information of key data columns, and generating file structure matching confidence. Simultaneously, using a preset coding rule library, based on the determined key data column locations and business types, it automatically determines cell content information by constructing structured semantic path information from thousands of sub-items, then determines the confidence of the cell content information, and then automatically derives the target matching degree by combining the file structure matching confidence. When the target matching degree is greater than the matching degree threshold, it automatically determines and outputs the data code corresponding to each sub-item based on the semantic path information and the coding rule library. This completely avoids the steps of manually comparing coding standards, manually modifying codes, and entering uniform tables, fundamentally solving the problems of time-consuming manual operations and potential delays in project progress. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the specific embodiments of this application or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0021] Figure 1 This is a flowchart illustrating the method for determining the cost data encoding of hydropower projects according to the embodiments of this application;
[0022] Figure 2 This is a schematic diagram of the encoding structure provided according to an embodiment of this application;
[0023] Figure 3 This is a schematic diagram illustrating the construction process of the encoding rule library provided in the embodiments of this application;
[0024] Figure 4 This is a schematic diagram of the structure of the system for determining the cost data encoding of hydropower projects according to the embodiments of this application;
[0025] Figure 5 This is a structural block diagram of the device for determining the cost data encoding of hydropower projects according to the embodiments of this application;
[0026] Figure 6 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of this application. Detailed Implementation
[0027] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0028] According to an embodiment of this application, a method for determining the cost data encoding of hydropower projects is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system capable of executing instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than that shown here.
[0029] In the current cost management process for hydropower projects, cost investment data serves as the core basis for project investment control, scheme comparison, and financial planning. Its accuracy and interoperability directly impact project management efficiency. However, due to the lack of standardized technical standards among cost estimation software developers, different software programs exhibit significant differences in data storage structure, field definitions, output formats, and program coding systems, resulting in the following situations:
[0030] Data formats and semantics exhibit heterogeneity. Data files (such as Excel spreadsheets) exported from different cost estimation software differ significantly in structure. These differences are not only reflected in worksheet naming and header field names, but also in data organization logic and internal identifiers. This makes cross-software data structurally incompatible and necessitates semantic parsing and mapping.
[0031] Incompatible coding systems exist. Each software program extends national standards, forming its own custom coding system. For example, different cost estimation software programs may add custom prefixes or suffixes to the national standard code to identify their unique attributes. These proprietary coding rules are not mutually recognized between different software programs, making it difficult to directly exchange and reuse cost estimation data among different stakeholders (such as design institutes, construction companies, and auditing firms), usually requiring additional conversion processing.
[0032] To address the aforementioned differences, relevant technologies typically rely on manual operation for data identification and encoding conversion. The specific process involves cost estimators first opening cost files exported from different software, manually identifying the engineering meaning of each data field (e.g., mapping "List ID," "Code," and "Project Code" to "Engineering Sub-item Code"), then manually modifying the engineering code for each sub-item by referring to the classification and coding standard system for hydropower engineering cost data or other internal coding standards of the company, and finally entering the data into a unified table. However, this method often has the following problems:
[0033] 1. Inefficiency. The cost data for a large or medium-sized hydropower project contains thousands of sub-items. Manual identification and coding require multiple cost estimators to work continuously for several days. If data export from multiple software programs is involved, the workload doubles, severely delaying the project schedule.
[0034] 2. High error rate. Manual operation is prone to problems such as inconsistent coding, duplicate coding, and omission of coding, which may lead to deviations in subsequent cost analysis and errors in investment calculation.
[0035] 3. Poor reusability. Manually processed codes are only applicable to the current project. When reusing codes across projects, such as applying the "concrete beam" sub-item code from project A to project B, the software format and coding rules need to be rechecked, making direct data integration impossible. When sharing data across software, manual conversion is required again. For example, when a construction company receives cost data generated by a consulting firm using cost estimation software, it needs to import it into the specific software for use.
[0036] To address all or part of the technical problems in the aforementioned related technologies, this application first provides a method for determining the encoding of hydropower project cost data, which can be used with computer equipment such as computers and servers. Figure 1 This is a flowchart illustrating the method for determining the cost data encoding of hydropower projects according to an embodiment of this application, as shown below. Figure 1 As shown, the process includes the following steps:
[0037] Step S101: Obtain the cost document data to be processed. This cost document data can represent raw data files exported from various hydropower engineering cost estimation software, used to characterize cost items or expense items in hydropower projects, and which have not yet been standardized and coded. Specifically, the system can receive the raw cost documents provided by the user through a file upload interface or by reading from a specified directory. For example, the system can receive files uploaded by the user through a web interface, API interface, or by monitoring a specified directory.
[0038] As an example, the system can call document processing libraries such as Apache POI to load Excel files into memory, ready for parsing. In one application example, a user can upload a file titled "Total Cost Table of a Hydropower Station Project.xlsx" compiled using cost estimation software to the system. The system successfully receives this file and uses it as cost estimation data to be processed.
[0039] Step S102: Based on the structural features of the cost document data to be processed, a preset cost software data format feature library is used for matching to determine the business type and key data column location information of the cost document data to be processed, and the file structure matching confidence is determined based on the structural features, including worksheet name and header structure.
[0040] The structural features represent the overall, non-content-related structural information of the cost estimation document, and can include: worksheet names and header structures. Worksheet names can indicate the label names of each worksheet in the Excel file, such as the Total Cost Table or the Hub Construction Cost Table. The header structure indicates the column header rows at the top of the data table, defining the meaning of each column of data, such as project name, unit, quantity, and unit price (yuan).
[0041] The cost estimation software data format feature library indicates a pre-built data format feature library that stores format templates for exported files from different cost estimation software, including typical worksheet naming rules and header structure features. The business type indicates the major cost estimation business category determined based on file features, such as total investment, bill of quantities items, or basic information. The location information of key data columns indicates the position of the target column containing project description text within the table, such as the "Project Name" column being located in column A. The file structure matching confidence score represents a quantitative score indicating the reliability of the file identification result.
[0042] Specifically, the system compares the macroscopic features of the uploaded cost estimation documents with templates in a pre-defined cost estimation software data format feature library. For example, if the system finds a worksheet named "Total Project Cost Table" with cell A1 displaying "Total Project Cost Table" and headers including project name and cost amount, this highly matches the "Software A - Total Investment Item" template in the pre-defined cost estimation software data format feature library. Therefore, the system determines the document's business type as "Total Investment Item" and identifies the "Project Name" column as the key data column. Simultaneously, based on the accuracy of the match, a high confidence level is assigned, such as 0.95.
[0043] As an example, reading the file "Total Cost Table for a Hydropower Station Project.xlsx" reveals that its first worksheet is named "Total Cost Table," and its header contains "Serial Number," "Project Name," "Unit," "Quantity," and "Unit Price." Matching this with the preset cost estimation software data format feature library shows a high degree of match with the "Software A - Total Investment Item" template. Therefore, the system determines that the business type is "Total Investment Item," the key data column is column B containing "Project Name," and gives a file structure matching confidence level of 0.95.
[0044] In one possible implementation, the pre-defined cost estimation software data format feature library can be constructed as follows: obtain typical exported data format samples of hydropower engineering cost estimation software, analyze and extract the data format features of each software, and construct the pre-defined cost estimation software data format feature library.
[0045] The core structure of the preset cost estimation software data format feature library is shown in Table 1 below, but it is actually stored in the system as a structured database (SQL table).
[0046] Table 1
[0047]
[0048] The data source characteristics include:
[0049] (1) Worksheet name data: file extension, file internal structure (such as a worksheet with a specific name).
[0050] (2) Structural features: the row and column structure of the table header, whether there are multi-level table headers, and the title text in a fixed position.
[0051] (3) Mapping logic: It defines how to derive the target unified code from the specific features of the source data.
[0052] (4) Confidence weight: Assign a weight value to each recognition rule of each software. This weight can be dynamically adjusted based on the historical recognition accuracy.
[0053] In subsequent comprehensive decision-making steps, the matching results from the preset cost software data format feature library can be weighted and fused with the results of general keyword matching to make a more reliable judgment.
[0054] Furthermore, the construction process of the pre-defined cost estimation software data format feature library may include the following technical steps:
[0055] Step 2-1: Sample Collection and Processing. On one hand, export data samples from mainstream cost estimation software are collected; on the other hand, the samples are cleaned and standardized, sensitive information is removed, and they are labeled with correct unified codes to form a standard training sample set.
[0056] Step 2-2: Feature Extraction and Rule Generation. The system automatically extracts the features from the above data sources from the samples using natural language processing and data structure analysis algorithms.
[0057] Steps 2-3: Storage and Indexing. The approved feature templates and mapping rules are stored in a pre-defined feature library for cost estimation software data formats, and an efficient indexing mechanism is established for rapid matching.
[0058] In addition, in the pre-defined construction process of the cost estimation software data format feature library, to ensure the timeliness and comprehensiveness of the pre-defined cost estimation software data format feature library, the system is configured with the following dynamic update mechanism:
[0059] (1) Proactive Updates. Specifically, the system can be configured to periodically and automatically retrieve the update logs and documents of the target cost estimation software. It will then use NLP technology to analyze the descriptions in the documents regarding data export and report format changes, automatically generate new feature templates to be verified, and prompt the administrator for processing.
[0060] (2) Passive Update. Specifically, when a user encounters software or a new format that the system cannot recognize, they can actively upload a data sample. The system will prompt the user to specify the correct Unicode for the sample. This upload will trigger the feature library update process.
[0061] (3) Feedback-based self-learning. Specifically, when the system initially misidentifies a file and the user manually corrects it, the system records this correction and uses the user's final confirmed encoding as the correct label. The system analyzes the file's features and uses them, along with the correct label, as a new training sample. If the sample's features do not match any template in the preset cost software data format feature library, the system marks it as a "suspected new format" and reminds the administrator to review and add it to the preset cost software data format feature library.
[0062] If a sample feature is similar to an existing template but causes an error, the system can automatically adjust the confidence weight of that template or optimize its mapping rules. The final preset structure of the cost estimation software data format feature library is shown in Table 2 below:
[0063] Table 2
[0064]
[0065] Step S103: Based on the location information and business type of the key data columns, and using a pre-defined coding rule library, structured semantic path information is constructed, and the confidence level of cell content information is determined; the semantic path information is used to determine the cell content. The pre-defined coding rule library can represent a database storing industry or enterprise standard project divisions, names, and coding rules, which specifies the standardized expression and hierarchical relationship of project names, such as "hub project" being coded as 01, and its subordinate "construction traffic engineering" also being coded as 01, etc.
[0066] In one possible implementation, the pre-defined coding rule base includes: a hierarchical base table, a hierarchical relationship table, and a project coding mapping table; wherein, the hierarchical base table stores the basic attributes of each level of coding; the hierarchical relationship table defines the dependency logic between levels; and the project coding mapping table associates the project name with each level of coding.
[0067] Structured semantic path information can be used to parse natural language text in cells into a project path with a clear hierarchical relationship. For example, "Hub Project - Construction Traffic Engineering - Highway Engineering" in the first part can be parsed into an array: ["Total Investment", "Hub Project", "Construction Traffic Engineering", "Highway Engineering"]. The confidence level of semantic path information can be used to indicate the quantitative score of the system's accuracy in generating semantic paths.
[0068] Specifically, based on the positioning results of step S102, the text in the key data columns is read. First, data cleaning and Chinese word segmentation are performed. Then, the encoding rule library is queried to verify each word segmentation result, such as verifying whether "hub project," "construction traffic project," and "highway project" are standard project names, and checking whether the hierarchical relationship between the word segments is correct. After successful verification, a complete semantic path is constructed. After determining the complete semantic path, the content information of the cells can be further determined, and then the confidence level is determined based on the content information of the cells.
[0069] As an example, the system reads the text from the key data column: Part 1, Hub Project - Construction Traffic Engineering - Highway Engineering. Removing "Part 1" yields "Hub Project - Construction Traffic Engineering - Highway Engineering". The system queries the coding rule base and confirms that Hub Project, Construction Traffic Engineering, and Highway Engineering all exist in the code rule base. Combining this with the business type "Total Investment Item" determined in step S102, a semantic path is generated: ["Total Investment Item", "Hub Project", "Construction Traffic Engineering", "Highway Engineering"]. Then, based on this path, it determines that the entities corresponding to the cell content are all valid and the hierarchical relationship is correct. The system gives a confidence score of 0.9 for the cell content information.
[0070] In one possible implementation, refer to Figure 2 and Figure 3 , Figure 2 This is a schematic diagram of the encoding structure provided according to an embodiment of this application. Figure 3 This is a schematic diagram illustrating the construction process of a preset encoding rule library provided in the embodiments of this application.
[0071] Combination Figure 2 As shown, the category codes use numerical encoding, with each code consisting of a single digit. The category codes for hydropower engineering cost information are shown in Table 3 below:
[0072] Table 3
[0073]
[0074] (2) The coding method for the major categories of investment items should meet the following requirements:
[0075] a) The class code uses numeric encoding, with the code consisting of 2 digits, numbered sequentially from 01 to 99.
[0076] b) The sub-category code uses a numeric encoding, with the code consisting of 2 digits. The codes are sequentially encoded from 01 to 99 according to the order of the sub-category items under each sub-category item.
[0077] c) The subclass code adopts a numerical encoding, with the code consisting of 3 digits. The first digit, "1", represents the upper reservoir project of the pumped storage power station, and the second digit, "2", represents the lower reservoir project of the pumped storage power station. The remaining codes are "0". The second and third digits are encoded sequentially from 01 to 99 according to the order of the subclass projects under the subclass project. The subclass projects are mainly compiled according to the first-level projects in NB / T11408 and NB / T11410. NB / T11408 represents the "Regulations for the Compilation of Design Estimates for Hydropower Projects", and NB / T11410 represents the "Detailed Rules for the Compilation of Investment Estimates for Pumped Storage Power Stations".
[0078] d) Sub-subclass codes are numerically encoded, with each code consisting of two digits. They are sequentially encoded from 01 to 99 according to the order of the sub-subclass items under the sub-subclass item. The sub-subclass items are mainly compiled according to the second-level items in NB / T11408 and NB / T11410.
[0079] e) The subclass code uses numeric encoding, with each code consisting of two digits. The subclass code is an extension of the subclass code, and is sequentially encoded from 01 to 99.
[0080] (3) The coding method for the major categories of the bill of quantities items shall meet the following requirements:
[0081] a) The class code uses numeric encoding, with the code consisting of 2 digits, numbered sequentially from 01 to 99.
[0082] b) The sub-category code uses a numeric encoding, with the code consisting of 2 digits. The codes are sequentially encoded from 01 to 99 according to the order of the sub-category items under the medium category item.
[0083] c) Subclass codes use numeric encoding, with each code consisting of 3 digits. The first digit is "0", and the second and third digits are encoded sequentially from 01 to 99 according to the order of the subclass items under the subclass item.
[0084] d) The subclass code uses numeric encoding, with each code consisting of two digits. The subclass code is an extension of the subclass code, and is sequentially encoded from 01 to 99.
[0085] The basic information category coding method should meet the following requirements:
[0086] a) The class code uses numeric encoding, with the code consisting of 2 digits, encoded sequentially from 01 to 99.
[0087] b) The sub-category code uses a numeric encoding, with the code consisting of 2 digits. The codes are sequentially encoded from 01 to 99 according to the order of the sub-category items under the medium category item.
[0088] c) Subclass codes use numeric encoding, with each code consisting of 3 digits. The first digit is "0", and the second and third digits are encoded sequentially from 01 to 99 according to the order of the subclass items under the subclass item.
[0089] d) Subclass codes use numeric encoding, with each code consisting of two digits. The codes are sequentially encoded from 01 to 99 according to the order of the subclass items under the subclass item.
[0090] Based on the above rules, a recognizable "encoding rule base" is stored in the system to clarify the logic and constraints of encoding at each level. For example, the encoding rule base can be shown in Table 4 below:
[0091] Table 4
[0092]
[0093] Combination Figure 3 As shown, Step 1: Design the data tables. Design the database model using a three-tier architecture of "hierarchical table + relational table + mapping table" to ensure that rules are decomposable and associative. The data tables can contain three tables: a hierarchical base table, a hierarchical relational table, and a project code mapping table.
[0094] (1) Hierarchical Base Table (Rule_Level_Base): Stores the basic attributes of each hierarchical code. The field design of the hierarchical base table can be referenced in Table 5 below:
[0095] Table 5
[0096]
[0097] (2) Hierarchical Relationship Table (Rule_Level_Relation): Defines the dependency logic between levels. Its fields may include: Parent_Level_ID (parent level identifier), Child_Level_ID (child level identifier), and Child_Level_NAME (child level name). The field design of the hierarchical relationship table can be referenced in Table 6 below:
[0098] Table 6
[0099]
[0100] (3) Item Code Mapping Table (Rule_Item_Map): Associates item names with codes at each level. Its fields may include: Item_Name (item name), Big_Code (major category code), Middle_Code (middle category code), etc. For specific field design, please refer to Table 7 below:
[0101] Table 7
[0102]
[0103] Step 2: Fill in the rule content.
[0104] Specifically, it includes: (1) Batch import: The basic constraints and related logic after disassembly are organized into template files according to the database table structure, and batch upload is completed through the system's rule import function; For the first-level and second-level items in the NB / T11408 and NB / T11410 standards, they are organized into CSV files according to the correspondence between the item name and the subclass code or sub-subclass code, and then written into the mapping table in batches through SQL script.
[0105] (2) Accurate entry: Add and save each rule one by one through the system's rule entry interface.
[0106] Step 3: Rule Format Validation. This mainly verifies the number of digits in the code, checking whether the code lengths of each level match, whether the value ranges are correct, and whether the hierarchical relationships are complete. After validation, a validation report is generated, marking any anomalies. For example, the subclass code should be 3 digits, but it is currently 2 digits. The process then proceeds to manual review. After reviewing the validation report, the user corrects the anomalies and submits the report, clicking the "Validation Passed" button to proceed to the next step.
[0107] Step 4: Import into the database. Click "Confirm Import" in the rule management module to mark the modeled rule as active.
[0108] Step 5: Rule Visualization Configuration. Configure the rule visualization view in the system interface, allowing users to intuitively view and adjust it. Generate a coding hierarchy tree, displaying rules in the order of "Major Category → Intermediate Category → Minor Category → ... → Detailed Category". Clicking on a node allows you to view the coding range and associated items for that level. By following these steps, you can complete the establishment of the preset coding rule library.
[0109] Step S104: Determine the target matching score based on the confidence scores of file structure matching and cell content information. The target matching score can be represented as a weighted fusion of the confidence scores corresponding to file structure features and the confidence scores corresponding to content semantic features. Specifically, the system does not rely solely on either file structure or content to make a decision, but rather integrates both. For example, a weight of 0.3 is assigned to the confidence score of file structure matching, and a weight of 0.7 is assigned to the confidence score of cell content information. A weighted calculation is then performed to obtain the final target matching score. The confidence score of file structure matching is S1 = 0.95, and the confidence score of cell content information is S2 = 0.9. Weights are set to W1 = 0.3 and W2 = 0.7. Therefore, the target matching score = (0.95 × 0.3) + (0.9 × 0.7) = 0.915.
[0110] Step S105: When the target matching degree is greater than the matching degree threshold, the data encoding corresponding to the cost document data to be processed is determined based on the semantic path information and the preset encoding rule library.
[0111] If the target matching degree is greater than the matching degree threshold, then a unique and structured numerical code can be assigned to each project according to the standards of the preset coding rule base. For example, the system adopts semantic paths such as "Total Investment", "Hub Project", "Construction Traffic Engineering", and "Highway Engineering".
[0112] Query the preset coding rule library: Item_Name='Total Investment Items', and retrieve Big_Code=1.
[0113] Query the preset encoding rule library: Item_Name='Hydropower Project', limited to Big_Code='1', take Middle_Code=01.
[0114] Query the preset encoding rule library: Item_Name='Construction and Traffic Engineering', limited to Big_Code='1' and Middle_Code='01', take Small_Code=01.
[0115] Query the preset encoding rule library: Item_Name='Highway Engineering', limit Big_Code='1', Middle_Code='01', and Small_Code='01', take Sub_Code=001, and combine according to the rules to get 10101001.
[0116] Ultimately, the system assigns the data code 10101001 to the original text “Total Investment Items - Hub Projects - Construction Traffic Engineering - Highway Engineering”, and can write this code into a new column in the original file.
[0117] The method for determining the cost data encoding of hydropower projects provided in this application embodiment utilizes a preset cost software data format feature library to automatically match the structural features of cost files exported from different software. This replaces the process of manually opening files one by one and manually identifying data fields, directly determining the business type and the location information of key data columns, and generating file structure matching confidence. At the same time, using a preset encoding rule library, based on the determined key data column locations and business types, it automatically constructs structured semantic path information for thousands of sub-items and calculates their confidence. Then, combined with the file structure matching confidence, it automatically obtains the target matching degree. When the target matching degree is greater than the matching degree threshold, it automatically determines and outputs the data encoding corresponding to each sub-item based on the semantic path information and the encoding rule library. This completely avoids the steps of manually comparing encoding standards, manually modifying encoding, and entering uniform tables, fundamentally solving the problems of time-consuming manual operations and potential delays in project progress.
[0118] In one possible implementation, step S102 above, which determines the file structure matching confidence based on structural features, specifically includes:
[0119] Step S1021: Determine the matching degree of the worksheet name based on the matching results between the worksheet name and the preset cost software data format feature library.
[0120] Step S1022: Determine the matching degree of the table header structure based on the matching results between the table header structure and the preset cost software data format feature library.
[0121] The worksheet name matching score is a quantitative similarity rating obtained by comparing the worksheet names of the files to be processed with templates in the feature library. It measures the reliability of the matching at the worksheet name level. Specifically, after determining the worksheet names, the worksheet name matching score can be further determined.
[0122] As an example, the system extracts the names of all worksheets in the file to be processed and then compares them with the standard worksheet names of various software and report types recorded in the preset cost estimation software data format feature library to obtain the worksheet name matching degree. For example, the system loads a file to be processed and finds that it contains a worksheet named "Cost Summary Table". The system queries the preset cost estimation software data format feature library and finds that the feature template of software A records a standard worksheet name "Engineering Cost Summary Table". The system calculates the similarity between "Cost Summary Table" and "Engineering Cost Summary Table" using a similarity algorithm (such as edit distance or cosine similarity). Since the two are highly similar, the system determines that the worksheet name matching degree is 0.9.
[0123] Furthermore, when the worksheet name of the file to be processed matches the standard worksheet name, the content of cell A1 of the worksheet is read and verified, and compared with the standard text of cell A1 of the corresponding template in the preset cost software data format feature library; when the comparison is consistent, the confidence level is increased based on the preset incremental rule, for example, the confidence level is increased by 0.05.
[0124] Furthermore, the number of header rows and fixed column position features of the worksheet are extracted and compared with the header structure features of the corresponding template in the preset cost software data format feature library; for example, the fixed column position features include the project or cost name column being located in column A.
[0125] For example, when the worksheet name meets the preset similarity condition with "Hub Construction Cost Table", and the header fields contain elements such as project name, unit, quantity, and unit price, the header structure feature formed by combining the header fields is matched with the header structure feature corresponding to the bill of quantities item in the preset cost software data format feature library; when the match is successful, the worksheet is determined to belong to the "2-Bill of Quantities Item" category, or the "2-Bill of Quantities Item" category is taken as the preferred candidate result.
[0126] In one possible implementation, when a structural feature fails to match or the corresponding confidence level is below a threshold (e.g., confidence level less than 0.7), content feature analysis is performed, and candidate categories are determined by combining the encoding logic in the preset cost software data format feature library.
[0127] a) Extract keywords from the worksheet name, cell A1 text, and header fields, and determine candidate categories based on the association between the keywords and preset categories. For example, when extracting "investment" or "total percentage," select "1-Total Investment" as a candidate category; when extracting "bill of quantities" or "quantity," select "2-Quantity List Items" as a candidate category; when extracting "materials" or "parameters," select "3-Basic Information" as a candidate category. For instance, if the worksheet name contains "material price list," extract the keywords related to "materials" and match them with the features corresponding to "basic information" in the rule base, selecting "3-Basic Information" as a preliminary candidate category.
[0128] b) Core Field Content Matching. Identify the core fields in the table header and perform statistical analysis on the typical values of the columns corresponding to these core fields. When the value format meets the preset coding rules, candidate categories are deduced based on the category coding rules in the preset cost software data format feature library. For example, if the table header contains a project code field, and multiple records in the column corresponding to this field meet the coding format starting with 1, then "1-Total Investment" is selected as the preferred candidate category; if the coding format meets the rule of starting with 2 or 3, then "2-Bill of Quantities Item" or "3-Basic Information" are selected as candidate categories respectively.
[0129] In one possible implementation, the method of identifying the matching degree of the table header structure based on the table header structure may also include the following steps:
[0130] (1) Header extraction and feature generation: Locate the first / multiple-line composite header and extract the first or multiple-line composite header of the Sheet. Combine the header cell text into a "feature string" or "feature vector". Match this vector with the standard header structures of various software and table types pre-stored in the feature library. Convert the header text into a TF-IDF (Term Frequency – Inverse Document Frequency) vector to obtain the header text vector; convert the standard header template in the feature library into a TF-IDF vector to obtain the standard header template vector; calculate the cosine similarity between the header text vector and the standard header template vector to determine the header structure matching degree. For headers with relatively fixed field order, extract the header field sequence and compare it with the edit distance of the standard field sequence in the feature library, and determine the header structure matching degree based on the sequence consistency rate; when the sequence consistency rate reaches the preset threshold, the header structure is considered to be successfully matched.
[0131] Step S1023: Based on the weighted processing of worksheet name matching degree and header structure matching degree, determine the file structure matching confidence degree. The file structure matching confidence degree can represent the confidence score obtained after weighted calculation of the worksheet name matching result and the header structure matching result. This confidence score is used to characterize the reliability of the data format template recognition result of the cost document to be processed.
[0132] The method for determining the encoding of hydropower project cost data provided in this application uses two independent quantitative indicators, worksheet name matching degree and header structure matching degree, to authenticate files from two key dimensions: file tags and data structure, respectively, avoiding the risk of misjudgment based on a single feature. Then, through weighted processing, the two are merged into a unified file structure matching confidence score. The file structure matching confidence score enables the system to make intelligent judgments, thereby improving processing efficiency while greatly ensuring the accuracy of the recognition results.
[0133] In one possible implementation, step S103 above, based on the location information and business type of the key data columns, utilizes a preset encoding rule base to construct structured semantic path information, specifically including:
[0134] Step S1031 involves data cleaning and Chinese word segmentation of the natural language text in the key data columns to obtain the segmentation results. Data cleaning removes meaningless symbols, spaces, ordinal numbers, and other noise from the text, thus standardizing it. Chinese word segmentation breaks down continuous Chinese sentences into independent, meaningful word units. This process can utilize domain-specific dictionaries (such as a hydraulic engineering dictionary) to ensure that proper nouns (such as "construction and transportation engineering") are correctly identified as a single unit.
[0135] Specifically, after identifying the key data columns, the natural language text within these columns can be cleaned and segmented into Chinese words to obtain the segmentation results. For example, if the key data column contains "hub project - construction traffic engineering - highway engineering", the cleaned content could be "hub project - construction traffic engineering - highway engineering", and the segmented content could be
"hub project", "construction traffic engineering", "highway engineering"
[0136] Step S1032 involves matching and verifying the word segmentation results against standard item names belonging to the business type in the preset encoding rule library to obtain the matching verification results. Specifically, for each word segmentation entry, a query is performed in the item encoding mapping table (Rule_Item_Map) of the encoding rule library. The query conditions include item name and business type constraints. The parent-child relationship between adjacent words is verified. For example, it verifies whether the parent of "construction traffic engineering" is "hub engineering".
[0137] Step S1033: Based on the matching verification results, construct structured semantic path information.
[0138] Specifically, the business type name (e.g., "Total Investment") is used as the root node of the path. Standard project names are appended to the path sequentially according to the order of successful matching verification, forming a hierarchical structure. The constructed path is stored as a structured data format, such as a list or a JSON (JavaScript Object Notation) object, for use in subsequent steps. For example, based on the sequence of successfully matched standard project names and their hierarchical relationship, structured semantic path information is constructed. Specifically, using the project name "Total Investment" corresponding to the business type as the root node, the hub project, construction traffic project, and highway project are added to this root node sequentially according to the order of successful matching verification to obtain structured semantic path information ["Total Investment", "Hub Project", "Construction Traffic Project", "Highway Project"].
[0139] The method for determining the encoding of hydropower engineering cost data provided in this application transforms messy and non-standard raw text into clean and discrete lexical units through data cleaning and Chinese word segmentation. This solves the ambiguity and unstructured nature of natural language, providing qualified input for subsequent accurate matching. Then, through matching verification under business type constraints, the word segmentation results are compared with an authoritative encoding rule base. This not only ensures the industry standardization of the terminology used but also significantly improves the efficiency and accuracy of matching through the filtering effect of business types, avoiding blind searching in the entire database. Finally, based on the verification results, a structured semantic path is constructed, connecting discrete matching points into a complete path with a clear hierarchical relationship, fundamentally guaranteeing the consistency of semantic understanding and the accuracy of the encoding results.
[0140] In one possible implementation, the cell content information includes natural language text, and the step S103 above, determining the confidence level of the cell content information, includes:
[0141] Step S1034: Determine the basic confidence level of the engineering entity based on the number of successful matching verifications of the word segmentation results in the preset encoding rule base. The basic confidence level of the engineering entity represents the confidence level calculated based on the number of successful matching verifications of the word segmentation results in the encoding rule base, reflecting the degree of matching between the engineering entity and the standard project name in the word segmentation results.
[0142] Specifically, for each word in the segmentation result, a query is performed in the item encoding mapping table of the encoding rule base to verify whether it is a standard item name. The number of successful queries is counted. For example, if the segmentation result has 4 words, and 3 of them match successfully in the rule base, the number of successful queries is 3.
[0143] The basic confidence score of the engineering entity is calculated as: number of successful match verifications / total number of word segmentation results. For example, the word segmentation results are
“hub project”, “construction traffic engineering”, “newly built”, “highway engineering”
[0144] Step S1035: Based on the hierarchical relationship verification results between engineering entities in the semantic path information, determine the hierarchical relationship confidence level. Hierarchical relationship verification can refer to checking whether two adjacent engineering entities in the semantic path satisfy a preset parent-child entity correspondence relationship in the encoding rule base. The hierarchical relationship confidence level can be represented by the confidence level calculated based on the hierarchical relationship verification results of each adjacent engineering entity in the semantic path, used to characterize the consistency of the hierarchical relationships in the semantic path.
[0145] Specifically, the relationship between each pair of adjacent entities (parent and child) in the semantic path is checked sequentially. For example, it verifies whether the parent of "Construction Traffic Engineering" is "Hub Project"; and verifies whether the parent of "Highway Engineering" is "Construction Traffic Engineering".
[0146] The confidence score of hierarchical relationships is determined using a pre-defined formula. The confidence score is the ratio of the number of successfully verified hierarchical relationships to the total path length minus one. For example, given a semantic path of ["Total Investment Items", "Hub Project", "Construction and Transportation Engineering", "Highway Engineering"], with a total path length of 4, hierarchical relationship verification is required for 3 pairs of adjacent entities. Verification shows that the three pairs of adjacent entities—"Total Investment Items" and "Hub Project", "Hub Project" and "Construction and Transportation Engineering", and "Construction and Transportation Engineering" and "Highway Engineering"—all satisfy a parent-child hierarchical relationship. The number of successfully verified hierarchical relationships is 3, therefore the confidence score is 3 / 3, or 1.0.
[0147] Step S1036: Determine the confidence level of the cell content information based on the product of the basic confidence level of the engineering entity and the confidence level of the hierarchical relationship. Specifically, after determining the basic confidence level of the engineering entity and the confidence level of the hierarchical relationship, the basic confidence level of the engineering entity and the confidence level of the hierarchical relationship can be multiplied to obtain the confidence level of the cell content information.
[0148] In one possible implementation, step S105 may further include:
[0149] Step S1051: Based on the entity hierarchy order in the semantic path information, a preset encoding rule base is queried sequentially to determine the encoding corresponding to each level. The entity hierarchy order indicates the order in which entities are arranged from major category to minor category in the semantic path. Specifically, the query starts from the first entity in the semantic path. Each entity is queried sequentially according to the path order, and each query strictly limits its parent-level encoding fields to ensure the correctness of the hierarchy. A parameterized SQL query is executed in the item encoding mapping table (Rule_Item_Map).
[0150] For example: semantic path information = ["total investment", "hub project", "construction and traffic engineering", "highway project"].
[0151] Query process: Query 1 (root node):
[0152] SQL: SELECT Big_Code FROM Rule_Item_Map WHERE Item_Name='Total Investment Items' AND Big_Code IS NOT NULL LIMIT 1, returns code 1.
[0153] Query 2 (Second Level): SQL: SELECT Middle_Code FROM Rule_Item_Map WHERE Item_Name='Hub Project' AND Big_Code='1' AND Middle_Code IS NOT NULL LIMIT 1; (The major category code must be 1), resulting in code 01.
[0154] Query 3 (Third Level): SQL: SELECT Small_Code FROM Rule_Item_Map WHERE Item_Name='Construction and Traffic Engineering' AND Big_Code='1' AND Middle_Code='01' AND Small_Code ISNOT NULL LIMIT 1; (The large category code must be 1 and the middle category code must be 01), resulting in code 01.
[0155] Query 4 (Fourth Level): SQL: SELECT Sub_Code FROM Rule_Item_Map WHERE Item_Name='Highway Engineering' AND Big_Code='1' AND Middle_Code='01' AND Small_Code='01' AND Sub_Code IS NOT NULL LIMIT 1; (The major category code must be 1, the middle category code must be 01, and the minor category code must be 01), resulting in code 001.
[0156] Step S1052: Combine the codes according to the hierarchical order to obtain the data codes corresponding to the cost document data to be processed.
[0157] Specifically, obtain the code returned by the final query (the finest granularity). Use this code as the final unified data code for this project record.
[0158] As an application example, the query yields the following coding sequence: 1 (Total Investment) - 01 (Hydropower Project) - 01 (Construction and Traffic Engineering) - 001 (Highway Engineering). Combining these sequences hierarchically results in the code 10101001, which is then used as the final output. Simultaneously, the system recognizes from the rule base that the standard project name corresponding to code 10101001 is "Highway Engineering".
[0159] The method for determining the cost data encoding of hydropower projects provided in this application embodiment is based on the hierarchical order of entities in semantic path information. By sequentially querying a preset encoding rule library, the standard encoding corresponding to each entity node in the path is determined. Then, by combining the encodings according to the hierarchical order, the final data encoding is generated, enabling the computer to directly identify the macro-classification and specific location of the project based on the encoding, thereby improving the accuracy of data encoding determination.
[0160] In one possible implementation, the method for determining the above-mentioned hydropower project cost data coding may further include:
[0161] Step S201: When the target matching degree is less than or equal to the matching degree threshold, the semantic path information is output as the recommendation result. The matching degree threshold is a pre-set comparison benchmark used to determine whether the target matching degree meets the conditions for automatic data encoding. In some implementations, the matching degree threshold includes a high threshold and a medium threshold. The system compares the calculated target matching degree with the matching degree threshold. When the target matching degree is less than or equal to the matching degree threshold, automatic encoding is not performed; instead, the semantic path information is organized into a recommendation result to be confirmed and output. For example, if the target matching degree is 0.65 and the medium threshold is 0.7, and the target matching degree is less than or equal to the medium threshold, the system outputs the recommendation result corresponding to the semantic path information, awaiting user confirmation or correction. Furthermore, the system generates a clear prompt message in the interactive interface, which may include:
[0162] (1) Identified semantic path. The semantic path may include: total investment - hub project - construction traffic project - highway project.
[0163] (2) Matching degree description: The confidence level is low. Please confirm.
[0164] (3) Provide "Confirm" and "Correct" buttons for human-computer interaction.
[0165] In one embodiment, the system processes records with the project name "Hub Project - Construction Traffic - Access Road". Based on word segmentation results, the system identifies the standard project names corresponding to "Hub Project" and "Construction Traffic" and performs corresponding hierarchical relationship matching verification. Because "Access Road" does not completely match the standard project names in the coding rule base, the confidence level of the cell content information decreases, causing the target matching degree to drop to 0.65. At this point, the system outputs "Total Investment - Hub Project - Construction Traffic - Access Road" as the recommended result and displays the recommended result and corresponding target matching degree information on the interactive interface for user confirmation or correction.
[0166] Step S202: In response to the confirmation instruction for the output recommendation result, determine the data code corresponding to the cost document data to be processed.
[0167] Specifically, the system frontend listens for user click events and sends a "confirm" command to the backend. Upon receiving the confirmation command, the system backend does not re-identify but directly trusts and adopts the semantic path information recommended in step S201. The system then proceeds to step S105, where, based on the recommended semantic path information, it queries the coding rule base to generate the final data code. This maps ["Total Investment Item", "Hydraulic Project", "Construction Traffic", "Access Roads"] to a code, such as 10101099. The generated code is then written to the target location.
[0168] The method for determining the encoding of hydropower project cost data provided in this application embodiment makes intelligent judgments through a preset matching degree threshold. When the target matching degree self-assessed by the system is low, it does not forcibly execute automated operations that may have risks. Instead, it actively outputs the semantic path information generated internally as a recommendation result to the user. In response to the user's confirmation instruction on the recommendation result, the final encoding determination operation is then executed, which improves the user experience.
[0169] In one possible implementation, the method for determining the aforementioned hydropower project cost data encoding may further include: generating a correction sample corresponding to the data encoding in response to a correction instruction for the data encoding. The correction instruction may represent an instruction triggered when a user modifies the system-generated data encoding through a system interface, such as an instruction submitted after the user selects the target data encoding from a drop-down menu. The correction sample may represent a sample record generated based on the correction instruction, which includes the original data feature information corresponding to the record to be corrected, the system-output data encoding to be corrected and related intermediate results, and the target data encoding confirmed by the user.
[0170] Specifically, when a user triggers a correction operation on the interactive interface, such as clicking the "Correct" button and selecting a target data code from the candidate list to replace the current data code (e.g., changing 10101001 to 10201001), the system receives the instruction information corresponding to the correction operation. In response to this instruction information, the system records the target data code confirmed by the user and simultaneously records the context information associated with this correction to generate a correction sample corresponding to that record. For example, the correction sample may include:
[0171] (1) The source data that caused the error, such as the original text of the cell “Immigrant resettlement fee”, the sheet name, the header structure, etc.
[0172] (2) System error output: The system originally generated the error code (10101001) and the error semantic path.
[0173] (3) User correct label: The correct code (10201001) selected by the user and its corresponding standard item name.
[0174] (4) Generate a sample: Package the above information into a structured "corrected sample" record and store it in a temporary sample library or message queue for subsequent processing.
[0175] Furthermore, based on the corrected samples, the preset coding rule library and / or the preset cost estimation software data format feature library are updated. Specifically, the system compares and analyzes the source data features in the corrected samples, the system output results, and the user confirmation results to determine the source of error, and performs the corresponding library update operation accordingly. For example, this may include the following two scenarios:
[0176] Case A: The error originates from the coding rule base. The corrected sample indicates a stable correspondence between "immigrant resettlement fee" and the user-confirmed target data code 10201001. However, the coding rule base does not establish a mapping relationship between this keyword and the target data code, or the weight of this mapping relationship is lower than the mapping relationship corresponding to the erroneous data code 10101001. Based on this, the system adds "immigrant resettlement fee" as a new keyword to the coding rule base and establishes a mapping relationship with the target data code 10201001, or increases the weight parameter of the existing mapping relationship to improve the matching priority of subsequent similar texts.
[0177] Case B: The error originated from the data format feature library. The corrected sample reflected the worksheet name and header structure characteristics of the current file, which had a high match with the "Total Investment Item" template in the feature library. This caused the system to identify the file as belonging to the "Total Investment Item" template and generate an incorrect encoding result, thus triggering the selection of the encoding path or business type associated with that template. However, the user confirmed that the result corresponded to the encoding system of "Construction Land Acquisition and Resettlement Compensation". Based on this, the system adjusted the weight of the template feature that caused the misjudgment, reducing its matching weight under the feature combination of this type of file. Furthermore, the system marked the corrected sample as a sample to be reviewed, allowing the administrator to supplement or add feature templates associated with "Construction Land Acquisition and Resettlement Compensation" after review, in order to improve the mapping relationship of the data format feature library.
[0178] The method for determining the code of hydropower engineering cost data provided in this application embodiment generates a correction sample corresponding to the data code in response to a correction instruction for the data code. Based on the correction sample, the preset coding rule library and / or cost software data format feature library are updated. The system can intelligently analyze the root cause of the error. If the rule library lacks keyword mapping, the keyword library is automatically expanded. If the weight allocation of the feature library is unreasonable, the confidence weight is dynamically adjusted, and even new feature templates are added. As the usage time goes by, the system accumulates more and more correction samples, and its rule library and feature library are continuously enriched and optimized. The recognition accuracy continues to improve, and the need for manual intervention gradually decreases, thereby minimizing labor costs while ensuring processing quality.
[0179] In one possible implementation, the method for determining the above-mentioned hydropower project cost data coding may further include:
[0180] Step S401: Obtain update information of the cost estimation software and update the preset cost estimation software data format feature library based on the update information.
[0181] The update information for the cost estimation software can refer to version update logs, patch notes, and descriptions of changes to the data export format. Specifically, the system periodically and automatically retrieves update logs from the cost estimation software's website, API, or documentation library. NLP (Natural Language Processing) technology is used to analyze the update documents, extracting descriptions of changes related to data export, report formats, sheet naming, and header structure. Based on the analysis results, corresponding feature templates are automatically generated or adjusted, and their status is marked as "pending review." After administrator approval, the feature library is updated.
[0182] Step S402: Receive new format samples uploaded by users and update the preset cost software data format feature library based on the new format samples.
[0183] The user-uploaded new format sample indicates an unknown data file that the user actively uploads when encountering software or formats that the system cannot recognize. Specifically, the user uploads an unrecognizable file through the system interface. The system automatically analyzes the file's macro-level characteristics, such as the sheet name, header structure, and A1 cell content. It then prompts the user to specify the correct software name and business type for this new format, and generates a new feature template with a status of "Pending Review." After administrator review, it is added to the feature library.
[0184] Step S403: When the data encoding corresponding to the target matching degree is inconsistent with the correction encoding input by the user, record the feature information of the new format sample and the correction encoding of the corrected sample.
[0185] The data code corresponding to the target matching degree can represent the data code of the cost document data to be processed, determined by the system based on the target matching degree. The correction code input by the user can represent the corrected data code input by the user for this data code. The correction sample can represent the sample record generated when the data code corresponding to the target matching degree is inconsistent with the correction code input by the user. The correction sample contains feature information used to characterize the recognition context and data code information confirmed by the user. Specifically, when the data code corresponding to the target matching degree is inconsistent with the correction code input by the user, the system obtains the file feature information corresponding to this inconsistency and associates and stores the file feature information with the correction code input by the user to generate a correction sample. The file feature information includes at least the worksheet name and header structure, and may also include the position of key data columns, file structure matching confidence, semantic path information, and target matching degree, etc. For example, the system writes the worksheet name, header structure, system-generated original data code, and user-input correction code into the same correction sample record, and stores the correction sample record in the sample library or the queue to be processed for subsequent updates to the cost software data format feature library or encoding rule library.
[0186] Step S404: If the similarity between the feature information of the corrected sample and any feature template in the preset cost software data format feature library is less than a first threshold, the corrected sample is marked as a new format sample to be reviewed, and in response to the addition instruction for the new format sample to be reviewed, the preset cost software data format feature library is updated.
[0187] A similarity score less than a first threshold indicates a low degree of matching between the corrected sample's feature information and the feature templates in the preset cost software data format feature library. A new format sample awaiting review can be identified as a sample marked for manual review due to a similarity score less than the first threshold. Specifically, the system calculates the similarity between the corrected sample's feature information and each feature template in the preset cost software data format feature library, obtaining the maximum similarity. When the maximum similarity is less than the first threshold, the corrected sample is marked as a new format sample awaiting review and written into the new format review area or review queue. In response to an add instruction for a new format sample awaiting review, a new feature template is generated based on the feature information of the new format sample and written into the preset cost software data format feature library. For example, cosine similarity is used for similarity calculation, and the first threshold is 0.3.
[0188] Step S405: If the similarity between the feature information of the corrected sample and the feature template in the preset cost software data format feature library is greater than the second threshold, and the data encoding is inconsistent with the correction encoding, then the confidence weight of the feature template is adjusted.
[0189] The second threshold can be a preset threshold used to determine whether a corrected sample is highly similar to an existing feature template. The confidence weight of a feature template can be a weight parameter of that feature template in file structure matching, used to influence the proportion of that feature template in template matching scoring. In this step, when the similarity between the feature information of the corrected sample and at least one feature template in the preset cost software data format feature library is greater than the second threshold, and the data encoding corresponding to the target matching degree is inconsistent with the correction encoding input by the user, the system determines the target feature template with the highest similarity to the corrected sample and lowers the confidence weight of the target feature template. For example, the system calculates the similarity between the corrected sample and each feature template in the feature library, selects the feature template with the highest similarity as the target feature template, and when the maximum similarity is greater than the second threshold, it is determined that the corrected sample and the target feature template belong to the same type of file structure feature; if the data encoding is still inconsistent with the correction encoding under this condition, the system updates the confidence weight of the target feature template, reducing the scoring contribution of the target feature template in subsequent matching. Furthermore, the update rule for the confidence weight may include attenuating the original weight according to a preset scaling factor. For example, the confidence weight of the target feature template may be updated to the product of the original weight and the preset attenuation coefficient, thereby reducing the priority of the target feature template in subsequent template matching.
[0190] In one possible implementation, refer to Figure 4 As shown, Figure 4 This diagram illustrates the structure of the system for determining the cost data encoding of hydropower projects provided in an embodiment of this application.
[0191] Combination Figure 4 As shown, the system for determining the coding of hydropower project cost data may include: a rule management module, a data import and recognition module, a data parsing and cleaning module, an automatic coding module, a result output and storage module, and a user interaction module.
[0192] Specifically, the rule management module is used to maintain the "encoding rule library" and the "cost software data format feature library", supporting users to view and edit rules, and upload new software samples to update the feature library.
[0193] The data import and recognition module provides local file import and software interface integration functions, and completes data format recognition and software type determination.
[0194] The data parsing and cleaning module is used to implement field mapping, handle abnormal data, and output cost data in a standard format.
[0195] The automatic encoding module includes hierarchical code matching, code combination, and verification functions to generate unified codes.
[0196] The results output and storage module supports multi-format output, stores encoded data in a unified database, and provides retrieval and reuse functions.
[0197] The user interaction module provides a visual interface for users to upload data, view encoding results, and manually supplement feature information.
[0198] Furthermore, the automatic coding module can determine the major category and subsequent hierarchical coding of the target worksheet based on the data format feature library and coding rule library of the cost estimation software, using a combination of worksheet-level recognition and cell-level verification. The specific implementation logic may include the following:
[0199] In the precise matching phase, the auto-encoding module obtains the worksheet name of the target worksheet and compares it with the worksheet naming rules recorded in the cost estimation software's data format feature library. When the worksheet name meets the matching conditions corresponding to the naming rule, the auto-encoding module determines the table type identifier and its category for that worksheet, and uses the confidence weight corresponding to that naming rule in the feature library as the initial confidence level. For example, when the worksheet name is "Total Project Cost Table" and is consistent with the standard table name in Software A's feature library, the auto-encoding module marks the worksheet as "Total Investment Items - General Table Type" and sets the initial confidence level to 0.95.
[0200] If the worksheet name matches successfully, the autoencoding module further reads the content of the cell at the preset location and performs a consistency check. For example, the autoencoding module reads the text in cell A1 and compares it with the standard text in cell A1 corresponding to this table type in the feature library; when the comparison result meets the consistency condition, the autoencoding module increases the initial confidence level based on preset enhancement rules to enhance the credibility of the table type identification result.
[0201] After verifying the worksheet name against the preset cell location, the auto-encoding module extracts the structural features of the worksheet and performs a structural comparison. Structural features may include the number of header rows, single-level or multi-level header format, fixed column positions, and column numbers of key fields. For example, the auto-encoding module determines that the "Project or Cost Name" field is located in column A and matches the position of this field and the header structure with the header structure features of the corresponding table type in the feature library. When the structural matching result meets preset conditions, the auto-encoding module confirms the aforementioned identification result or further increases the confidence level.
[0202] When an exact match fails, or the structural comparison result results in a confidence level below a preset threshold, the auto-coding module enters the fuzzy matching stage. In the fuzzy matching stage, the auto-coding module extracts keywords from the worksheet name, cell text at preset locations, and header field text, and determines candidate categories based on the category features associated with the keywords in the coding rule base. For example, when the worksheet name contains "material price list" and the keyword extraction result contains "material," the auto-coding module retrieves the keyword features corresponding to "basic information" from the coding rule base and forms a preliminary labeling result with candidate category 3.
[0203] During the fuzzy matching phase, the auto-coding module can also perform reverse validation based on the encoding patterns of the core fields in the table header and the data samples. For example, the auto-coding module detects whether the table header contains core fields such as "Project Code" or "Expense Name", and statistically analyzes the distribution of encoding prefixes in the data area corresponding to the field column; when a large number of encoding patterns starting with "1" appear in the samples, the auto-coding module increases the priority of candidates belonging to the "Total Investment Items" category in the worksheet.
[0204] After the candidate results are generated, the auto-coding module can match the core words obtained by splitting the worksheet name with the keyword set in the coding rule base, and accumulate the keyword matching score according to the hit weight of each keyword, which serves as an auxiliary basis for confirming the candidate category. For example, when the worksheet name is "Construction Engineering Cost Sheet", the auto-coding module extracts "construction" and "engineering" and accumulates their weights to help confirm the target category.
[0205] Furthermore, the autoencoding module can also perform pattern recognition based on the table header structure. The autoencoding module locates the row containing the table header and extracts the text content of single-level or multi-level headers. It combines the header text into structured header features and performs similarity matching or sequence consistency matching with pre-stored standard header structures in the feature library to obtain the header matching degree. Based on this, it corrects or confirms the worksheet-level recognition results. For example, when the worksheet name lacks usable semantic information but the header contains a combination of fields such as "Project Name" and "Construction Cost," the autoencoding module determines the worksheet as "Total Investment Items - Total Construction Cost Table" based on the header matching result.
[0206] After worksheet-level recognition is completed, the autocoding module locates key data areas based on the header recognition results and extracts the first N rows of data from the key columns as analysis samples. Cell-level recognition is then performed to verify and refine the worksheet-level recognition results. During cell-level recognition, the autocoding module cleanses and standardizes the sample cell text, performs word segmentation and stop word filtering, and matches the segmentation results with the keyword library in the encoding rule base to obtain the cell content matching degree. Simultaneously, it generates recognition results for engineering entities, cost entities, or material entities. Based on this, the autocoding module strengthens or corrects candidate categories based on synonym expansion and concept hierarchy judgment to output supporting evidence or correction suggestions for the worksheet-level recognition results.
[0207] The auto-coding module calculates the target match score by combining the worksheet name match score, header match score, and cell content match score, and determines the coding allocation strategy accordingly. When the target match score exceeds a high threshold, the auto-coding module directly determines the target code and executes automatic writing; when the target match score is between the medium and high thresholds, the auto-coding module outputs a recommended result and receives confirmation through the user interaction module; when the target match score is below the medium threshold, the auto-coding module outputs an unrecognizable mark and triggers a manual processing flow.
[0208] After determining the target code, the automatic coding module retrieves and combines the target level codes level by level according to the hierarchical order defined by the coding rule base, and writes the target level codes into the preset output position of the target worksheet. For example, the automatic coding module adds a unified cost code column to the target worksheet, fills the records corresponding to the project data rows with the target codes, and leaves blank rows, total rows and remarks rows empty or empty to maintain the stability of the original data structure and reduce interference from invalid codes.
[0209] Compared to related technologies, this invention identifies and matches worksheet names, header structures, and key cell content using a data format feature library for cost estimation software. It then automatically determines and writes data codes using semantic parsing and a coding rule library. Simultaneously, it verifies the number of bits, value range, and hierarchical relationships in the codes and outputs anomalies for review. This reduces the amount of manual table-by-table identification, field mapping, and code rewriting, shortening the processing cycle for cost estimates of large and medium-sized hydropower projects and supporting batch processing of multiple software files. Based on unified code output and storage, it achieves consistent data expression and query reuse across software and projects. Through mechanisms such as correcting sample records, adding feature templates, or adjusting confidence weights, it adapts to changes in software formats or versions and allows for maintaining the coding rule library according to enterprise needs to meet personalized coding requirements.
[0210] This embodiment also provides a device for determining the code of hydropower project cost data. This device is used to implement the above embodiments and preferred embodiments, and will not be repeated as already described. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0211] This embodiment provides a device for determining the encoding of hydropower project cost data, such as... Figure 5 As shown, the system includes: an acquisition module 501 for acquiring cost document data to be processed; a first determination module 502 for determining the business type and key data column location information of the cost document data to be processed by matching it with a preset cost software data format feature library based on the structural features of the cost document data to be processed, and determining the file structure matching confidence level based on the structural features, including worksheet name and header structure; a second determination module 503 for constructing structured semantic path information based on the location information of key data columns and business type, using a preset encoding rule library, and determining the confidence level of cell content information; the semantic path information is used to determine cell content; a third determination module 504 for determining the target matching degree based on the file structure matching confidence level and the confidence level of cell content information; and a fourth determination module 505 for determining the data encoding corresponding to the cost document data to be processed based on the semantic path information and the preset encoding rule library when the target matching degree is greater than the matching degree threshold.
[0212] Further functional descriptions of the various modules and units described above are the same as those in the corresponding embodiments described above, and will not be repeated here. In this embodiment, the device for determining the hydropower project cost data encoding is presented in the form of functional units. Here, a functional unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0213] This application also provides a computer device, which has the above-described features. Figure 5 The device shown is for determining the code of hydropower project cost data.
[0214] Please see Figure 6 , Figure 6 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of this application, such as... Figure 6As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including executing instructions stored in memory and executing instructions for displaying graphical information for a graphical user interface on an external input / output device. In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 6 Take a processor 10 as an example.
[0215] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.
[0216] The memory 20 stores instructions executable by at least one processor 10 to cause at least one processor 10 to perform the method shown in the above embodiments.
[0217] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0218] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0219] The computer device also includes an input device 30 and an output device 40. The processor 10, memory 20, input device 30, and output device 40 can be connected via a bus or other means. Figure 6 Taking the example of a connection between China and Israel via a bus.
[0220] Input device 30 can receive input numerical or character information, and generate key signal inputs related to user settings and function control of the computer device, such as a touchscreen, keypad, mouse, trackpad, touchpad, joystick, one or more mouse buttons, trackball, joystick, etc. Output device 40 may include display devices, auxiliary lighting devices (e.g., LEDs), and haptic feedback devices (e.g., vibration motors). The aforementioned display devices include, but are not limited to, liquid crystal displays, light-emitting diodes, displays, and plasma displays. In some alternative embodiments, the display device may be a touchscreen.
[0221] The computer device also includes a communication interface for communicating with other devices or communication networks.
[0222] This application also provides a computer-readable storage medium. The methods described in this application can be implemented in hardware or firmware, or implemented as recordable on a storage medium, or implemented as computer code downloaded over a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and subsequently stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the methods shown in the above embodiments are implemented.
[0223] A portion of this application can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to this application through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.
[0224] Although embodiments of this application have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of this application, and all such modifications and variations fall within the scope defined by the appended claims.
Claims
1. A method for determining the coding of hydropower project cost data, characterized in that, The method includes: Obtain the data of the cost document to be processed; Based on the structural characteristics of the cost document data to be processed, a preset cost software data format feature library is used for matching to determine the business type and key data column location information of the cost document data to be processed, and based on the structural characteristics, the file structure matching confidence is determined. The structural characteristics include worksheet name and table header structure. Based on the location information of the key data columns and the business type, a structured semantic path information is constructed using a preset encoding rule library, and the confidence level of cell content information is determined; the semantic path information is used to determine the cell content. The target matching degree is determined based on the confidence score of the file structure matching and the confidence score of the cell content information; When the target matching degree is greater than the matching degree threshold, the data encoding corresponding to the cost document data to be processed is determined based on the semantic path information and the preset encoding rule library. Based on the location information of the key data columns and the business type, structured semantic path information is constructed using a preset encoding rule base, including: Data cleaning and Chinese word segmentation are performed on the natural language text in the key data columns to obtain the word segmentation results; The word segmentation results are matched and verified with the standard project names belonging to the business type in the preset encoding rule library to obtain the matching verification results; Based on the matching and verification results, construct structured semantic path information; The cell content information includes natural language text, and determining the confidence level of the cell content information includes: Based on the number of successful matching verifications of the word segmentation results in the preset encoding rule base, the basic confidence level of the engineering entity is determined. Based on the verification results of the hierarchical relationship between engineering entities in the semantic path information, the confidence level of the hierarchical relationship is determined; The confidence level of the cell content information is determined by multiplying the basic confidence level of the engineering entity and the confidence level of the hierarchical relationship.
2. The method for determining the coding of hydropower project cost data according to claim 1, characterized in that, Based on structural features, the confidence level of file structure matching is determined, including: The matching degree of the worksheet name is determined based on the matching results between the worksheet name and the preset cost software data format feature library. Based on the matching results between the header structure and the preset cost software data format feature library, the header structure matching degree is determined. The file structure matching confidence level is determined by weighting the matching degree of the worksheet name and the matching degree of the table header structure.
3. The method for determining the coding of hydropower project cost data according to claim 1, characterized in that, Based on the semantic path information and the preset encoding rule base, the data encoding corresponding to the cost document data to be processed is determined, including: Based on the entity hierarchy order in the semantic path information, the preset encoding rule library is queried sequentially to determine the encoding corresponding to each level. The codes are combined in hierarchical order to obtain the data codes corresponding to the cost document data to be processed.
4. The method for determining the coding of hydropower project cost data according to claim 1, characterized in that, The method further includes: When the target matching degree is less than or equal to the matching degree threshold, the semantic path information is output as the recommendation result; In response to the confirmation instruction for the output recommendation result, the data encoding corresponding to the cost document data to be processed is determined.
5. The method for determining the coding of hydropower project cost data according to claim 1, characterized in that, The method further includes: In response to the correction instruction for the data encoding, a correction sample corresponding to the data encoding is generated; Based on the corrected sample, update the preset encoding rule library and / or the preset cost estimation software data format feature library.
6. The method for determining the coding of hydropower project cost data according to claim 1, characterized in that, The method further includes: Obtain update information for the cost estimation software, and update the preset cost estimation software data format feature library based on the update information; and / or, Receive new format samples uploaded by users, and update the preset cost estimation software data format feature library based on the new format samples; and / or, When the data encoding corresponding to the target matching degree is inconsistent with the corrected encoding input by the user, the feature information of the new format sample and the corrected sample containing the corrected encoding are recorded. If the similarity between the feature information of the corrected sample and any feature template in the preset cost software data format feature library is less than a first threshold, the corrected sample is marked as a new format sample to be reviewed, and in response to the addition instruction for the new format sample to be reviewed, the preset cost software data format feature library is updated. If the similarity between the feature information of the corrected sample and the feature template in the preset cost software data format feature library is greater than the second threshold, and the data encoding is inconsistent with the correction encoding, then the confidence weight of the feature template is adjusted.
7. The method for determining the coding of hydropower project cost data according to claim 1, characterized in that, The preset encoding rule base includes: a hierarchical base table, a hierarchical relationship table, and a project encoding mapping table; wherein, the hierarchical base table stores the basic attributes of each level's encoding; the hierarchical relationship table defines the dependency logic between levels; and the project encoding mapping table associates project names with each level's encoding.
8. A device for determining the code of hydropower project cost data, characterized in that, The device includes: The acquisition module is used to acquire the cost document data to be processed; The first determining module is used to determine the business type and key data column location information of the cost document data to be processed by matching it with a preset cost software data format feature library based on the structural features of the cost document data to be processed, and to determine the file structure matching confidence based on the structural features, wherein the structural features include worksheet name and table header structure. The second determining module is used to construct structured semantic path information and determine the confidence level of cell content information based on the location information of the key data column and the business type, using a preset encoding rule library; the semantic path information is used to determine the cell content. The third determining module is used to determine the target matching degree based on the confidence degree of the file structure matching and the confidence degree of the cell content information; The fourth determining module is used to determine the data encoding corresponding to the cost document data to be processed based on the semantic path information and the preset encoding rule library when the target matching degree is greater than the matching degree threshold. The second determining module is further configured to perform data cleaning and Chinese word segmentation on the natural language text in the key data column to obtain word segmentation results; match and verify the word segmentation results with the standard project names belonging to the business type in the preset encoding rule library to obtain matching verification results; and construct structured semantic path information based on the matching verification results. The second determining module is further configured to determine the basic confidence level of the engineering entity based on the number of successful matching verifications of the word segmentation results in the preset encoding rule library; determine the confidence level of the hierarchical relationship based on the verification results of the hierarchical relationship between engineering entities in the semantic path information; and determine the confidence level of the cell content information based on the product operation of the basic confidence level of the engineering entity and the confidence level of the hierarchical relationship.
Citation Information
Patent Citations
Electronic health record automatic coding method and system
CN120452649A
Header field intelligent benchmarking method, system and device based on semantic index segmentation
CN120910054A