A method and system for dynamic calculation of engineering cost based on semantic analysis

CN122674683BActive Publication Date: 2026-10-23CHINA CONSTR FIFTH ENG DIV CORP LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202611180616.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-08-05
Publication Date
2026-10-23
Estimated Expiration
2046-08-05

AI Technical Summary

Technical Problem

[0010]实现计价规范的动态语义解析与热更新:摆脱传统硬编码,实现从自然语言规范文件向结构化的可执行逻辑树的自动转换与版本化隔离存储,解决维护成本高、更新滞后的问题

Benefits of technology

[0026]1.大幅降低软件维护成本:当国家或地方收费规范发生频繁变更时,本发明仅需通过语义解析引擎更新外部规则元数据库,将传统的“代码重构级/系统重启级”维护,缩短至“数据加载级/零停机热更新”。这种“计算与规则解耦”的架构,极大提升了系统对不同地区标准的适配效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122674683B_ABST
    Figure CN122674683B_ABST
Patent Text Reader

Abstract

The application discloses a kind of engineering cost dynamic calculation method and system based on semantic analysis, the method includes S10: the engineering survey design of natural language description, supervision and so on charging specification is automatically converted into computer recognizable structured metadata;S20: carry out the efficient, accurate calculation of nonlinear subsection engineering cost, and implement boundary compliance audit;S30: provide digital audit evidence chain for each output cost;S40 protects sensitive data by data encryption and algorithm state isolation.The application can greatly reduce software maintenance cost, realize the "penetrating type" audit compliance in true sense and guarantee enterprise core competitiveness security.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of information technology for engineering cost, and in particular to a method and system for dynamic calculation of engineering cost based on semantic parsing. Background Technology

[0002] Engineering cost estimation is highly dependent on national and local cost estimation standards. Currently, most commonly used cost estimation tools in the industry are based on Excel or secondary development of commercial cost estimation software, and generally adopt a "hard-coded" approach to implement cost estimation logic. With frequent adjustments to regulations and policies, existing tools, due to the high coupling between calculation logic and program code, exhibit problems such as extremely high maintenance costs and lagging updates to cost estimation rules. In addition, engineering bidding audits require "traceability" for every expense, but the traditional tool's calculation process is "black box," making it difficult to provide a "chain of quantity verification documents" that meets audit requirements. Furthermore, core expense ratio coefficients (such as internal guidance indicators), as technical assets, lack effective encryption protection during the circulation of calculators, posing a risk of leakage.

[0003] Existing technologies primarily focus on automating quantity surveying for single projects, lacking systematic solutions for automatically translating complex pricing specifications, auditing and tracing pricing results, and protecting core indicators. The main limitations of existing technologies are as follows:

[0004] Post-audit technology based on static data comparison (represented by patent CN111476550B): This type of technology verifies drawings and lists through discrete form modules to achieve horizontal data aggregation. However, this solution is a post-audit static review, with the pricing logic fixed at the underlying level. When faced with non-linear rate specifications, the system cannot access the dynamic calculation process of the underlying engine, making it difficult to capture instantaneous memory states and logical routes. This results in insufficient audit penetration and an inability to handle common situations such as specification changes.

[0005] Cost calculation technology based on general business rule engines (represented by Chinese patent application CN106228354A): This type of technology uses an inference engine to decouple business logic from the application. However, since its general inference algorithm is mostly designed for linear or discrete scenarios, when faced with complex calculations unique to engineering cost, such as excess reduction, step-by-step abrupt changes, and linear interpolation, the depth of the logic tree expands exponentially, significantly reducing computational efficiency. Furthermore, it lacks native event tracking during runtime and cannot provide self-proving capabilities for the computational state.

[0006] Anti-tampering technologies based on result storage and digital signatures (represented by patent CN111159769B): This type of technology uses distributed ledgers to ensure the integrity of result documents. However, this solution is a static result-level anti-tampering method, treating the early calculation process as a black box. It can only guarantee that the final document has not been modified later, and cannot reverse analyze the memory state at the moment of amount generation. As a result, reviewers cannot know the regulatory units, environmental variables, and rate decomposition paths activated when the amount is generated.

[0007] In summary, while existing technologies have made progress in data verification, rule decoupling, and result preservation, they still lack an end-to-end, transparent digital quantity calculation certificate chain solution that can efficiently decouple complex pricing rules, dynamically capture memory audit nodes during computation execution, and implement strong hash binding between computation basis metadata and fee result identifiers. At the same time, there is also the risk of leakage of core technology assets. Summary of the Invention

[0008] (a) Technical problems to be solved

[0009] This invention aims to overcome the shortcomings of the prior art and provide a method and system for dynamic calculation of engineering costs based on semantic parsing. Specifically, the technical problems to be solved include:

[0010] Achieve dynamic semantic parsing and hot updating of pricing specifications: Get rid of traditional hard coding, realize automatic conversion and versioned isolated storage from natural language specification files to structured executable logic trees, and solve the problems of high maintenance costs and delayed updates.

[0011] Construct a full-chain "transparent" calculation audit traceability system: By dynamically constructing a chain of calculation vouchers, the calculation results of each cost item are hash-bound with the index of standard clauses, instantaneous variables, and fee parameters, solving the problems of "black box" calculation and lack of traceability, and meeting the requirements of penetrating bidding audit.

[0012] Ensuring the secure isolation of core enterprise experience indicators in the computing state: Constructing a layered encrypted storage and dynamic computing state isolation system to prevent sensitive enterprise experience coefficients from being illegally extracted during the transfer of computing tools, thus solving the problem of potential leakage of core technology assets.

[0013] (II) Technical Solution

[0014] To achieve the above objectives, in a first aspect, the present invention provides a method for dynamic calculation of engineering costs based on semantic parsing, comprising the following steps:

