An ontology-based smart contract parsing method

By constructing a traffic management ontology library and using the BERT-BiLSTM-CRF model for smart contract parsing, the problem of unambiguous parsing of natural language rules in mountain traffic management was solved, enabling accurate execution of smart contracts and efficient decision-making in traffic management, thereby improving emergency response and management efficiency.

CN122242478APending Publication Date: 2026-06-19GUIZHOU UNIV +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUIZHOU UNIV
Filing Date
2026-01-30
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Existing smart contract parsing technology cannot achieve unambiguous parsing of natural language rules in mountain traffic management, resulting in discrepancies between rule translation and actual intent, thus affecting the accuracy of contract execution.

Method used

A traffic management ontology library for the target domain is constructed. Entities, attributes, and relationships are defined using the OWL language. Entities and relationships are extracted using the BERT-BiLSTM-CRF semantic parsing model to generate structured smart contracts. Rule conflicts are resolved using directed acyclic graphs and breadth-first search algorithms, and rule parameters are optimized using reinforcement learning to form a closed-loop optimization mechanism.

Benefits of technology

It achieves accurate mapping and unambiguous conversion of natural language rules, ensuring the accuracy and security of smart contract execution, improving the timeliness of emergency response and traffic management efficiency, and possessing a high level of intelligence and scalability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122242478A_ABST
    Figure CN122242478A_ABST
Patent Text Reader

Abstract

This invention relates to the field of traffic management technology, and in particular to an ontology-based smart contract parsing method, comprising the following steps: S1: Constructing a traffic management ontology library for the target domain; S2: Collecting natural language rule text and multi-dimensional traffic data from the target domain, and after data preprocessing, inputting it into a BERT-BiLSTM-CRF semantic parsing model for entity and relation extraction, mapping the extraction results to the traffic management ontology library of step S1, and filling it into a preset IF-THEN smart contract template to generate a structured smart contract; S3: Modeling all structured smart contracts generated in step S2 as directed acyclic graphs; S4: Collecting multi-dimensional traffic operation indicators before and after the execution of the final execution rule. This invention accurately defines traffic-related entities, attributes, and interrelationships, and combines dependency parsing and entity linking technology to accurately map the natural language rules input by management personnel to the structured IF-THEN smart contract template, effectively eliminating translation bias caused by semantic ambiguity and polysemy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of traffic management technology, and in particular to an ontology-based smart contract parsing method. Background Technology

[0002] Smart contract parsing refers to the structured analysis and functional interpretation of automated execution protocols based on blockchain technology. Its core lies in defining contract terms through programming languages ​​and automatically triggering execution when preset conditions are met. It is widely used in fields such as financial transactions, supply chain management, and digital identity verification. In mountain traffic management, smart contracts need to convert traffic rules described in natural language into structured execution protocols to achieve automated and decentralized traffic control.

[0003] Mountainous transportation is characterized by complex terrain, variable weather, heterogeneous multi-source data, and dynamic rule scenarios. Existing smart contract parsing technologies cannot achieve unambiguous parsing of natural language rules, resulting in discrepancies between rule translation and actual intent, which affects the accuracy of contract execution. Therefore, it is necessary to design an ontology-based smart contract parsing method. Summary of the Invention

[0004] The purpose of this invention is to address the shortcomings of existing technologies by proposing an ontology-based smart contract parsing method.