[0015] Step S10: Use natural language processing components to perform word segmentation and syntactic analysis on the engineering pricing specification text, slice it according to the specification level and extract pricing feature words, extract boundary conditions and operation relationships through regular expressions combined with syntax tree algorithms, and map the natural language specification into structured logical rule metadata; after attaching version number, effective start timestamp, invalidation end timestamp and anti-tamper signature to the logical rule metadata, store it in the versioned database using an add-only storage strategy;

[0016] Step S20: Receive the structured logical rule metadata output in step S10, dynamically construct a one-dimensional monotonically increasing ordered array of billing breakpoints and a one-dimensional array of billing rates; receive the billing amount of the item to be priced, and use a binary search pointer to iteratively lock the billing interval index where the billing amount is located; activate the segmented cascaded accumulation model or the linear interpolation model to calculate the cost result, and perform boundary sensitivity tendency detection based on dynamic thresholds;

[0017] Step S30: During the calculation execution in step S20, an audit node is dynamically created in memory and a snapshot of the instantaneous calculation state is captured. The instantaneous state snapshot includes the standard clause index, rule unique identifier, input variables, intermediate parameters, calculation formula template, final output value, and execution timestamp. The instantaneous state snapshot is converted into unified structured metadata. A globally unique business identifier is assigned to the current cost result. The core voucher text string is extracted, concatenated, and a tamper-proof hash signature is generated using a strong hash algorithm. The business identifier, tamper-proof hash signature, and audit node data are cascaded, bound, and stored in the background traceability database to form an irreversible quantity calculation voucher chain.

[0018] Step S40: For the enterprise's core rate data, a symmetric encryption algorithm is used for disk-level encrypted storage; when performing calculations involving core rates, mutually isolated temporary memory address regions are dynamically allocated as secure computing contexts, and the core rate coefficient plaintext is instantly decrypted and loaded into the isolated memory region to execute the core quantity calculation and pricing logic; after the calculation process is completed, the underlying memory overwrite instruction is immediately executed to forcibly and completely erase the plaintext coefficients and keys in the isolated memory region.

[0019] Preferably, for a further detailed description of steps S10-S40 of the present invention, please refer to the following detailed embodiments.

[0020] Secondly, the present invention also provides a dynamic engine system that decouples pricing rules from calculation, comprising:

[0021] The semantic parsing and version management module is used to perform step S10 as described in the first aspect, parsing the natural language specification text into structured rule metadata, and attaching version effective timestamps and expiration timestamps to the structured rule metadata for versioned isolation storage.

[0022] The dynamic pricing engine and boundary awareness module are used to perform step S20 as described in the first aspect, dynamically constructing a billing breakpoint array and a billing rate array based on the parsed metadata, locating the billing interval through a binary search algorithm, activating the segmented calculation model, and triggering boundary sensitivity detection based on a dynamic threshold.

[0023] The quantity calculation voucher chain generation and dynamic association module is used to perform step S30 as described in the first aspect, capture and structure the running state snapshot at the moment of calculation execution, generate tamper-proof hash signature through strong hash algorithm and concatenate and bind it with the fee result for storage;

[0024] The core indicator calculation isolation protection module is used to perform step S40 as described in the first aspect, to encrypt and store the core rate coefficient, allocate a temporary isolation memory area for instantaneous decryption and calculation during calculation, and forcibly erase the plaintext data in the isolation memory area after the calculation is completed.

[0025] (III) Beneficial Effects

[0026] 1. Significantly reduced software maintenance costs: When national or local fee standards change frequently, this invention only needs to update the external rule metadata database through the semantic parsing engine, shortening the traditional "code refactoring level / system restart level" maintenance to "data loading level / zero-downtime hot update". This "decoupling of computation and rules" architecture greatly improves the system's adaptation efficiency to different regional standards.

[0027] 2. Achieving true "penetrating" audit compliance: The dynamically generated quantity calculation voucher chain of this invention accurately locks the "entire state at the moment of cost generation", making the basis for each cost and the marginal calculation process completely transparent, perfectly meeting the penetrating audit compliance requirements of EPC projects and engineering bidding in the early stage.

[0028] 3. Safeguarding the Security of Enterprise Core Competencies: This invention establishes a data security barrier at the underlying algorithm mechanism through multi-level encryption and computational memory isolation. The plaintext core fee rate only appears briefly in the protected memory isolation area during the computation and is completely destroyed by underlying instructions after the computation is complete. This eliminates the risk of core asset leakage caused by memory dump attacks at the source.

[0029] In addition to the objectives, features, and advantages described above, the present invention has other objectives, features, and advantages. The invention will now be described in further detail with reference to the accompanying drawings. Attached Figure Description

[0030] The accompanying drawings, which form part of this application, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings:

[0031] Figure 1 This is a schematic diagram of the overall process of the dynamic calculation method for engineering cost based on semantic parsing according to a preferred embodiment of the present invention;

[0032] Figure 2 This is a detailed sub-process diagram of method step S20 of a preferred embodiment of the present invention;

[0033] Figure 3 This is a detailed sub-process diagram of method step S30 of a preferred embodiment of the present invention. Detailed Implementation

[0034] The embodiments of the present invention will be described in detail below with reference to the accompanying drawings, but the present invention can be implemented in many different ways as defined and covered by the claims.

[0035] Furthermore, unless otherwise defined, the technical or scientific terms used in this application description shall have the ordinary meaning understood by one of ordinary skill in the art to which this application pertains. The terms "upper," "lower," "left," "right," "center," "vertical," "horizontal," "inner," and "outer," etc., used in this application description to indicate relative direction or positional relationship are used only to indicate relative orientation or positional relationship, and do not imply that the device or element must have a specific orientation, or be constructed and operated in a specific orientation. When the absolute position of the described object changes, its relative positional relationship may also change accordingly, and therefore should not be construed as a limitation on this application. The terms "a," "one," or "the," etc., used in this application description should not be construed as an absolute limitation on quantity, but should be construed as indicating the existence of at least one. The terms "including," "comprising," etc., used in this application description mean that the element or object preceding the word covers the element or object listed after the word and its equivalents, without excluding other elements or objects.

[0036] It should also be noted that the algorithm logic, data structure and security mechanism in the following specific implementation are key aspects of realizing the technical contribution of this invention, and are not simply applications of existing technologies.

[0037] like Figure 1 As shown in the figure, this embodiment discloses a method for dynamic calculation of engineering costs based on semantic parsing, including the following steps:

[0038] Step S10: Multi-source canonical semantic parsing and metadata standardization

[0039] This step utilizes natural language processing components to perform word segmentation and syntactic analysis on the engineering pricing specification text. It slices the text according to the specification hierarchy and extracts pricing feature words. It uses regular expressions combined with syntax tree algorithms to extract boundary conditions and operational relationships, mapping the natural language specification into structured logical rule metadata. After attaching a version number, effective start timestamp, invalidation end timestamp, and tamper-proof signature to the logical rule metadata, it is stored in a versioned database using an increment-only storage strategy.

[0040] This step is the core foundation for decoupling computational logic from program code. In existing technologies, pricing rules are often fixed in the source code, leading to the predicament of "updating the standard and refactoring the code." To solve this problem, this embodiment automatically converts the natural language descriptions of engineering surveying and design, supervision, and other fee specifications into computer-recognizable structured metadata. Specifically, it includes the following steps:

[0041] S11 Intelligent Text Slicing: It calls the Natural Language Processing (NLP) preprocessing component to perform word segmentation and syntactic analysis on the imported natural language description of engineering fee specification text (such as the "Hunan Province Construction Engineering Construction Stage Supervision Service Fee Calculation Rules"). The specification text is sliced ​​hierarchically according to "chapter, section, article, clause" and automatically identifies pricing feature words (such as "investment amount", "fee adjustment coefficient", "interpolation method calculation").

[0042] S12 rule translation: Utilizing regular expressions (RegEx) combined with a parsing tree algorithm, boundary conditions and operational relationships are extracted from the specification slices. Natural language conditions and boundaries are mapped to a unified set of structured logical rules (such as JSON-formatted metadata). For example, "Investment amount exceeding 30 million yuan, temporarily calculated at 80%" is mapped to a computer-recognizable logical branch. The semantic parsing and algorithmic logic mapping results of the specification clauses are shown in Table 1.

[0043] Table 1

[0044]

[0045] S13 Versioned Storage Based on Lifecycle Isolation: To ensure a smooth and seamless transition between old and new specifications, the system has built a versioned storage database that supports timestamps and lifecycle isolation.

[0046] A. Schema Version Tracking: To achieve seamless hot switching between "old projects using old specifications and new projects using new specifications," this invention employs an "add-only, no-modification" storage strategy in the underlying database. Specifically, for each parsed JSON metadata record, the following system-level fields are forcibly appended: Version_ID (version number), Valid_From (effective start time stamp), Valid_To (expiration end time stamp), and Hash_Signature (tamper-proof signature). This time-based data isolation ensures that projects from different years can strictly call the specifications effective in the corresponding year, allowing old and new specifications to coexist in the same rule base based on different timestamps. Table 2 shows an example of the coexistence status of the same pricing rule in the version base:

[0047] Table 2

[0048]

[0049] At the same time, a schema_version field is added to each business table to mark the storage format of each row of historical data, ensuring that the historical data is not corrupted due to changes in the data table structure.

[0050] B. Application Layer Multi-Version Adapter Pattern: This pattern introduces dynamic routing logic at the application layer. When a pricing request is initiated, the system no longer reads a fixed source code branch. Instead, it extracts the schema_version from the business table to determine the corresponding handler and dynamically loads the logic tree for the corresponding version. This enables seamless hot switching between old projects using old specifications and new projects routing to the new specifications. This adapter pattern ensures that even with frequent changes in specifications and policies, the system can adapt to rules with "zero downtime" without recompiling or restarting.

[0051] Table 3 shows examples of pseudocode for Python dynamic version routing adaptation.

[0052] Table 3

[0053]

[0054] The code principle in Table 3: This code snippet is essentially a "dynamic route selector." Instead of hard-coding rule branches from different years into the same large class, the system leverages object-oriented polymorphism. `LegacyProcessor` and `ModernProcessor` each encapsulate independent logical processors. When the `version` parameter is input in a business request, the system acts like a key, activating only the corresponding processor. This architecture completely avoids complex if-else nesting, allowing adaptation to new specifications without restarting the system, achieving "zero-downtime hot updates," while ensuring that historical projects are not corrupted due to version conflicts.

[0055] Step S20: Dynamic pricing logic tree mapping and core calculation mechanism

[0056] As Figure 2 shown, this step receives the structured logic rule metadata output from step S10, and dynamically constructs a one-dimensional monotonically increasing ordered array of billing breakpoints and a one-dimensional billing rate array; receives the billing amount of the item to be priced, and iteratively locks the billing interval index where the billing amount is located through a binary search pointer; activates the segmented cascade accumulation model or the linear interpolation model to calculate the fee result, and performs boundary sensitivity tendency detection based on dynamic thresholds.

[0057] Aiming at the non-linear complex calculations unique to construction cost, such as excess progressive regress and step mutation, the if-else judgment tree of the traditional general rule engine will expand exponentially, which severely drags down the calculation efficiency. At the same time, there is often a manipulation risk of "fine-tuning the investment amount leading to a huge step change in fees" in engineering audit. This step inherits the standardized metadata output from S10, dynamically constructs a "condition-calculation-output" triplet multi-branch logic tree in the memory, realizes efficient and accurate calculation of non-linear segmented engineering fees, and implements boundary compliance audit. The specific steps are as follows:

[0058] S21 Binary search algorithm for interval breakpoints based on ordered list: In order to eliminate multiple nested if-else or switch-case hard-coded statements, extract the fee interval definition in the specification, extract all charging breakpoints x and construct a one-dimensional monotonically increasing in-memory ordered array sequence: (where is the reference lower limit, is the maximum upper limit, and the array elements of array A represent each charging breakpoint respectively). At the same time, construct the corresponding interval fee parameter array , the array elements in array R respectively correspond to the billing rate of the billing interval formed by two adjacent charging breakpoints in the ordered array A of charging breakpoints .