[0005] To achieve the above objectives, the present invention adopts the following technical solution: an ontology-based smart contract parsing method, comprising the following steps: S1: Construct a traffic management ontology library for the target domain. Use the OWL language to define entities, attributes and relationships between entities in the ontology. The entities include roads, vehicles, weather and drivers. The attributes include slope, visibility, vehicle speed and accident rate. The relationships include location, influence and trigger. Location is associated with roads and regions. Influence is associated with weather and road conditions. Trigger is associated with traffic conditions and traffic rules. S2: Collect natural language rule text and multi-dimensional traffic data in the target domain. After data preprocessing, input the data into the BERT-BiLSTM-CRF semantic parsing model to extract entities and relations. Map the extraction results to the traffic management ontology library in step S1 and fill them into the preset IF-THEN smart contract template to generate a structured smart contract. S3: Model all structured smart contracts generated in step S2 as a directed acyclic graph. In the directed acyclic graph, nodes represent the rules corresponding to the smart contracts, and edges represent the priority relationships between rules. When multiple rules are detected to be triggered simultaneously and there is a conflict, a breadth-first search algorithm is used to traverse the directed acyclic graph to determine the highest priority rule as the final execution rule. S4: Collect multi-dimensional traffic operation indicators before and after the final execution of the execution rule, and use the double difference method to quantify the execution efficiency of the rule; if the efficiency does not meet the standard, optimize the rule parameters through the near-end strategy optimization reinforcement learning algorithm, update the smart contract and return to step S3 to form a closed-loop optimization mechanism.

[0006] As a further description of the above technical solution: The traffic management ontology library in step S1 supports dynamic updates. By adding new entities, attributes, and relationship definitions, it can adapt to traffic management scenarios with different complex terrains. The ontology library is maintained and called through OWLAPI.

[0007] As a further description of the above technical solution: The IF-THEN smart contract template in step S2 supports dynamic expansion, adding multi-dimensional logical combination conditions and multi-action instructions according to the scenario requirements of the target domain. The template is stored in JSON format.

[0008] As a further description of the above technical solution: The data preprocessing in step S2 includes the following sub-steps: S21: Perform noise reduction processing on natural language rule text to remove irrelevant characters, punctuation marks, and duplicate content; S22: Segment words using the Jieba word segmentation tool in conjunction with a target domain dictionary, and use a named entity recognition model to identify traffic-related entities in the text; S23: By using entity linking technology, the identified entities are normalized and mapped to the standard concepts in the traffic management ontology library to achieve terminology unification; S24: For unstructured text, keywords are extracted using the TF-IDF algorithm and word vectors are generated using the Word2Vec model. For structured traffic data, Z-score normalization is applied to the [0,1] interval.

[0009] As a further description of the above technical solution: The execution process of the BERT-BiLSTM-CRF semantic parsing model in step S2 includes: S2a: Semantically encodes the preprocessed text using the BERT model to generate semantic vectors containing contextual information; S2b: Extracts contextual dependencies from semantic vectors through a BiLSTM layer to capture the association information between entities; S2c: Entity recognition and relation extraction are performed based on domain annotation criteria through the CRF layer, outputting accurate results of entities and relationships between entities.

[0010] As a further description of the above technical solution: The specific process of constructing the directed acyclic graph and resolving conflicts in step S3 includes: S31: Set rule priorities: Emergency rules have higher priority than safety rules, safety rules have higher priority than efficiency rules, and efficiency rules have higher priority than regular rules; S32: Construct a directed acyclic graph of rules using rules as nodes and priority relationships as directed edges, and store it in a graph database; S33: When a conflicting rule is detected, the directed acyclic graph is traversed using a breadth-first search algorithm to find the common ancestor node of all conflicting rules; S34: Select the node with the highest priority from the common ancestor nodes, and the corresponding rule is the final execution rule.

[0011] As a further description of the above technical solution: The multi-dimensional traffic operation indicators in step S4 include accident rate, average vehicle speed, traffic delay time, road congestion frequency, and number of vehicle violations. These indicators are collected in real time through sensor networks and traffic monitoring platforms at a frequency of once per second.

[0012] As a further description of the above technical solution: The formula for the rule execution efficiency quantified by the difference-in-differences method in step S4 is as follows:

[0013] in, Traffic operation indicators for the post-implementation processing group of the rules. Traffic operation indicators for the pre-implementation processing group of the rules. The traffic operation indicators for the control group after the implementation of the rules. Traffic operation indicators for the control group before the implementation of the rules. This is a dummy variable indicating whether the rule should be implemented. For time dummy variables, , , For regression coefficients, This is the error term.