[0059] When the system inputs the billing amount X to be queried of the item to be priced, the engine activates the binary search pointer (low=0, high=n), and calculates the intermediate index in each iteration step , where mid is an integer rounded down:

[0060] If X≥A[mid], then set ;

[0061] If X<A[mid], then set .

[0062] The algorithm converges when low > high. By using a binary search in each iteration, the system achieves extremely high efficiency. The system converges downwards, precisely locking the index i of the specific compliant billing interval where the billing amount X lies. This physical structure based on random access of array indices reduces the matching time complexity from exponential to near zero. No matter how complex the pricing specifications are or how many tiers there are, the system can accurately lock the billing interval index i in milliseconds, fundamentally solving the computing power bottleneck faced by general rule engines in the engineering field.

[0063] S22 Segmented Cascaded Accumulation or Linear Interpolation Calculation Mechanism: After locking the interval index i, if the specification adopts a segmented cascaded accumulation model (such as preliminary work consulting fees), the standardized accumulation formula for the total fee (TotalFee) is defined as follows:

[0064]

[0065] in: The length of each interval; This defines the billing rate for each interval. The cumulative base price for each interval is extracted from the metadata. The cascade formula simplifies to:

[0066]

[0067] This formula utilizes the concept of prefix sum matrices, transforming the prefix sum matrix into a single matrix. The cost of each interval is hard-coded as a static constant. During the calculation, only the current remaining marginal portion needs to be calculated. Multiply by the corresponding rate This pre-computation caching mechanism simplifies the original multiple loops of accumulation into "one addition and one multiplication", greatly improving the computational throughput in high-concurrency pricing scenarios.

[0068] If the standard uses a linear interpolation model (such as the base price for certain supervision fees), the formula will dynamically switch to:

[0069]

[0070] in, and These are the charging breakpoints. and The corresponding standard legal fee base price. This numerical calculation based on parameter mapping completely avoids hard-coded arithmetic branches.

[0071] S23. Boundary Sensitivity Tendency Detection Method Based on Dynamic Thresholds: To prevent compliance risks caused by human intervention in adjusting investment amounts across breakpoints or by sudden changes in costs due to minor errors, this embodiment establishes a Sensitivity_Check (sensitivity tendency detection) pre-audit module, the working steps of which are as follows:

[0072] Threshold dynamic capture: based on the currently locked interval endpoints and Dynamically calculate compliance tolerance threshold .

[0073] Critical state triggering: The system determines whether |XA[i-1]|≤Δ or If the input is determined to be in an extremely sensitive critical region, the system will immediately and automatically freeze the direct output stream and forcibly trigger the Sensitivity_Check state machine.

[0074] Propensity Disparity Comparison and Audit Alerts: The module performs two virtual calculations in parallel in the background to compare the normal costs under the current tier. The virtual cost when the input amount is finely adjusted and jumps to the boundary point of the adjacent gear. The system calculates the difference. When the Diff exceeds the compliance risk value, a red warning is displayed on the user interface, indicating the risk of changes in the price level, listing the difference amount and compliance optimization suggestions. This step builds an "audit firewall" to prevent cost-related violations from the source of the underlying calculation engine.

[0075] To facilitate understanding of the core calculation steps in this embodiment, the present invention provides a detailed description through concrete application examples. Specifically:

[0076] Basic data input: After data cleaning, the total investment amount (i.e., the billing amount X) of a certain complex project is X = 297,415,700 yuan. The system hot-loads the corresponding structured rule table and automatically constructs an ordered list in memory.

[0077] Breakpoint-ordered array (Unit: 10,000 yuan)

[0078] Interval Radix Length Array ;

[0079] Range of toll rates array (unit:‰);

[0080] cumulative base price array before the interval (Unit: 10,000 yuan)

[0081] S21 (Binary Search Adaptation Execution): Receive Initialize pointers low=0, high=5.

[0082] First iteration: ,examine .because Let low = 3.

[0083] Second iteration: ,examine .because Let low = 5.

[0084] Third iteration: ,examine .because Let high = 4.

[0085] At this point, low(5) > high(4), the algorithm converges, and the interval index is locked. Determine the exact attribution of the billing amount. In the range of 10,000 yuan.

[0086] S22 (Segmented Cascaded Price Execution): The system routes to the formula corresponding to index 5 and directly extracts the static cumulative base price of the first 4 intervals. 10,000,000 yuan. Then, for the marginal portion exceeding 10,000,000 yuan, the interval length product price is calculated:

[0087]

[0088]

[0089] .

[0090] S23 (Boundary Sensitivity Detection Execution): Calculate tolerance threshold The system retrieves the right endpoint of the current interval (assuming it's the legal threshold of 300 million yuan for a large-scale rate change). The absolute distance is calculated as: |30000−29741.57| = 258.43 million yuan. Since 258.43 > 29.74, the system determines that it has not entered the dangerous critical zone and outputs the result normally. If the project investment amount changes to 299.8 million yuan, and the absolute distance 20 ≤ 29.98, the system will trigger an interception, outputting a highlighted warning to indicate the risk of review and avoid legal disputes related to cost auditing.

[0091] Step S30: Generation and dynamic association of quantity calculation voucher chains

[0092] like Figure 3As shown, during the instantaneous execution of calculation in step S20, an audit node is dynamically created in memory and a snapshot of the instantaneous calculation state is captured. The instantaneous state snapshot includes the index of the standard clause, the unique rule identifier, input variables, intermediate parameters, calculation formula template, final output value, and execution timestamp. The instantaneous state snapshot is converted into unified structured metadata, a globally unique business identifier is assigned to the current cost result, the core voucher text string is extracted and concatenated, and a tamper-proof hash signature is generated through a strong hash algorithm. The business identifier, the tamper-proof hash signature, and the audit node data are cascaded, bound, and stored in the background traceability database.

[0093] This step aims to break down the traditional "black box" of calculations and provide a digital audit evidence chain for every output cost. The specific steps are as follows:

[0094] S31 State Snapshot Capture: During any step of nonlinear segmented cost cascading calculation, rule determination, or boundary compliance auditing, the computation engine dynamically creates an Audit Node object in memory to capture a real-time snapshot of the current computational state. This snapshot includes the current specification clause index identifier, the rule unique identifier (Rule_ID), project feature input variables, intermediate calculation parameters, calculation formula template, the final calculation output value, and a system execution timestamp accurate to milliseconds.

[0095] When the system inputs the total investment amount after cleaning for a certain complex project... When the calculation engine performs segmented cascade pricing and arrives at a total cost of 474,101.1 yuan, the following is an example of the JSON data of the audit node object that the system builds in memory in real time:

[0096] Table 4

[0097]

[0098] The principle behind the code in Table 4: This JSON object is called a "process-level snapshot capsule" at the system's underlying level. It is not an ordinary data log, but rather a set of full state data directly extracted and serialized within the same millisecond-level time slice of the S20 dynamic computing engine's output, using memory address freezing technology (Memory Snapshot). It is the sole source of information for the subsequent generation of tamper-proof hash signatures by S32.

[0099] S32 Chain Binding: The instantaneous state snapshot of the computation recorded in the audit node is transformed into unified structured metadata, and a globally unique business identifier (Result_UUID) is assigned to the current cost output result. The system calls a strong hash algorithm (such as SHA-256) to perform one-way encrypted computation on the metadata text containing the canonical index, input variables, fee rate, and timestamp, generating a unique and irreversible tamper-proof hash signature (Hash_Signature). Subsequently, the business identifier, the tamper-proof hash signature, and the corresponding audit node data are cascaded and bound, and stored in a hidden traceability database (Trace_DB) in the background, forming an irreversible chain of computational vouchers.

[0100] Following the previous example, the system is the case of step S20. The output result for the fee of 10,000 yuan is assigned a globally unique business identifier Result_UUID = "RES-20260701-XYZ-001". The system extracts the core voucher text string from the snapshot and concatenates it as: "RULE_003 | X=29741.57 | Base=35.96 | r=0.58‰ | Time=2026-07-01 10:15:30.123". A unique tamper-proof hash signature Hash_Signature = "9e107d9d372bb6826c30f4f" is calculated using the SHA-256 algorithm. Finally, the following cascading and bound voucher chain records are formed in the traceability database (Trace_DB) (as shown in Table 5):

[0101] Table 5. Trace Database (Trace_DB) Credential Chain Data Record Table

[0102]

[0103] S33 Reverse Query Interface: The system provides a reverse query interface, Retrieve_Trace(UUID), at the application layer. When the front-end display interface or electronic report receives a click trigger instruction from the auditor for any final calculated amount, the front-end interaction module dynamically obtains the globally unique business identifier (Result_UUID) associated with the final calculated amount and automatically calls the reverse query interface as an input parameter. This interface reversely retrieves the traceability database (Trace_DB) based on the business identifier. After verifying data integrity through hash signature, it extracts the corresponding audit node snapshot data. The front-end interface then dynamically renders and displays the entire chain calculation formula of the final calculated amount, the snapshot of input variables, the rate marginal decomposition process, and the original source of the corresponding legal regulations.

[0104] Specifically, when auditors review the exported electronic pricing report, clicking on the final result "474,101.1 yuan" immediately triggers the system's front-end interactive module to call the reverse query pseudocode interface shown in Table 6:

[0105] Table 6

[0106]

[0107] The code principle shown in Table 6 is as follows: This interface acts as a "guardian" of audit compliance. `re_construct_metadata_string` ensures that the raw materials used to recalculate the hash must be exactly the same as those used in the original accounting, including decimal precision. If any malicious tampering occurs, the recalculated hash signature `current_hash` will exhibit a drastic "avalanche" difference (completely different) from the old value in `Trace_DB`. When the recalculated hash value matches the historically stored hash signature, the audit node snapshot data is returned to the front-end interface. The front-end dynamically renders and displays the entire calculation formula for the final calculated amount, the snapshot of input variables, the rate marginal breakdown process, and the original source of the specification. If they do not match, the system directly triggers an anti-tampering security alarm, and the interface immediately throws a `DataTamperedError` exception and interrupts the page display, blocking the use of the report data. Through this "hash lock," the system achieves one-click transparent backtracking from the original message fields to the final report result, giving the cost data the underlying ability to "prove its innocence."

[0108] After the interface verification is successful, the front-end interface will dynamically display the penetration audit panel information shown in Table 7 via a pop-up window:

[0109] Table 7

[0110]

[0111] Step S40: Security Protection of Core Indicators (Data Encryption and Computational State Isolation)

[0112] For core enterprise rate data, this step uses a symmetric encryption algorithm for disk-level encrypted storage. When performing calculations involving core rates, a dynamically allocated, isolated temporary memory address region is used as a secure computing context. The core rate coefficient plaintext is instantly decrypted and loaded into the isolated memory region, and the core quantity calculation and pricing logic is executed. After the calculation process is completed, the underlying memory overwrite instruction is immediately executed to forcibly and completely erase the plaintext coefficients and keys in the isolated memory region.

[0113] Enterprise-level confidentiality rates (such as internal discount rates and risk adjustment coefficients) pose the greatest security risk to cost estimation software. To prevent core technology assets from being stolen by hackers through memory dumping or data extraction during the external distribution and transfer of calculation tools, this step protects enterprise-level trade secrets (such as internal guidance rate coefficients and sensitive discount rates) through the following specific steps to prevent the leakage of technical assets.

[0114] S41 Multi-Level Encrypted Storage: The system divides the database into a public database and a core experience database. For non-sensitive general policy and regulatory data, the system stores it directly in plaintext in the public database. For the enterprise's internal core experience rate database, the system uses AES-256 symmetric encryption algorithm for disk-level (Data-at-Rest) encrypted storage before writing to disk. Even if the hard drive is physically removed or the database is illegally exported, attackers will only see meaningless gibberish.

[0115] As a specific application example, when an enterprise defines a set of internal high-precision guidance rate files (Secret_Rate_Profile), the system encrypts them using a high-strength root key before storing them in the database. A comparison of the structured data before and after storage is shown in Table 8.

[0116] Table 8

[0117]

[0118] S42 Computational Isolation: The system defines a special `Secure_Context` class. During core computation, mutually isolated temporary address regions are dynamically allocated in volatile memory. The key and plaintext empirical coefficients are only briefly loaded into this isolated memory region for a short period during computation and decrypted immediately. The computation engine completes nonlinear cascade operations within this isolated region and outputs the final cost result. Once the computation process ends, the system immediately triggers a forced memory overwrite instruction (such as calling `memset_s` or a memory security barrier) to completely erase the plaintext coefficients and key within the isolated region, achieving "encryption upon delivery, no trace left in memory" computational security protection.

[0119] The system's underlying control pseudocode for implementing computational isolation and immediate destruction mechanisms is shown in Table 9.

[0120] Table 9

[0121]

[0122] The code in Table 9 works as follows: This code acts as a "safe" for core asset defense, unlike the automatic garbage collection (GC) strategies of conventional languages ​​(such as Java). GC only marks memory as reclaimable but does not guarantee real-time data overwriting, meaning that plaintext core fees may remain in memory for tens of milliseconds to several seconds. This invention uses ctypes.memset for synchronous physical forced clearing (setting to 0). This means that even if a hacker launches a "memory dump" attack on this memory area at the most precise time window, they will only capture a jumble of all zeros. This mechanism defends against the physical leakage of trade secrets from the ground up.

[0123] S43 Integrity Digital Signature: A strong encrypted digital signature based on HMAC (such as HMAC based on SHA-256) is attached to the rate factor configuration file. The system verifies the digital signature every time it starts up or loads rules. The system recalculates the HMAC signature of the configuration file using the authentication key embedded in the security chip or environment variables and performs a full equality comparison with the reserved digital signature. Once unauthorized tampering with rate parameters is detected, the calculation engine is immediately locked and an alarm is triggered.

[0124] The dynamic verification logic for this step is shown in Table 10 of the following flow control pseudocode:

[0125] Table 10

[0126]

[0127] The code principle in Table 10 is as follows: `hmac.compare_digest` is introduced here to replace the regular string `==` comparison. A regular string comparison immediately returns `False` upon finding the first different character. This time difference exposes it to hackers, allowing them to brute-force the correct signature length and content. `hmac.compare_digest`, however, performs a constant-time comparison; regardless of whether the comparison is true or false, the execution time is exactly the same, fundamentally eliminating the possibility of hackers cracking the configuration information through side-channel attacks.

[0128] S50: Automated Compliance Report Output

[0129] S51 Dynamic Form Rendering: Based on standard Excel / Word templates, it reads the underlying data stream by calling OpenXMLSDK and injects the "quantity calculation voucher chain" information generated in step S30 into the extended property area (CustomProperties) of the report file in the form of metadata, ensuring that the exported external report still retains the traceability attributes.

[0130] S52 Automatic Verification Report Generation: The system automatically compares the "manual verification anchor value of cost estimators" with the "system calculation value of the dynamic engine", analyzes the difference rate, and automatically outputs the "Automatic Audit Report on Compliance of Pricing Logic", so that the electronic deliverables have "digital audit genes" and meet the in-depth compliance requirements of engineering bidding and EPC project full-process audit.

[0131] The semantic parsing-based dynamic cost calculation method for engineering projects in this embodiment has at least the following characteristics:

[0132] 1. By employing multi-source specification semantic parsing and versioned isolated storage mechanisms, utilizing an "add-only" strategy, timestamp validity control, and an application-layer multi-version adapter pattern, the traditional model's inherent problem of "a change in specification requires code refactoring and a system restart" has been completely transformed. The system only needs to load new rule metadata (JSON) externally through the semantic parsing engine to dynamically route to the corresponding new version of the logic tree. The update cycle of pricing rules has been shortened from "code refactoring level / system restart level" to "data loading level / zero-downtime hot update," greatly improving the system's response speed and adaptation efficiency to frequent changes in specifications across multiple regions and versions.

[0133] 2. By combining "one-dimensional ordered array construction" with "binary search algorithm (O(logN))" and an original "boundary sensitivity tendency detection based on dynamic threshold," this approach overcomes the drawbacks of traditional general rule engines that suffer from "exponential expansion of logic tree depth" when handling excessive accrual and step-by-step abrupt changes. Utilizing the high-speed access characteristics of memory arrays, it achieves millisecond-level ultra-fast calculation of complex nonlinear costs. The boundary detection mechanism automatically freezes the output and triggers parallel backend computation for comparison when the investment amount approaches the charging breakpoint. If there is a risk of illegal jumps, a high-level warning is triggered. This method, from the underlying algorithm, eliminates the audit blind spot of "manually fine-tuning the investment amount across breakpoints" by cost estimators, significantly reducing legal disputes and compliance risks in project pricing.

[0134] 3. Unlike existing technologies that only provide "result-level tamper-proofing" for the final report file, this invention delves deep into the computation engine, hash-locking the "process" of cost generation with the final result. Auditors only need to click on any cost amount in the generated electronic report, and the system can automatically traverse the underlying layers, compare hash values, and fully display the legal and regulatory basis, input variables, intermediate calculation parameters, and complete computational power derivation process for that cost. Each cost item possesses "full lifecycle self-proving capability," perfectly meeting the high-standard, transparent audit compliance requirements of EPC projects and bidding processes.

[0135] 4. By employing AES-256 disk encryption storage, dynamically allocated isolated memory areas, immediate low-level forced overwriting upon computation completion, and HMAC integrity digital signature verification, high-value corporate trade secrets such as core internal rates and sensitive discount coefficients exist only briefly in plaintext within an independently allocated isolated memory area for microseconds during computation, and are physically overwritten and destroyed immediately after computation. This fundamentally eliminates the possibility of hackers or internal personnel stealing core data through conventional memory dumps or memory scans. Simultaneously, HMAC digital signatures are automatically verified at startup; if the configuration file is illegally tampered with, the system will execute a defensive hard lock, reducing the risk of leakage of core corporate technical secrets to zero.

[0136] It should be noted that in this invention, user authentication and access control can employ the common OAuth2.0 / JWT mechanism for role division; data transfer between modules uses the common JSON data format and is encapsulated through a RESTful API; standard cryptographic function libraries (such as the common OpenSSL library) are called when performing basic encryption operations; and conventional relational databases are used for persistent storage of public regulations and system logs. These are all conventional technical means supporting this invention and do not constitute a limitation on the core protection scope of this invention.

[0137] Other possible embodiments of the present invention also provide a dynamic engineering cost calculation system based on semantic parsing and multi-level access control, comprising:

[0138] The semantic parsing and version management module is used to execute step S10 of the above embodiment, parse the natural language specification text into structured rule metadata, and add version effective timestamps and expiration timestamps to the structured rule metadata for version isolation storage.

[0139] The dynamic pricing engine and boundary awareness module are used to execute step S20 of the above embodiment, dynamically construct a billing breakpoint array and a billing rate array based on the parsed metadata, locate the billing interval through a binary search algorithm, activate the segmented calculation model, and trigger boundary sensitivity detection based on a dynamic threshold.

[0140] The quantity calculation voucher chain generation and dynamic association module is used to execute step S30 of the above embodiment, capture and structure the running state snapshot at the moment of calculation execution, generate tamper-proof hash signature through strong hash algorithm and bind it with the fee result for storage;

[0141] The core indicator calculation isolation protection module is used to execute step S40 of the above embodiment, encrypt and store the core rate coefficient, allocate a temporary isolation memory area for instantaneous decryption and calculation during calculation, and forcibly erase the plaintext data in the isolation memory area after the calculation is completed.

[0142] The dynamic pricing engine and boundary awareness module also include a sensitivity-biased audit unit. This unit calculates the compliance tolerance threshold Δ = X × 0.1% based on the endpoint of the currently locked billing interval and the billing amount X to be priced, determining whether the billing amount is in a critical state. If it is in a critical state, it triggers parallel virtual calculations in the background and outputs a difference warning report. The quantity calculation voucher chain generation and dynamic association module includes an audit node snapshot unit, a hash binding unit, and a reverse tracing unit. The audit node snapshot unit dynamically creates an Audit_Node JSON object in memory containing rule IDs, input variables, intermediate parameters, calculation formulas, and timestamps. The hash binding unit concatenates the core voucher text and generates an tamper-proof signature using SHA-256, storing it in the tracing database. The reverse tracing unit receives a unique business identifier triggered by the front end, reconstructs metadata, performs hash integrity verification, and returns the verified data to the front end for through-process rendering. The core indicator computational isolation protection module includes a memory isolation unit and a memory zeroing and destruction unit based on the SecureContext security context. The memory isolation unit dynamically allocates a temporary isolated address space in the heap memory to load the key and decrypt the core empirical coefficients during computation execution. The memory zeroing and destruction unit forcibly calls the underlying memory security barrier zeroing instruction to clear all data in the isolated address space after the computation is completed.

[0143] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A dynamic calculation method for engineering costs based on semantic parsing, characterized in that, Includes the following steps: step S10: Utilize natural language processing components to perform word segmentation and syntactic analysis on the engineering pricing specification text, slice it according to the specification level and extract pricing feature words, extract boundary conditions and operational relationships through regular expressions combined with syntax tree algorithms, and map the natural language specification into structured logical rule metadata; after attaching a version number, effective start timestamp, invalidation end timestamp and anti-tampering signature to the logical rule metadata, store it in a versioned database using an add-only storage strategy; Step S20: Receive the structured logical rule metadata output in step S10, dynamically construct a one-dimensional monotonically increasing ordered array of billing breakpoints and a one-dimensional array of billing rates; receive the billing amount of the item to be priced, and use a binary search pointer to iteratively lock the billing interval index where the billing amount is located; activate the segmented cascaded accumulation model or the linear interpolation model to calculate the cost result, and perform boundary sensitivity tendency detection based on dynamic thresholds; Step S30: During the calculation execution in step S20, an audit node is dynamically created in memory and a snapshot of the instantaneous calculation state is captured. The instantaneous state snapshot includes the standard clause index, rule unique identifier, input variables, intermediate parameters, calculation formula template, final output value, and execution timestamp. The instantaneous state snapshot is converted into unified structured metadata. A globally unique business identifier is assigned to the current cost result. The core voucher text string is extracted, concatenated, and a tamper-proof hash signature is generated using a strong hash algorithm. The business identifier, tamper-proof hash signature, and audit node data are cascaded, bound, and stored in the background traceability database to form an irreversible quantity calculation voucher chain. Step S40: For the enterprise's core rate data, a symmetric encryption algorithm is used for disk-level encrypted storage; when performing calculations involving core rates, mutually isolated temporary memory address areas are dynamically allocated as a secure computing context, and the core rate coefficient plaintext is instantly decrypted and loaded into the isolated memory area to execute the core quantity calculation and pricing logic. After the calculation process is completed, the underlying memory overwrite instruction is executed immediately to forcibly and completely erase the plaintext coefficients and keys in the isolated memory area.

2. The method for dynamic calculation of engineering costs based on semantic parsing according to claim 1, characterized in that, In step S20, the specific steps for dynamically constructing the one-dimensional ordered array of billing breakpoints and the one-dimensional array of billing rates are as follows: Extract the fee range definition from the specification, extract all fee breakpoints x, and construct them into a one-dimensional monotonically increasing ordered array sequence in memory: , wherein the array elements of the ordered array A These represent the various charging breakpoints; simultaneously, an interval charging parameter array corresponding one-to-one with the ordered array A is constructed. array elements in array R These correspond to two adjacent charging breakpoints in the ordered array A, respectively. The billing rate for the billing interval constituted by ] 3. The method for dynamic calculation of engineering costs based on semantic parsing according to claim 2, characterized in that, In step S20, the specific steps for locking the billing interval index through binary search pointer iteration are as follows: Initialize the binary search pointers: low = 0, high = n; Calculate intermediate indices in each iteration. , where mid is an integer rounded down; If the billing amount X of the item to be priced is greater than or equal to A[mid], let ; If X < A[mid], then let ; When low > high, the algorithm converges, locking the index i of the specific compliant billing interval where the billing amount X is located.