[0014] As a further description of the above technical solution: The process of optimizing rule parameters in the near-end policy optimization reinforcement learning algorithm in step S4 includes: S41: Define the state space as the current traffic state parameters, including vehicle speed, distance between vehicles, weather conditions, and road gradient; S42: Define the action space as a set of rule parameter adjustments, including speed limit, passage time period, prohibition conditions, and passage mode; S43: Design the reward function ,in , , These are the weighting coefficients. This is an indicator of traffic efficiency. For safety indicators, For driving comfort indicators; S44: Optimize policy parameters based on the objective function of the near-end policy optimization algorithm, and update the rule parameters in the smart contract.

[0015] The present invention has the following beneficial effects: 1. Compared with existing technologies, this invention constructs a traffic management ontology library in the target domain, accurately defines traffic-related entities, attributes and interrelationships, and combines dependency parsing and entity linking technologies to accurately map the natural language rules input by managers to a structured IF-THEN smart contract template. This effectively eliminates translation bias caused by semantic ambiguity and polysemy, achieves unambiguous rule conversion and automated deployment, and ensures a high degree of consistency between smart contract execution and management intent.

[0016] 2. Compared with existing technologies, this invention models all deployment rules based on a directed acyclic graph (DAG), using nodes to represent rules and edges to represent priority relationships, thus establishing a clear rule priority system. When multiple rules are triggered simultaneously and conflict under unexpected events, the system can quickly locate the highest-priority common ancestor node by traversing the DAG and output the final execution plan within milliseconds, ensuring the rationality and security of decisions in complex scenarios and improving the timeliness of emergency response.

[0017] 3. Compared with existing technologies, this invention continuously collects multi-dimensional traffic operation indicators before and after rule execution, and uses a causal inference model to accurately quantify the real impact of rules on traffic conditions, providing a scientific and quantifiable decision-making basis for rule optimization. Based on this, it combines reinforcement learning algorithms to explore better policy parameters, achieving closed-loop iterative optimization and dynamic recommendation of rules, and continuously improving traffic management efficiency.

[0018] 4. Compared with existing technologies, this invention constructs a complete technical process covering semantic understanding and contract filling, rule conflict resolution, rule performance evaluation and optimization. Each module works collaboratively through standardized API interfaces, which can flexibly cope with the core needs of diverse natural language rule inputs, frequent multi-rule conflicts and dynamic changes in traffic status in complex terrains such as mountains and plateaus. It has a high level of intelligence and scalability, and can adjust the ontology library and rule templates according to different scenarios to adapt to diverse traffic management scenarios.

[0019] 5. Compared with existing technologies, this invention ensures the accuracy of executed instructions through precise rule parsing, guarantees decision-making safety in emergency scenarios through an efficient conflict resolution mechanism, and continuously improves traffic operation through data-driven performance evaluation and optimization, ultimately achieving the core goals of reducing accident rates and improving traffic efficiency. Furthermore, this technical solution possesses good replicability and scalability, providing a mature technical reference for traffic management in other complex terrain areas and promoting the standardization and large-scale application of intelligent traffic management systems. Attached Figure Description

[0020] Figure 1 This is a schematic diagram of the core process of semantic understanding and contract filling in this invention; Figure 2 This is a schematic diagram of the detection and resolution process for rule conflicts in this invention; Figure 3 This is a schematic diagram of the closed-loop execution process for rule performance evaluation and dynamic optimization in this invention. Detailed Implementation

[0021] This invention provides an ontology-based smart contract parsing method, as detailed below: Traffic Management Ontology Construction The Guizhou Mountainous Transportation Management Ontology Library was constructed using the OWL language and the Protégé tool, as detailed below: Entity definition: Includes 6 core entities: roads, vehicles, weather, drivers, traffic rules, and areas; Attribute definitions: Road attributes (slope: numeric, unit %), visibility: numeric, unit meters; road type: enumerated, including highways, national highways, provincial highways, and rural roads), vehicle attributes (vehicle speed: numeric, unit km / h; vehicle weight: enumerated, including small cars, medium cars, and large cars), weather attributes (weather type: enumerated, including sunny, rainy, foggy, mixed rain and fog, and snow), and traffic rule attributes (rule type: enumerated, including emergency, safety, efficiency, and routine rules). Relationship definition: Located in (road-area), affects (weather-road traffic conditions), triggers (traffic conditions-traffic rules); Derived attribute definition: Dangerous road section = slope > 30% AND visibility < 50 meters, emergency rule = rule type is emergency and trigger condition is traffic accident / extreme weather.

[0022] The ontology library is stored on a cloud server via OWLAPI, and supports the dynamic addition of entities (such as altitude) and attributes (such as snow thickness) to adapt to scene expansion.

[0023] Data Acquisition and Preprocessing Data collection: Natural language rule text: 1,000 rules were collected from the official website of the Guizhou Provincial Department of Transportation and the Mountain Traffic Management Platform through web crawling. The formats include PDF, Word and HTML. Example rules: "In rainy or foggy weather, the speed limit on dangerous road sections shall not exceed 20 kilometers per hour" and "During emergency response to traffic accidents, the emergency lane shall be opened and social vehicles shall be prohibited from occupying it." Traffic data: Vehicle speed, traffic flow, road conditions (dry, wet, icy), meteorological data (visibility, rainfall), and accident record data (accident time, location, and cause) are collected through a sensor network. The data is collected once per second and transmitted to edge nodes via the MQTT protocol.

[0024] Data preprocessing: S21: Noise removal, using regular expressions to remove special characters and delete repeated phrases (such as consecutive occurrences of "obey traffic rules"). S22: Word segmentation and NER. Based on the Jieba word segmentation tool combined with the Guizhou mountainous transportation domain dictionary (containing 2000 professional terms such as dangerous road sections, rainy and foggy weather, emergency lanes, etc.), word segmentation was performed. The pre-trained BERT-NER model was used to identify entities. Example results: rainy and foggy weather (weather entity), dangerous road section (road entity), speed limit (action entity), 20 kilometers per hour (numerical entity). S23: Entity normalization, using entity linking technology to map steep slopes to slopes >30% in the entity, foggy weather to visibility <50 meters, and rescue channels to emergency lanes; S24: Feature processing: The TF-IDF algorithm is used to extract the top 10 keywords from the regular text, and 128-dimensional word vectors are generated by the Word2Vec model; the vehicle speed data is normalized by Z-score, and the processed data is mapped to the [0,1] interval.

[0025] Semantic parsing and smart contract population like Figure 1 As shown, the core process of semantic understanding and contract filling is as follows: natural language rule text input → text preprocessing (denoising, word segmentation, NER) → semantic encoding (BERT model generates semantic vectors) → entity and relation extraction (BiLSTM-CRF model) → ontology mapping (associating with the Guizhou mountainous transportation management ontology) → contract filling (automatically filling in the IF-THEN smart contract template) → outputting a structured smart contract. The specific implementation is as follows: Semantic parsing model training: The BERT-BiLSTM-CRF model was trained using annotated Guizhou mountain traffic rule text (100,000 entries, labeled with entity type and relation type). Training parameters: 100 iterations, learning rate 1e-5, BERT hidden layer dimension 768, BiLSTM hidden layer dimension 256, and CRF layer annotation criterion was IOBES format. Semantic parsing execution: Step 1 (Text Preprocessing): Input the collected natural language rule text, such as "During rainy or foggy weather, the speed limit on dangerous road sections must not exceed 20 kilometers per hour," into the system and press Enter. Figure 1 The process completes noise reduction, word segmentation, and NER processing, and outputs the word segmentation results: rainy / foggy weather, time, dangerous road section, speed limit, must not, exceed, and 20 kilometers per hour. The NER recognition results are: rainy / foggy weather (weather entity), dangerous road section (road entity), speed limit (action entity), and 20 kilometers per hour (numerical entity). The second step (semantic encoding): The preprocessed word segmentation results are input into the BERT model to generate a 768-dimensional semantic vector for each word. The causal relationship between rainy / foggy weather and dangerous road sections is captured through contextual association. The third step (entity and relation extraction): The semantic vector is input into the BiLSTM layer, and the dependencies between entities are extracted through bidirectional propagation, such as rain and fog weather - impact - dangerous road section, speed limit - assignment - 20km / h. The CRF layer outputs the final extraction result based on the domain constraints (such as numerical entities being associated only with the assignment relationship of action entities). Step 4 (Ontology Mapping): The extracted entities and relationships are associated with the Guizhou Mountainous Traffic Management Ontology Database. Dangerous road sections are mapped to slopes >30% and visibility <50 meters, and rainy / foggy weather is mapped to weather type = rain / foggy. Step 5 (Contract Population): The mapping results are automatically populated into the preset IF-THEN smart contract template to generate a structured smart contract. The template supports dynamic expansion and can add multi-dimensional logical combination conditions and multi-action instructions according to the scenario requirements of the target domain.