4. The method for dynamic calculation of engineering costs based on semantic parsing according to claim 3, characterized in that, In step S20, the segmented cascaded accumulation model or linear interpolation model is activated to calculate the cost result based on the billing interval index i. : If the standard adopts a segmented, cumulative relationship model, it is calculated using the following formula: in: This represents the static cumulative base price for the first i-1 intervals; The billing rate corresponding to the current interval; If the standard uses the linear interpolation model, the calculation is performed using the following formula: in, and These are the charging breakpoints. and The corresponding standard and legally mandated base price.

5. The method for dynamic calculation of engineering cost based on semantic parsing according to claim 3, characterized in that, In step S20, the specific steps for performing boundary sensitivity tendency detection based on dynamic thresholds include: Threshold dynamic capture: based on the currently locked interval endpoints and Dynamically calculate compliance tolerance threshold ; Critical state triggering: If the billing amount X satisfies |XA[i-1]|≤Δ or If so, the billing amount is determined to be in a sensitive critical zone, and the sensitivity detection state machine is triggered; Bias-based discrepancy comparison and audit alerts: Perform two virtual calculations in parallel in the background and compare them with the current normal calculation costs. The virtual cost when the billing amount is slightly adjusted and jumps to the boundary point of the adjacent tier. Calculate the difference When the difference When the risk exceeds the preset compliance risk value, an early warning will be issued and the difference amount and compliance optimization suggestions will be displayed.