[0026] Construction and conflict resolution of rule-based directed acyclic graphs like Figure 2 As shown, the rule conflict detection and resolution process is as follows: rule deployment → constructing a directed acyclic graph of rule priorities → real-time monitoring of rule triggering status → are there conflicting rules? (No → execute all triggering rules; Yes → breadth-first search traverses the directed acyclic graph to find the common ancestor of conflicting rules → filter the highest priority common ancestor → output the final execution rule). The specific implementation is as follows: Construction of directed acyclic graph: S31: Prioritize rules according to the following order: emergency rules > safety rules > efficiency rules > routine rules. For example, the rule for opening emergency lanes in traffic accidents (emergency) has a higher priority than the rule for speed limits on dangerous road sections (safety), the rule for speed limits on dangerous road sections has a higher priority than the rule for lane optimization during peak hours (efficiency), and the rule for lane optimization during peak hours has a higher priority than the rule for daily speed limit of 60km / h (routine). S32: Using 500 structured smart contracts as nodes and priority relationships as directed edges, store the directed acyclic graph in the Neo4j graph database. For example, establish a directed edge between the emergency lane opening rule and the rule prohibiting the use of the emergency lane: emergency lane opening rule → prohibiting the use of the emergency lane rule, clearly indicating that the former has a higher priority. Conflict resolution examples: A traffic accident occurred on a mountain road (triggering the emergency lane opening rule: the emergency lane is opened, allowing rescue vehicles to pass). Simultaneously, this road section is a dangerous section, and the current weather is rainy and foggy (triggering the dangerous road speed limit rule: speed limit 20km / h). The system proceeds as follows: Figure 2 Conflict resolution process: Step 1 (Conflict Detection): Real-time monitoring shows that the trigger conditions for both the emergency lane opening rule and the regular rule prohibiting the use of the emergency lane are met, indicating an execution conflict. The second step (breadth-first search traversal of the directed acyclic graph): call the breadth-first search algorithm to traverse the directed acyclic graph of rules, find the common ancestor node of two conflicting rules, and determine the common ancestor as the general rule for traffic emergency management through traversal; Step 3 (Priority Filtering): Filter the highest priority node from the child nodes of the common ancestor node's general traffic emergency management rules, i.e., the emergency lane opening rules; Step 4 (Output Execution Rules): The final execution rule is to open the emergency lane, allowing rescue vehicles to pass, prohibiting other vehicles from occupying it, and simultaneously enforcing a speed limit of 20km / h on dangerous road sections. The entire conflict resolution process takes 35 milliseconds, meeting the millisecond-level emergency response requirements.

[0027] Rule effectiveness evaluation and optimization like Figure 3 As shown, the closed-loop execution process for rule performance evaluation and dynamic optimization is as follows: Collect rule execution data (accident rate, average vehicle speed, etc.) → Performance evaluation (difference-in-differences criterion inference to quantify rule impact) → Does the rule performance meet the standard? (Yes → Maintain current rule parameters; No → Parameter optimization (near-end policy optimization reinforcement learning to adjust rule parameters) → Output optimized rules and associate them with the rule set → Return to the rule deployment stage). The specific implementation is as follows: Indicator Collection: The hazardous road section was selected as the treatment group, and adjacent non-hazardous road sections with similar conditions (same slope and road type) were selected as the control group. Multi-dimensional traffic operation indicators were collected (before the rule was implemented) and (after the rule was implemented), as detailed in Table 1: Table 1 shows the multi-dimensional traffic operation indicators.

[0028] Efficiency quantification (dual difference model): according to Figure 3 The process is evaluated for effectiveness by substituting the formula into the difference-in-differences method. The accident rate improvement effect was calculated as follows: ΔY (accident rate) = (0.2-0.8)-(0.6-0.7) = -0.5, meaning that the accident rate of the processing group was reduced by an additional 0.5 times / 10,000 kilometers compared to the control group after the rule was implemented, thus accurately quantifying the safety effectiveness of the rule; the traffic delay time improvement effect was calculated as follows: ΔY (traffic delay) = (6-8)-(6.5-7) = -1.5, meaning that the traffic delay was reduced by an additional 1.5 minutes compared to the control group; Rule optimization: Based on assessment, the passage delay time (6 minutes) did not meet the management target (≤5 minutes), therefore... Figure 3 Process initiation PPO reinforcement learning optimization: S41: Define the state space S={vehicle speed: 25km / h, vehicle distance: 50m, weather: rain / fog, visibility: 40m, slope: 35%}; S42: Define the action space A = {speed limit 15km / h, speed limit 20km / h, speed limit 25km / h, one-way traffic, two-way alternating traffic}; S43: Design the reward function Set weight coefficients =0.3 (efficiency) =0.5 (safety) =0.2 (Comfort), calculate the reward value for each action: the reward value for speed limit 20km / h + two-way alternating traffic is the highest (r=0.3×0.7+0.5×0.9+0.2×0.8=0.82). S44: Optimize strategy parameters based on the PPO algorithm objective function and update the smart contract: associate the optimized rules with the rule set, return to the rule deployment stage, and form a closed loop. After one month of trial operation following optimization, the processing group's traffic delay time was reduced to 4.8 minutes, meeting the target requirements, and the accident rate was maintained at 0.2 incidents per 10,000 kilometers, achieving a dynamic balance between safety and efficiency.

[0029] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A smart contract parsing method based on ontology, characterized in that, Includes the following steps: S1: Construct a traffic management ontology library for the target domain. Use the OWL language to define entities, attributes and relationships between entities in the ontology. The entities include roads, vehicles, weather and drivers. The attributes include slope, visibility, vehicle speed and accident rate. The relationships include location, influence and trigger. Location is associated with roads and regions. Influence is associated with weather and road conditions. Trigger is associated with traffic conditions and traffic rules. S2: Collect natural language rule text and multi-dimensional traffic data in the target domain. After data preprocessing, input the data into the BERT-BiLSTM-CRF semantic parsing model to extract entities and relations. Map the extraction results to the traffic management ontology library in step S1 and fill them into the preset IF-THEN smart contract template to generate a structured smart contract. S3: Model all structured smart contracts generated in step S2 as a directed acyclic graph. In the directed acyclic graph, nodes represent the rules corresponding to the smart contracts, and edges represent the priority relationships between rules. When multiple rules are detected to be triggered simultaneously and there is a conflict, a breadth-first search algorithm is used to traverse the directed acyclic graph to determine the highest priority rule as the final execution rule. S4: Collect multi-dimensional traffic operation indicators before and after the execution of the final execution rule, and use the double difference method to quantify the rule execution efficiency; If the performance does not meet the target, the rule parameters are optimized by using a near-end strategy optimization reinforcement learning algorithm, the smart contract is updated, and the process returns to step S3, forming a closed-loop optimization mechanism.