6. The method for dynamic calculation of engineering cost based on semantic parsing according to claim 1, characterized in that, In step S30, the specific steps for generating the tamper-proof hash signature include: Extract the core credential text string from the instantaneous state snapshot and concatenate it into a string containing the rule identification code, billing amount, intermediate parameters, rate and execution timestamp; The concatenated string is subjected to one-way encryption calculation using the SHA-256 algorithm to generate a unique and irreversible tamper-proof hash signature, Hash_Signature.

7. The method for dynamic calculation of engineering costs based on semantic parsing according to claim 1, characterized in that, Step S30 also includes a data reverse query and penetration presentation step: The system provides a reverse query interface at the application layer, which receives a globally unique business identifier triggered by the front end based on the final fee amount; Based on the business identifier, the source tracing database is retrieved in reverse order, the corresponding audit node snapshot data is extracted, and the metadata text is reassembled to perform hash integrity verification. If the recalculated hash value matches the historically stored hash signature, the audit node snapshot data is returned to the front-end interface, where the front-end dynamically renders and displays the full-link calculation formula for the final cost amount corresponding to the business identifier, the snapshot of the input variables, the rate margin decomposition process, and the original source of the specification. If there is a discrepancy, a security compliance alert will be triggered and the display will be blocked.

8. The method for dynamic calculation of engineering costs based on semantic parsing according to claim 1, characterized in that, In step S40, the forced erase operation after the calculation is completed is specifically as follows: By calling the memset_s function or the memory safety barrier instruction, all data in the isolated memory area is zeroed out and the isolated memory area is released, achieving encryption upon landing and leaving no trace in memory for computational security protection.

9. The method for dynamic calculation of engineering cost based on semantic parsing according to claim 1, characterized in that, Step S40 also includes a digital signature verification step to ensure the integrity of the core rate factor configuration file: Before the system starts or loads rate rules, it uses the authentication key embedded in the secure environment to recalculate the HMAC digital signature of the current rate profile and performs a full equality comparison with the pre-stored digital signature. If the comparison does not match, it is determined that the configuration file has been tampered with, and the computing engine is immediately locked and all computing requests are blocked.

10. A dynamic engineering cost calculation system based on semantic parsing, characterized in that, include: The semantic parsing and version management module is used to perform step S10 as described in claim 1, parsing the natural language specification text into structured rule metadata, and adding version effective timestamps and expiration timestamps to the structured rule metadata for version isolation storage. The dynamic pricing engine and boundary awareness module are used to perform step S20 as described in claim 1, dynamically constructing a billing breakpoint array and a billing rate array based on the parsed metadata, locating the billing interval through a binary search algorithm, activating the segmented calculation model, and triggering boundary sensitivity detection based on a dynamic threshold. The quantity calculation voucher chain generation and dynamic association module is used to perform step S30 as described in claim 1, capture and structure a snapshot of the running state at the instant of calculation execution, generate an anti-tampering hash signature through a strong hash algorithm and concatenate and bind it with the cost result for storage; The core indicator calculation isolation protection module is used to perform step S40 as described in claim 1, to encrypt and store the core rate coefficient, allocate a temporary isolated memory area for instantaneous decryption and calculation during calculation, and forcibly erase the plaintext data in the isolated memory area after the calculation is completed.

Citation Information

Patent Citations

  • Rule engine and charging system based on rule engine in cloud computing platform

    CN106228354A

  • Building construction safety monitoring method and system based on artificial intelligence

    CN120746803A

  • Engineering audit data compliance checking method and system based on Transform model

    CN121810230A