2. The ontology-based smart contract parsing method according to claim 1, characterized in that, The traffic management ontology library in step S1 supports dynamic updates. By adding new entities, attributes, and relationship definitions, it can adapt to traffic management scenarios with different complex terrains. The ontology library is maintained and called through OWLAPI.

3. The ontology-based smart contract parsing method according to claim 1, characterized in that, The IF-THEN smart contract template in step S2 supports dynamic expansion, adding multi-dimensional logical combination conditions and multi-action instructions according to the scenario requirements of the target domain. The template is stored in JSON format.

4. The ontology-based smart contract parsing method according to claim 1, characterized in that, The data preprocessing in step S2 includes the following sub-steps: S21: Perform noise reduction processing on natural language rule text to remove irrelevant characters, punctuation marks, and duplicate content; S22: Segment words using the Jieba word segmentation tool in conjunction with a target domain dictionary, and use a named entity recognition model to identify traffic-related entities in the text; S23: By using entity linking technology, the identified entities are normalized and mapped to the standard concepts in the traffic management ontology library to achieve terminology unification; S24: For unstructured text, keywords are extracted using the TF-IDF algorithm and word vectors are generated using the Word2Vec model. For structured traffic data, Z-score normalization is applied to the [0,1] interval.

5. The ontology-based smart contract parsing method according to claim 1, characterized in that, The execution process of the BERT-BiLSTM-CRF semantic parsing model in step S2 includes: S2a: Semantically encodes the preprocessed text using the BERT model to generate semantic vectors containing contextual information; S2b: Extracts contextual dependencies from semantic vectors through a BiLSTM layer to capture the association information between entities; S2c: Entity recognition and relation extraction are performed based on domain annotation criteria through the CRF layer, outputting accurate results of entities and relationships between entities.

6. The ontology-based smart contract parsing method according to claim 1, characterized in that, The specific process of constructing the directed acyclic graph and resolving conflicts in step S3 includes: S31: Set rule priorities: Emergency rules have higher priority than safety rules, safety rules have higher priority than efficiency rules, and efficiency rules have higher priority than regular rules; S32: Construct a directed acyclic graph of rules using rules as nodes and priority relationships as directed edges, and store it in a graph database; S33: When a conflicting rule is detected, the directed acyclic graph is traversed using a breadth-first search algorithm to find the common ancestor node of all conflicting rules; S34: Select the node with the highest priority from the common ancestor nodes, and the corresponding rule is the final execution rule.

7. The ontology-based smart contract parsing method according to claim 1, characterized in that, The multi-dimensional traffic operation indicators in step S4 include accident rate, average vehicle speed, traffic delay time, road congestion frequency, and number of vehicle violations. These indicators are collected in real time through sensor networks and traffic monitoring platforms at a frequency of once per second.

8. The ontology-based smart contract parsing method according to claim 1, characterized in that, The formula for the rule execution efficiency quantified by the difference-in-differences method in step S4 is as follows: in, Traffic operation indicators for the post-implementation processing group of the rules. Traffic operation indicators for the pre-implementation processing group of the rules. The traffic operation indicators for the control group after the implementation of the rules. Traffic operation indicators for the control group before the implementation of the rules. This is a dummy variable indicating whether the rule should be implemented. For time dummy variables, , , For regression coefficients, This is the error term.

9. The ontology-based smart contract parsing method according to claim 1, characterized in that, The process of optimizing rule parameters in the near-end policy optimization reinforcement learning algorithm in step S4 includes: S41: Define the state space as the current traffic state parameters, including vehicle speed, distance between vehicles, weather conditions, and road gradient; S42: Define the action space as a set of rule parameter adjustments, including speed limit, passage time period, prohibition conditions, and passage mode; S43: Design the reward function ,in , , These are the weighting coefficients. This is an indicator of traffic efficiency. For safety indicators, For driving comfort indicators; S44: Optimize policy parameters based on the objective function of the near-end policy optimization algorithm, and update the rule parameters in the smart contract.