Five-prevention logic specification text automatic conversion method

Through the automatic text conversion method of five-prevent logic specifications, the problems of manual dependence and inefficiency in the existing technology are solved through the automatic text conversion method of five-prevent logic specifications, and the fully automatic analysis of five-prevent logic specifications is realized. and optimize, improving the operating safety and reliability of the power system.

CN118940726APending Publication Date: 2024-11-12XIANGYANG POWER SUPPLY COMPANY OF STATE GRID HUBEI ELECTRIC POWER
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410996739.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-24
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

The existing five-defense logic specification management methods rely on manual writing and review, which are inefficient, cannot achieve automation and real-time monitoring, and are difficult to cope with complex and dynamic power system operating environments, and poses safety hazards.

Method used

Adopt the five-prevent logic specification automatic text conversion method, and realize fully automatic analysis and optimization through preprocessing, hash embedding, semantic annotation, hypergraph convolutional network and other technologies, generate computable logic rules, and improve the degree of automation and semantic understanding ability. .

Benefits of technology

It significantly improves the degree of automation and efficiency of standardized management, ensures the accuracy and consistency of logical rules, enhances the operational safety and reliability of the power system, and can respond to equipment and environmental changes in a timely manner.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118940726A_ABST
    Figure CN118940726A_ABST
Patent Text Reader

Abstract

The invention provides a five-prevention logic specification text automatic conversion method, which comprises the following steps of: 1, preprocessing a five-prevention logic specification text, segmenting the five-prevention logic specification text into a plurality of sentences, and screening out sentences with quantitative requirements as preprocessing results; 2, performing Hash embedding on the preprocessing result, and converting a text corresponding to a sentence in the preprocessing result into a low-dimensional vector with a fixed length; step 3, based on the low-dimensional vector, performing semantic annotation on the low-dimensional vector corresponding to each sentence to generate a semantic tag sequence; 4, converting the semantic tag sequence of the sentence into a hypergraph structure to capture a high-order relationship; and 5, based on the enhanced semantic feature matrix, generating a computable logic rule. According to the invention, the management and execution efficiency of the five-prevention logic specification can be obviously improved, and the safety and reliability of a power system are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of power system text processing, and in particular to a method for automatic conversion of five-defense logic specification text. Background Art

[0002] The five-defense logic specification is an important safety measure in the power system, which aims to prevent five typical misoperations, including misclosing, misdisconnecting, misentering, misconnecting, and misdetecting. With the continuous development of power systems, especially the advancement of smart grids and industrial automation, the management and implementation of the five-defense logic specification are facing higher and higher requirements. However, the existing five-defense logic specification management method has certain deficiencies in automation and intelligence, and cannot fully meet the needs of modern power systems.

[0003] The existing five-defense logic specifications are mainly carried out by manually writing and reviewing text specifications. These specification documents usually contain detailed operating procedures, precautions and safety measures, which are intended to guide operators to correctly perform various operations to prevent misoperation. However, this manual writing and management method has the following major problems: Since the specification text needs to be written and reviewed by experienced professionals, this process is often time-consuming and labor-intensive. In the power system, the equipment and operating environment may change at any time, and the manual writing and updating of specification texts is difficult to respond to these changes in a timely manner, which may lead to safety hazards. Manually written specification texts may be inconsistent in content and format, and specifications written by different personnel may be different, and even inconsistencies may exist in the same specification. This not only increases the difficulty for operators to understand and implement the specifications, but may also lead to misoperation. The existing five-defense logic specification management method mainly relies on manual execution and inspection, and lacks effective automation means. This method is not only inefficient, but also cannot achieve real-time monitoring and automatic correction of the operation process, and it is difficult to cope with complex and dynamic operating environments. Summary of the invention

[0004] The purpose of the present invention is to overcome the above-mentioned shortcomings of the prior art and provide a method for automatic conversion of five-defense logic specification texts, which realizes the full-automatic parsing, generation and optimization of five-defense logic specifications. The method significantly improves the automation and efficiency of specification management, enhances the semantic understanding ability, improves the adaptability and robustness of the system, ensures the accuracy and consistency of the generated logic rules, and thus improves the operational safety and reliability of the power system.

[0005] The technical solution adopted by the present invention is: a method for automatically converting five-defense logic standard texts, comprising:

[0006] Step 1: Preprocess the five-defense logic specification text, split it into multiple sentences, and filter out the sentences containing quantitative requirements as the preprocessing results;

[0007] Step 2: Hash embedding is performed on the preprocessing results to convert the text corresponding to the sentences in the preprocessing results into a low-dimensional vector of fixed length;

[0008] Step 3: Based on the low-dimensional vector, semantically annotate the low-dimensional vector corresponding to each sentence to generate a semantic label sequence;

[0009] Step 4: Convert the semantic label sequence of the sentence into a hypergraph structure to capture high-order relationships; use the hypergraph convolutional network to perform convolution operations on the hypergraph to enhance the semantic features and obtain the enhanced semantic feature matrix;

[0010] Step 5: Generate computable logical rules based on the enhanced semantic feature matrix.

[0011] Furthermore, step 1 specifically includes: dividing the five-defense logic specification text into multiple sentences using semicolons, periods or line breaks as delimiters; screening each sentence to screen out sentences containing quantitative requirements, and forming a sentence set of the screened sentences as a preprocessing result; wherein, sentences containing quantitative requirements are defined as sentences containing the following elements: numbers, units of measurement and / or comparison operators.

[0012] Furthermore, let the preprocessing result be S = {s i |i∈[1,N],len(s i )>0}; where S represents a sentence set, s i represents the i-th sentence, N represents the total number of sentences, len(s i ) represents sentence s i length; in step 2, for sentence s i Use the following formula to perform hash embedding and convert it into a low-dimensional vector of fixed length:

[0013]

[0014] Where k is the number of hash functions; m represents sentence s i The number of characters or words in the hash function. j and l are both subscripts. The hash function is expressed using the following formula:

[0015] h j (x il )=(a j ·x il +b j )mod(p);

[0016] Among them, h j (x il ) is a hash function; x il Indicates subi The ASCII code of the first character or word in a j and b j are the parameters of the jth hash function, which are random values; p is a large prime number, which is used for modular operation to ensure uniform distribution of hash values; Indicates i The first character or word in In sentence s i The frequency of occurrence in Indicates i The first character or word in Frequency of occurrence in all sentences; μ i and σ i Respectively represent the sentence s i The mean and standard deviation of the character or word position in H(s i ) is the hash embedding vector, which is expressed using the following formula:

[0017]

[0018] Among them, w il Indicates sentence s i The weight of the lth character or word in is the preset value.

[0019] Furthermore, based on the low-dimensional vector, the BERT model is used to semantically annotate the low-dimensional vector corresponding to each sentence to generate a semantic label sequence.

[0020] Furthermore, after the semantic label sequence of the sentence is converted into a hypergraph structure in step 4, the hypergraph structure is represented by the following formula:

[0021]

[0022] Among them, G(T(s i )) is the sentence s i The semantic label sequence of ; H is the hyperedge set; E is the hypergraph edge set; V is the node set; n is the sentence s i The number of labels in v j is the node corresponding to the jth label; sim(u,v) represents the semantic similarity between node u and node v; hyperedge h k is a subset of the node set V; |h k |≥3 indicates a hyperedge h k Contains at least 3 nodes; |h k | represents the hyperedge h k The number of nodes contained in e ij Represents the connection node v i and v j The edge of sim(v i ,vj )>τ represents node v i and v j The similarity between them is greater than the preset threshold τ; It means calculating the average similarity between all node pairs of the hyperedge w(h k ); u and v represent hyperedge h k Any two nodes in d i and d j Respectively represent the node v i and v j degree; A ij are the elements of the adjacency matrix A.

[0023] Furthermore, suppose that the hypergraph G(T(s i ))’s input feature matrix is ​​X=[x1,x2,…,x n ] T , where each x j Represents node v j In the hypergraph convolution operation, a multi-head self-attention mechanism is introduced to capture the relationship between nodes. The formula is as follows:

[0024]

[0025] Where Q = XW Q , K = XW K , V = XW V denote the query vector, key vector and value vector respectively, W Q ,W K ,W V is the weight matrix of the attention mechanism, d k is the dimension of the key vector;

[0026] Attention s (Q, N, V) represents the sth attention head; s is an integer subscript index; combining the multi-head self-attention mechanism and hypergraph convolution, the output of the hypergraph convolution layer is defined as the node feature matrix H (l+1) ; In order to enhance feature representation, a high-dimensional feature fusion mechanism is introduced. The following formula is used to further extract node features through high-order tensor operations to obtain the enhanced node feature matrix F (l+1) :

[0027]

[0028] Where T represents high-order tensor operations, represents the tensor product, KGE(H (l) ) is the node feature matrix after knowledge graph embedding.

[0029] Furthermore, the output H of the hypergraph convolutional layer(l+1) , calculated using the following formula:

[0030]

[0031] Among them, H (l) represents the node feature matrix of the lth layer, is the node feature of the jth node; is the hyperedge h k The degree matrix of is the hyperedge h k adjacency matrix, M represents the number of attention heads, W (l) is the convolution weight matrix of the lth layer, σ is the activation function; the node features of each node in the node feature matrix are aggregated and updated using the following formula to obtain the aggregated and updated results

[0032] in, Represents node v i The set of neighbor nodes, d i Represents node v i degree, λ is the regularization parameter; H(i) is the node v i The set of all hyperedges of ; Represents the hyperedge h g Middle node v j The reciprocal of the degree.

[0033] Furthermore, in step 5, based on the enhanced semantic feature matrix, the enhanced semantic features of each node are extracted; based on the semantic features, the semantic similarity between the nodes is calculated to determine the semantically related node pairs; based on the semantic relationship between the nodes, logical rules in the form of conditional statements are defined; the logical rules are converted into a formalized logical representation, and then computable logical rules are generated.

[0034] Furthermore, the method also includes: Step 6: optimizing the generated logical rules through an optimal transmission method of entropy regularization.

[0035] On the other hand, the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the above-mentioned method for automatic conversion of five-defense logic standard text is implemented.

[0036] The five-defense logic specification text automatic conversion method provided by the present application realizes the fully automatic parsing and conversion of the five-defense logic specification text, greatly improving the degree of automation. Traditional five-defense logic specification management relies on manual writing and review, which is not only time-consuming and labor-intensive, but also prone to human errors. Through the method of the present invention, the specification text can be automatically preprocessed, semantically annotated, feature extracted and rule generated, greatly reducing the necessity of manual intervention. This automated processing method not only improves work efficiency, but also ensures the timely update and accuracy of the specification, especially in dealing with rapidly changing operating environments and equipment states. It has obvious advantages. The present invention uses natural language processing technology to deeply parse the semantic information in the five-defense logic specification text. Through the multi-head self-attention mechanism and hypergraph convolutional network, the system can capture the complex semantic relationships and contextual dependencies in the text, and generate accurate semantic label sequences and feature matrices. This deep semantic understanding capability enables the system to accurately identify and parse the key operating conditions and safety measures in the specification, ensuring that the generated logical rules can fully reflect the actual content and requirements of the text. This not only improves the accuracy and reliability of the rules, but also enhances the ability of the system to process complex and long-sentence specification texts. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The technical solution and other beneficial effects of the present application will be made apparent by describing in detail the specific implementation methods of the present application in conjunction with the accompanying drawings.

[0038] Figure 1 A flow chart of the method for automatic conversion of five-defense logic standard text provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0039] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0040] Example 1: Reference Figure 1 , a five-defense logic standard text automatic conversion method, the method comprising:

[0041] Step 1: Preprocess the five-defense logic specification text, split it into multiple sentences, and filter out the sentences containing quantitative requirements as the preprocessing results;

[0042] The first step of preprocessing is to segment the text, dividing a whole complex five-defense logic specification text into independent sentences. This process relies on natural language processing (NLP) technology, which enables the text to be accurately segmented into multiple sentences by identifying punctuation marks in the text, such as periods, commas, and semicolons, and using semantic-based segmentation algorithms. The segmented sentences, as independent information units, can be more easily processed and analyzed later. After the sentence segmentation is completed, the next step is to filter out sentences containing quantitative requirements. The purpose of this step is to extract sentences containing specific values ​​and units, because these sentences usually contain important regulatory information and constraints. To achieve this goal, common methods include using regular expressions and keyword matching technology. Regular expressions are a powerful text matching tool that can accurately identify sentences containing numbers and units. For example, quantitative descriptions such as "10kV" or "5mA" can be matched by regular expressions. Keyword matching technology uses a predefined series of keyword lists, such as "voltage", "current", "temperature", etc., to filter sentences and identify sentences containing these keywords. The preprocessing step is not just about mechanically segmenting and filtering the text, but also involves a preliminary understanding and parsing of the text. By segmenting the sentences, the complex text structure can be simplified into smaller units that are easier to handle, and by filtering out the sentences with quantitative requirements, the key information can be further extracted, so that the subsequent processing steps can focus more on the key content. This process not only improves the processing efficiency, but also provides high-quality input data for subsequent steps such as hash embedding and semantic annotation. In addition, the preprocessing step can also help eliminate noise and redundant information in the text. The five-defense logic specification text often contains a lot of explanatory and background content, which, although helpful in understanding the overall specification, may add unnecessary complexity when automatically converting and calculating logical rules. Through the preprocessing step, these redundant information can be filtered out, and only those sentences with practical significance and quantitative requirements are retained, thereby simplifying the subsequent processing process.

[0043] Step 2: Hash embedding is performed on the preprocessing results to convert the text corresponding to the sentences in the preprocessing results into a low-dimensional vector of fixed length;

[0044] First, each sentence is converted into a word vector through natural language processing (NLP) technology. This step is the first step to convert text data into computable numerical data. Common methods include word vector models such as Word2Vec and GloVe. These models can map vocabulary into a high-dimensional vector space through a large amount of corpus training, so that similar words are close to each other in the vector space. In this way, each sentence can be represented as a set of word vectors. However, directly using these high-dimensional vectors for processing will result in excessive computational complexity, making it difficult to achieve efficient processing and calculation. In order to reduce computational complexity, hash embedding technology came into being. Hash embedding maps high-dimensional word vectors to low-dimensional vectors of fixed length through hash functions. Locality sensitive hashing (LSH) is one of the commonly used hashing methods, which can significantly reduce the dimension of vectors while maintaining vector similarity. Through LSH, the word vector set of a sentence is compressed into a low-dimensional vector of fixed length, which not only reduces the storage requirements of data, but also greatly improves the efficiency of subsequent processing. In the five-defense logical standard text automatic conversion method, the application of hash embedding also needs to take into account the specific structure and semantic information of the text. The five-defense logic specification text usually contains a large number of technical terms and specific logical structures, which must be retained and reflected in the hash embedding process. Therefore, when designing the hash function, special attention should be paid to the processing of technical terms and logical relationships to ensure that they can still be accurately represented and identified in the low-dimensional vector. Through hash embedding, the preprocessed sentences are converted into low-dimensional vectors of fixed length. These vectors not only retain the semantic information and logical structure of the original text, but also provide standardized data input for subsequent semantic annotation and hypergraph convolutional network processing. The unified format of the low-dimensional vector enables the subsequent processing steps to be carried out in an efficient computing environment, thereby achieving the efficiency and accuracy of the entire five-defense logic specification text automatic conversion method. Another major advantage of hash embedding is its robustness to data noise. In practical applications, the five-defense logic specification text may contain some noise and redundant information. Through hash embedding, this noise information is effectively filtered and compressed, further improving the quality of the data and the reliability of processing. This step is not only a simple dimensional compression process, but also a process of optimizing and enhancing the data.

[0045] Step 3: Based on the low-dimensional vector, semantically annotate the low-dimensional vector corresponding to each sentence to generate a semantic label sequence;

[0046] The low-dimensional vector has compressed the semantic information of the original text through hash embedding and retained it in a fixed-length vector. Although these vectors are low-dimensional, they still contain the core semantic information and logical structure of the sentence. The task of semantic annotation is to further extract and annotate the semantic components in each sentence based on these low-dimensional vectors, so that the system can better understand the meaning and logical relationship of the sentence. The process of semantic annotation usually involves multiple steps. First, the low-dimensional vector is parsed to identify the individual words and phrases in it. Then, a part-of-speech tag is assigned to each word through a pre-trained part-of-speech tagging model (such as a POS tag model), such as noun, verb, adjective, etc. These tags help the system understand the basic grammatical structure of the sentence. On this basis, semantic role labeling (SRL) is further performed to assign each word its semantic role in the sentence. For example, a verb in a sentence may represent a certain operation, while a noun may represent the object or target of the operation. Semantic annotation is particularly important in the five-defense logic standard text, because these texts often contain complex technical terms and specific logical structures. Through semantic annotation, these technical terms and logical relationships can be clearly marked, so that the system can accurately capture the key information in the sentence. For example, a sentence may describe the operating conditions of an electrical device. Through semantic annotation, key terms such as "voltage" and "current" can be annotated as specific semantic roles, so that the system can understand the specific meaning of these terms in the sentence. Semantic annotation is not just a simple label assignment process, but also a process of in-depth understanding and parsing of the text. In the automatic conversion method of five-defense logic specification text, the semantic label sequence generated by semantic annotation will serve as the basis for subsequent hypergraph structure generation. By annotating each component of the sentence with a specific semantic label, the logical relationship and structural information in the sentence can be better reflected. These semantic label sequences not only contain the basic grammatical information of the sentence, but also the semantics and logical relationship of the sentence, so that the subsequent hypergraph convolutional network processing can more accurately capture the core information of the sentence. In addition, semantic annotation also has the function of improving the processing efficiency and accuracy of the system. By assigning clear semantic labels to each component of the sentence, ambiguity and misunderstanding in the processing process can be reduced, and the overall processing accuracy of the system can be improved. Especially when processing complex five-defense logic specification text, semantic annotation can help the system more accurately identify and parse the key information in the sentence, thereby generating more reliable and effective logical rules.

[0047] Step 4: Convert the semantic label sequence of the sentence into a hypergraph structure to capture high-order relationships; use the hypergraph convolutional network to perform convolution operations on the hypergraph to enhance the semantic features and obtain the enhanced semantic feature matrix;

[0048] Hypergraph is an extended form in graph theory. Unlike traditional graphs, a hyperedge in a hypergraph can connect more than two vertices. This structure is particularly suitable for capturing complex multivariate relationships, not just binary relationships. In the five-defense logic specification text, the semantic components in a sentence are often not just simple binary relationships (such as subject-predicate-object structures), but complex relationships containing multiple elements. For example, an operating condition may involve multiple elements such as equipment status, voltage value, operating action, and safety measures. Traditional graph structures are difficult to effectively represent these complex relationships, while hypergraph structures can solve this problem well. In the specific implementation, the semantic label sequence is first converted into a hypergraph structure. Assume that a sentence generates multiple semantic labels through semantic annotation, and these labels represent the various components in the sentence and their semantic roles. By taking these labels as vertices of the hypergraph and constructing hyperedges based on the relationships between them, a hypergraph structure can be formed. For example, the sentence "When the voltage of the equipment reaches 10kV, the power supply should be disconnected immediately to prevent overload" can be converted into a hypergraph, with vertices including "equipment", "voltage", "10kV", "disconnect", "power supply", "prevent", "overload", etc., and hyperedges connecting these vertices to represent the relationship between them. Next, a hypergraph convolutional network (HGCN) is used to perform convolution operations on the hypergraph. HGCN is an extended model based on convolutional neural network (CNN) specifically designed for processing hypergraph data. Unlike traditional convolutional neural networks, HGCN is able to perform convolution operations on hypergraph structures to capture the complex relationships between vertices and their adjacent vertices. Through this convolution operation, the semantic features in the sentence can be further extracted and enhanced. Specifically, HGCN extracts and aggregates features for each vertex and its adjacent vertices by sliding the convolution kernel on the hypergraph structure. This operation can capture high-order semantic relationships and logical structures in the sentence. For example, in the above sentence, HGCN can extract the complex relationships between vertices such as "equipment", "voltage", "10kV" and their adjacent vertices by performing convolution operations, thereby generating a richer semantic feature matrix. Through this convolution operation, the vertices in the hypergraph can not only retain their own semantic information, but also form an enhanced semantic feature matrix by aggregating the information of adjacent vertices. This matrix contains all the important information and logical relationships in the sentence, providing a solid foundation for the subsequent generation of computable logical rules. The hypergraph convolutional network has significant advantages in processing five-defense logic specification texts. Since the five-defense logic specification texts often contain complex technical terms and multi-dimensional relationships, traditional processing methods are difficult to effectively capture this information. By converting sentences into hypergraph structures and using HGCN for convolution operations, the semantics and logical structure of sentences can be understood and parsed at a higher dimension, ensuring that the generated logical rules are more accurate and effective.

[0049] Step 5: Generate computable logical rules based on the enhanced semantic feature matrix.

[0050] The rich semantic features and structured data generated in the previous steps can be transformed into specific and operational logic rules, which can be directly applied in actual operations to ensure the strict implementation and safety of the five-prevention logic. In order to elaborate on the specific implementation of step 5, an actual five-prevention logic specification text example is used for illustration. Assume that such a five-prevention logic specification text sentence has been processed through the first four steps: "When the equipment voltage reaches 10kV, the power supply should be disconnected immediately to prevent overload." After the previous preprocessing, hash embedding, semantic annotation and hypergraph convolutional network processing, an enhanced semantic feature matrix has been obtained. This matrix contains all the key information and logical relationships of the sentence. In step 5, this semantic feature matrix needs to be converted into specific logic rules. First, by parsing the semantic feature matrix, the key components and their relationships in the sentence are extracted. For the above sentence, the feature matrix may contain the following information: voltage (10kV), action (disconnection), object (power supply), purpose (prevent overload), etc. This information is the basis for generating logic rules. Next, the framework of the logic rules needs to be defined. Logical rules usually include conditions, actions and goals. In this example, the condition is "voltage reaches 10kV", the action is "disconnect power", and the goal is "prevent overload". These elements are combined together through logical connectives to form a complete rule. In order to convert these elements into computable logical rules, it is necessary to convert the natural language description into a logical expression. For example, the condition "voltage reaches 10kV" can be converted into "ifvoltage==10kV", the action "disconnect power" can be converted into "disconnect(power)", and the goal "prevent overload" can be converted into "prevent(overload)". These logical expressions are specific instructions that the computer system can understand and execute. In this process, the semantic feature matrix provides rich contextual information to ensure the accuracy and rationality of each logical expression. For example, through the relationship information in the feature matrix, the causal relationship between the condition "voltage reaches 10kV" and the action "disconnect power" can be determined, thereby ensuring the correctness of the logical rule. Further, these logical expressions need to be integrated into a complete rule set. The rule set can take many forms, including rule trees, decision tables, and logic diagrams. The specific form depends on the application scenario and requirements. In this example, the logical rules can be integrated into a simple rule tree:

[0051] if(voltage==10kV){

[0052] disconnect(power);

[0053] prevent(overload);

[0054] }

[0055] This rule tree structure is clear and easy to execute and maintain. In this way, not only the complex natural language text is converted into computable logical rules, but also the accuracy and executability of the rules are ensured. Finally, the generated logical rules are verified and optimized to ensure their effectiveness and reliability in actual operation. The verification process includes simulating various operation scenarios to ensure that the rules can be correctly executed in different situations. At the same time, by optimizing the algorithm, the execution efficiency of the rules is further improved to ensure that the system can still operate stably under high load. In short, the implementation of step 5 is the key link of the automatic conversion method of the five-defense logic specification text. By converting the enhanced semantic feature matrix into specific logical rules, the complete conversion from natural language text to operational logic can be achieved. This process not only depends on the rich semantic features and structured data generated in the previous steps, but also needs to be combined with actual application scenarios to ensure that the generated logical rules can be executed efficiently and accurately in actual operations. In this way, the automatic conversion method of the five-defense logic specification text can provide strong support for industrial operation and safety management, and ensure the strict implementation of the five-defense logic and operational safety.

[0056] Specifically, suppose there is a five-defense logic specification text sentence as follows: "When the equipment voltage reaches 10kV, the power supply should be disconnected immediately to prevent overload." For this sentence, it is first converted into a low-dimensional vector through hash embedding technology, but in order to illustrate the process of semantic annotation, the original text will be used directly for example. First, the sentence is segmented and preprocessed to extract the complete sentence structure.

[0057] "When the equipment voltage reaches 10kV, the power supply should be disconnected immediately to prevent overload." Next, assign part-of-speech tags to each word in the sentence. Common part-of-speech tags include noun (NN), verb (VB), adjective (JJ), etc. The following is the part-of-speech tagging result of this sentence:

[0058] IN-preposition

[0059] Equipment (NN) - Noun

[0060] Voltage (NN) - Noun

[0061] reach (VB)-verb

[0062] 10kV(CD)-Number

[0063] Time (NN) - Noun

[0064] SHOULD (MD) - modal verb

[0065] Immediately (RB) - adverb

[0066] Disconnect (VB)-verb

[0067] Power (NN) - Noun

[0068] IN-preposition

[0069] prevent (VB) - verb

[0070] Overload (NN) - Noun

[0071] Based on the part-of-speech tagging, each word is assigned a semantic role. This step can identify the semantic function of each component in the sentence. The following is the result of semantic role tagging of the sentence:

[0072] Temporal-time adverbial

[0073] Agent

[0074] Voltage (Attribute)

[0075] Reach (Predicate)

[0076] 10kV(Value)

[0077] Temporal-time adverbial

[0078] Modal

[0079] Immediately (Temporal) - time adverbial

[0080] Disconnect (Action)

[0081] Power source (Object) - Receiver

[0082] Purpose

[0083] Prevent (Action)

[0084] Overload (Condition)

[0085] Through semantic annotation, each component of the original sentence is annotated with a specific semantic role, so that the system can accurately understand the key information and logical relationships in the sentence. The following is the semantic annotation result of the sentence:

[0086] Temporal - indicates a temporal adverbial, describing the time conditions for an action to occur.

[0087] Agent - Represents the doer, indicating the subject of the action, that is, the voltage-related device.

[0088] Attribute - Represents the attribute, specifically referring to the voltage of the device.

[0089] Predicate - Represents the predicate, the main verb describing the action or state.

[0090] 10kV (Value) - Represents the numerical value, specifically referring to the voltage value reached.

[0091] Temporal - Again represents the adverbial of time, together with the previous "at" to form a complete time condition.

[0092] Modal - Represents the modal verb, indicating that the following action is a suggestion or command.

[0093] Temporal - Represents the adverbial of time, further emphasizing the urgency of the action.

[0094] Action - Represents the action, referring to the specific operation of disconnecting the power supply.

[0095] Object - Represents the patient, specifically referring to the object to be disconnected, that is, the power supply.

[0096] Purpose - Represents the purpose, explaining the reason or purpose of the action.

[0097] Action - Represents the action, specifically referring to the operation of preventing overload.

[0098] Condition - Represents the situation, explaining the specific situation that needs to be prevented, that is, overload.

[0099] The role of semantic annotation

[0100] Through semantic annotation, each component in a sentence can be clearly annotated as a specific semantic role. These semantic roles help the system understand the deep meaning and logical relationship of the sentence. For example, in this sentence, the part "when the equipment voltage reaches 10kV" is annotated as a time adverbial and attribute, which clarifies the conditions and specific circumstances of the action; the part "the power supply should be disconnected immediately" clarifies the nature and urgency of the action through the annotation of modal verbs and actions; and "to prevent overload" clarifies the purpose of the action and the specific circumstances that need to be prevented through the annotation of purpose and action. This detailed semantic annotation not only enables the system to accurately capture the core information of the sentence, but also provides standardized data input for subsequent hypergraph structure generation and convolution operations. By annotating each component of the sentence with a specific semantic role, the system can better understand and parse the complex information and logical relationships in the five-defense logic specification text, thereby generating more reliable and effective logical rules.

[0101] Example 2: Step 1 specifically includes: dividing the five-defense logic standard text into multiple sentences using semicolons, periods or line breaks as delimiters; screening each sentence to screen out sentences containing quantitative requirements, and forming a sentence set of the screened sentences as a preprocessing result; wherein, sentences containing quantitative requirements are defined as sentences containing the following elements: numbers, units of measurement and / or comparison operators.

[0102] Specifically, semicolons and periods are common punctuation marks, usually used to indicate the end of a sentence; while line breaks usually indicate the end of a paragraph or a line break. In actual operation, these segmentation symbols can effectively divide a long text into multiple short sentences, so that each sentence becomes an independent information unit, which is convenient for subsequent processing and analysis. After segmenting the text, each sentence needs to be screened. The goal of screening is to find sentences that contain quantitative requirements, because these sentences usually contain specific technical indicators and operating specifications, which are the most critical information in the five-defense logic specification text. In order to achieve this goal, the screening process defines the criteria for sentences containing quantitative requirements, that is, the sentences must contain the following elements: numbers, units of measurement and / or comparison operators. These elements are usually used to describe technical parameters, operating conditions and performance indicators. Numbers are the most basic quantitative elements and can represent various values, such as voltage, current, temperature, etc.; units of measurement are used to represent the specific units of these values, such as kV (kilovolt), A (ampere), ℃ (degrees Celsius), etc.; and comparison operators are used to describe the relationship between values, such as ">" (greater than), "<" (less than), "=" (equal to), etc. For example, in the sentence "The rated voltage of the equipment is 10kV",

[0103] "10kV" is a quantitative description containing numbers and units of measurement, while in the sentence "When the temperature exceeds 50℃, the operation should be stopped", "exceeding 50℃" contains not only numbers and units of measurement, but also comparison operators. By using regular expressions and keyword matching technology, sentences containing the above quantitative elements can be efficiently identified. Regular expressions are a powerful text matching tool that can accurately locate and extract specific patterns in text. For example, regular expressions can be used to match all sentences containing numbers and units of measurement to filter out sentences containing quantitative requirements. At the same time, through predefined keyword lists such as "voltage", "current", "temperature", etc., it can be further confirmed that these sentences do contain important technical information and operating specifications. After filtering out sentences containing quantitative requirements, these sentences are combined into a sentence set as the preprocessing result. This sentence set contains the most critical information in the five-defense logic specification text, forming high-quality input data for subsequent processing. In this way, not only the processing efficiency is improved, but also it is ensured that the subsequent steps can focus on key content, thereby generating more accurate and effective logic rules.

[0104] Example 3: Assume that the preprocessing result is S = {s i |i∈[1,N],len(s i )>0}; where S represents a sentence set, s i represents the i-th sentence, N represents the total number of sentences, len(s i ) represents sentence s i length; in step 2, for sentence s i Use the following formula to perform hash embedding and convert it into a low-dimensional vector of fixed length:

[0105]

[0106] Where k is the number of hash functions; m represents sentence s i The number of characters or words in the hash function. j and l are both subscripts. The hash function is expressed using the following formula:

[0107] h j (x il )=(a j ·x il +b j )mod(p);

[0108] Among them, h j (x il ) is a hash function; x il Indicates sub i The ASCII code of the first character or word in a j and b jThey are all parameters of the j-th hash function and are random values; p is a large prime number used for modulo operation to ensure uniform distribution of hash values; represents the l-th character or word in s i in the sentence s i appearance frequency; represents the l-th character or word in s i appearance frequency in all sentences; μ i and σ i respectively represent the mean and standard deviation of the positions of characters or words in the sentence s i ; H(s i ) is the hash embedding vector and is represented by the following formula:

[0109]

[0110] where, w il represents the weight of the l-th character or word in the sentence s i and is a preset value.

[0111] Specifically, represents the word frequency of the l-th word in the sentence s i , that is, the frequency of the word's appearance in the sentence. represents the frequency of the word's appearance in all sentences, that is, the document frequency. These two parameters together constitute the term frequency-inverse document frequency (TF-IDF) which is used to measure the importance of words. The calculation of TF-IDF ensures that the influence of common words (such as "of", "is", etc.) on the sentence is weakened while important technical terms and quantitative descriptions are highlighted. Next, is a Gaussian distribution function used to weight the positions of words in the sentence. μ i and σ i respectively represent the mean and standard deviation of the positions of words in the sentence s i . Through the Gaussian distribution function, the relative positions of words in the sentence can be emphasized, enabling central words (i.e., key terms in the sentence) to obtain higher weights. Then, (a j ·x il +b j ) mod(p) in the formula is a hash function used to map the ASCII code x il of the word to a low-dimensional space. a j and b j are randomly generated hash function parameters, and p is a large prime number to ensure uniform distribution of hash values. The use of the hash function greatly reduces the dimension of the data, making subsequent processing more efficient. By summing up the above calculation results and subtracting the minimum value H(s i ​​), and then divide it by the difference between the maximum and minimum values ​​to achieve normalization of the low-dimensional vector. This step ensures that the generated vector Within a fixed range, the scale differences between different sentences are eliminated, making the comparison and analysis of semantic tags more consistent and reliable. Through these calculations, the low-dimensional vector generated in the end Not only does it retain the core semantic information of the sentence, but it also accurately reflects the structure and logical relationship of the sentence through the joint application of TF-IDF, Gaussian distribution, and hash functions. These low-dimensional vectors are used as input and will then be used to generate a sequence of semantic tags for the sentence, enabling the system to better understand and parse the complex information in the five-defense logic specification text. In short, the formula in step 3 converts the low-dimensional vector of the sentence into a low-dimensional vector that reflects its core semantics and logical structure through multiple calculations and processing. Through the combination of word frequency-inverse document frequency, Gaussian distribution, and hash functions, this process not only improves processing efficiency, but also ensures the accuracy and reliability of the generated semantic tags, providing a solid foundation for subsequent hypergraph structure generation and convolution operations. Through this key step, the automatic conversion method of the five-defense logic specification text realizes the effective conversion from text data to semantic data, ensuring the efficiency and accuracy of the system when processing complex technical texts.

[0112] Example 4: Based on the low-dimensional vector, use the BERT model to semantically annotate the low-dimensional vector corresponding to each sentence to generate a semantic label sequence.

[0113] Specifically, the BERT model, through its bidirectional encoder, can simultaneously consider the contextual information of each word in the sentence, thereby generating a more accurate and comprehensive semantic representation. The BERT model first encodes it and generates a series of context-related vector representations. These vector representations retain the semantic information of the sentence and, through BERT's deep learning architecture, can further capture the complex logical relationships and contextual dependencies in the sentence. In actual operation, the BERT model converts low-dimensional vectors into The input is sent to its encoder, and the context-dependent representation of each word is generated through multiple self-attention mechanism layers. The self-attention mechanism can capture the long-distance dependencies and complex semantic relationships in the sentence by calculating the correlation between each word and other words in the sentence. This process enables the BERT model to generate accurate semantic label sequences that reflect the key information and logical structure in the sentence. The specific process of generating semantic label sequences is as follows: The BERT model first preprocesses each low-dimensional vector and embeds it into a high-dimensional vector space. Then, through a multi-layer Transformer encoder, the semantic information of the sentence is extracted and aggregated layer by layer. In the last layer, the BERT model generates context-dependent representations of each word, which contain the semantic information of the word and its role in the sentence. Next, the BERT model classifies these context-dependent representations and generates specific semantic label sequences. Through pre-training and fine-tuning, the BERT model can identify and annotate various semantic roles in sentences, such as subject, predicate, object, attributive, adverbial, etc. In the five-defense logic specification text, the BERT model can accurately annotate technical terms, operating conditions, and quantitative descriptions, enabling the system to deeply understand the meaning and logical relationship of the sentence. Through this process, the generated semantic label sequence not only retains the core semantic information of the sentence, but also can capture complex contextual dependencies and logical relationships through the deep learning ability of the BERT model. These semantic label sequences will be used as inputs for subsequent steps to provide key data support for generating hypergraph structures and logical rules. In summary, Example 4 uses the BERT model to semantically annotate low-dimensional vectors and generate semantic label sequences, thereby achieving deep parsing and annotation of five-defense logic standard texts. The bidirectional encoder architecture and self-attention mechanism of the BERT model enable it to generate accurate and comprehensive semantic label sequences to capture complex semantics and logical relationships in sentences. This process not only improves the accuracy and reliability of semantic annotation, but also provides a solid foundation for subsequent hypergraph generation and logical rule generation, ensuring the efficiency and accuracy of the automatic conversion method of five-defense logic standard texts.

[0114] Example 5: After the semantic label sequence of the sentence is converted into a hypergraph structure in step 4, the hypergraph structure is represented by the following formula:

[0115]

[0116] Among them, G(T(s i )) is the sentence s i The semantic label sequence of ; H is the hyperedge set; E is the hypergraph edge set; V is the node set; n is the sentence s i The number of labels in v j is the node corresponding to the jth label; sim(u,v) represents the semantic similarity between node u and node v; hyperedge hk is a subset of the node set V; |h k |≥3 indicates a hyperedge h k Contains at least 3 nodes; |h k | represents the hyperedge h k The number of nodes contained in e ij Represents the connection node v i and v j The edge of sim(v i ,v j )>τ represents node v i and v j The similarity between them is greater than the preset threshold τ; It means calculating the average similarity between all node pairs of the hyperedge w(h k ); u and v represent hyperedge h k Any two nodes in d i and d j Respectively represent the node v i and v j degree; A ij are the elements of the adjacency matrix A.

[0117] Specifically, the hypergraph structure G(T(s i )) is used to represent the sentence s i The hypergraph consists of three main parts: the node set V, the edge set E and the hyperedge set H. The node set V contains all the semantic labels in the sentence, which are generated by the previous step 3 and reflect the semantic components of each word and phrase in the sentence. For example, suppose the sentence s i There are n semantic labels in , then V can be expressed as, where v j is the node corresponding to the jth label. These nodes represent different semantic components in the sentence, such as subject, predicate, object, etc. The edge set E represents the direct relationship between nodes. These relationships are determined by calculating the semantic similarity between nodes. The node set V contains all the semantic labels in the sentence. Suppose sentence s i There are n semantic labels in V, then V can be expressed as {v j |j∈[1,n]}, where v j is the node corresponding to the jth label. These nodes represent different semantic components in the sentence, such as subject, predicate, object, etc. For example, in the sentence "When the equipment voltage reaches 10kV, the power supply should be disconnected immediately to prevent overload", possible nodes include "equipment", "voltage", "10kV", "disconnect", "power supply", "prevent", "overload", etc. The semantic similarity sim(v i ,v j) is a measure of how similar two nodes are semantically, which can be obtained through word embedding or other semantic similarity calculation methods. For example, the cosine similarity of two words is calculated using a word embedding model (such as Word2Vec or BERT). When the similarity between two nodes exceeds a pre-set threshold τ, an edge is established between them, that is, e ij , thus forming an edge set H. In this way, the edge set E reflects the direct semantic connection between words in the sentence. However, it is not enough to represent semantic relations only through edge sets, because the semantic relations in sentences are often multivariate and involve complex interactions between multiple words. Therefore, the hyperedge set H is introduced, which can capture the high-order relations between multiple nodes. Hyperedge h k is a subset of the node set V and contains at least 3 nodes, which ensures that the hyperedge can reflect the complex semantic structure. The weight of each hyperedge w(h k ) is determined by the average similarity between all pairs of nodes in the hyperedge, that is, This calculation method ensures that the weight of the hyperedge can accurately reflect the strength of the semantic connection between nodes. ij Used to represent node v i and v j Is there an edge connection between them? If there is an edge e ij ,but where d i and d j Respectively represent the node v i and v j The degree of each node is the number of edges connected to each of them. This weighting method helps to balance the connection strength between different nodes and prevent high-degree nodes from having too much influence in the convolution operation. After converting the semantic label sequence of the sentence into a hypergraph structure, a hypergraph convolutional network (HGCN) is used to perform convolution operations on the hypergraph. HGCN is an extended convolutional neural network specifically designed to process hypergraph data. It can slide the convolution kernel on the hypergraph structure to extract and aggregate features for each node and its adjacent nodes. Specifically, HGCN generates a new feature representation by calculating the weighted average of the feature vector of each node and the feature vectors of all nodes within its hyperedge. This operation can capture high-order semantic relationships and complex logical structures in the sentence, thereby generating an enhanced semantic feature matrix. An important feature of the hypergraph convolution operation is the ability to capture long-distance dependencies and multivariate relationships between nodes. This capability is particularly important in the five-defense logic specification text, because the specification text often contains complex technical terms and logical relationships. Through hypergraph convolution operations, the system can understand and parse the semantics and logical structure of sentences at a higher dimension, ensuring that the generated logical rules can accurately reflect the technical specifications and operational requirements in the text.

[0118] Example 6: Assume that the hypergraph G(T(s i ))’s input feature matrix is ​​X=[x1,x2,…,x n ] T , where each x j Represents node v j In the hypergraph convolution operation, a multi-head self-attention mechanism is introduced to capture the relationship between nodes. The formula is as follows:

[0119]

[0120] Where Q = XW Q , K = XW K , V = XW V denote the query vector, key vector and value vector respectively, W Q ,W K ,W V is the weight matrix of the attention mechanism, d k is the dimension of the key vector;

[0121] Attention s (Q, K, V) represents the sth attention head; s is an integer subscript index; combining the multi-head self-attention mechanism and hypergraph convolution, the output of the hypergraph convolution layer is defined as the node feature matrix H (l+1) ; In order to enhance feature representation, a high-dimensional feature fusion mechanism is introduced. The following formula is used to further extract node features through high-order tensor operations to obtain the enhanced node feature matrix F (l+1) :

[0122]

[0123] in, represents high-order tensor operations, represents the tensor product, KGE(H (l) ) is the node feature matrix after knowledge graph embedding.

[0124] Specifically, first, let the input feature matrix of the hypergraph be X, where each x j Represents node v jThe feature vectors of the hypergraph convolution are the initial semantic information of the nodes (i.e., the semantic labels of the sentences). In the hypergraph convolution operation, in order to better capture the relationship between nodes, the multi-head self-attention mechanism is introduced. The multi-head self-attention mechanism is an advanced attention mechanism that simultaneously captures different relationships and patterns between nodes through multiple attention heads. Specifically, the attention mechanism determines the attention weights between nodes by calculating the relationship between the query vector (Query), the key vector (Key), and the value vector (Value). Through this formula, the multi-head self-attention mechanism can calculate the attention weights between nodes and apply them to the value vector to capture the complex relationship between nodes. Combining the multi-head self-attention mechanism and the hypergraph convolution, the output of the hypergraph convolution layer is defined as the node feature matrix. This feature matrix contains the node features after the multi-head self-attention mechanism and the hypergraph convolution, reflecting the complex relationship and high-order semantic information between nodes. In order to further enhance the feature representation, the high-dimensional feature fusion mechanism is introduced. This mechanism realizes the further extraction of node features through high-order tensor operations. Specifically, the high-dimensional feature fusion mechanism can fuse multiple feature sources through high-order tensor operations to further extract and strengthen node features. This process takes advantage of knowledge graph embedding (KGE) and combines feature information from different sources to make the final node feature matrix richer and more comprehensive. Knowledge graph embedding (KGE) is a method of representing entities and relationships in a knowledge graph as low-dimensional vectors. By embedding the knowledge graph into the node feature matrix, the quality of feature representation can be further improved. In Example 6, the background knowledge and relationship information of each node in the sentence are obtained through the knowledge graph embedding method, which is integrated with other feature information in the high-dimensional feature fusion process to generate more accurate and comprehensive node features. High-order tensor operations are the core steps to achieve high-dimensional feature fusion. Tensor product operations are a mathematical operation that combines multiple tensors, through which information from different feature sources can be integrated and fused. For example, in the formula, the node feature matrix after hypergraph convolution is tensor-producted with the feature matrix embedded in the knowledge graph to generate a new feature matrix, which contains comprehensive information from multiple feature sources. The advantage of this high-dimensional feature fusion mechanism is that it can capture more complex and diverse relationships between nodes, making the final feature representation richer and more representative. This capability is particularly important in the five-defense logic specification text, because the specification text often contains complex technical terms and logical relationships. Through the high-dimensional feature fusion mechanism, it can ensure that the generated logical rules can accurately reflect the technical specifications and operational requirements in the text. In addition, by introducing the multi-head self-attention mechanism, different relationship patterns can be captured between different attention heads, which not only improves the diversity of feature representation, but also enhances the robustness and generalization ability of the model.The attention mechanism can dynamically adjust the weights between nodes by calculating the relationship between the query vector, key vector, and value vector, thereby capturing long-distance dependencies and complex semantic relationships in sentences. This process ensures the efficiency and accuracy of the model when processing complex texts. In practical applications, the combination of the multi-head self-attention mechanism and the high-dimensional feature fusion mechanism enables the five-defense logic specification text automatic conversion method to accurately capture and represent the key semantics and logical relationships when processing complex technical texts, thereby generating efficient and accurate logical rules. These rules can not only improve the safety and reliability of industrial operations, but also provide strong support for the automated management of technical specifications.

[0125] Example 7: Output H of the Hypergraph Convolutional Layer (l+1) , calculated using the following formula:

[0126]

[0127] Among them, H (l) represents the node feature matrix of the lth layer, is the node feature of the jth node; is the hyperedge h k The degree matrix of is the hyperedge h k adjacency matrix, M represents the number of attention heads, W (l) is the convolution weight matrix of the lth layer, σ is the activation function; the node features of each node in the node feature matrix are aggregated and updated using the following formula to obtain the aggregated and updated results

[0128] in, Represents node v i The set of neighbor nodes, d i Represents node v i degree, λ is the regularization parameter; H(i) is the node v i The set of all hyperedges of ; Represents the hyperedge h g Middle node v j The reciprocal of the degree.

[0129] Specifically, first, set the output H of the hypergraph convolutional layer (l+1) , the node feature matrix of this level is obtained through a complex calculation formula. In this formula, σ represents the activation function, commonly used such as ReLU (RectifiedLinearUnit), which is used to introduce nonlinearity so that the model can learn complex patterns. The feature matrix H (l)Represents the node features of the lth layer, and the feature vector of each node is updated through a convolution operation. The core of the hypergraph convolution layer is to combine the multi-head self-attention mechanism with the high-order relations unique to the hypergraph to achieve the aggregation and update of node features. The multi-head self-attention mechanism captures different relationships and patterns between nodes simultaneously through multiple attention heads. These attention heads work independently and can capture multiple relationships between nodes, making the final feature representation richer and more diverse. Specifically, the query vector (Q), key vector (K), and value vector (V) are obtained by multiplying the input feature matrix X with the corresponding weight matrix. These vectors interact with each other in the self-attention mechanism to calculate the attention weights between nodes. The attention weights are calculated by taking the dot product of the query vector and the key vector, dividing it by the square root of the dimension of the key vector, and then applying the softmax function to ensure that the weights are normalized. Finally, these weights are applied to the value vector to obtain the output of the multi-head self-attention, which captures the complex relationships and dependencies between nodes. Next, the hypergraph convolution layer combines these attention outputs with the high-order relations unique to the hypergraph for convolution operations. The degree matrix of each hyperedge and the adjacency matrix Used to adjust the weight of feature aggregation. By aggregating the node features within the hyperedge, more complex relationships in the hypergraph can be captured. The introduction of high-order tensor operations enables node features to interact and fuse more deeply during the aggregation process, thereby generating richer feature representations. The feature update formula also contains a regularization parameter λ, which is used to control the balance between different feature sources. This parameter ensures that the contribution of each feature source can be properly weighed during the feature aggregation process, thereby avoiding the excessive influence of a certain feature source on the final feature representation. Specifically, the aggregation and update process of node features not only considers the relationship between the node and its direct neighbors (through the standard adjacency matrix), but also considers the position and relationship of the node in the hyperedge (through the degree matrix of the hyperedge and the attention mechanism). In this way, the feature update of each node can fully reflect its complex relationship and semantic information in the entire hypergraph. In practical applications, this mechanism enables the automatic conversion method of the five-defense logic specification text to process complex technical texts and accurately capture and represent the key semantics and logical relationships in the text. For example, in industrial operations, the five-defense logic specification text often contains a large number of complex operating requirements and safety specifications.

[0130] In this way, the system is able to generate precise logical rules to ensure the safety and standardization of operations.

[0131] Example 8: In step 5, based on the enhanced semantic feature matrix, the enhanced semantic features of each node are extracted; based on the semantic features, the semantic similarity between the nodes is calculated to determine the semantically related node pairs; based on the semantic relationship between the nodes, logical rules in the form of conditional statements are defined; the logical rules are converted into a formalized logical representation, and then computable logical rules are generated.

[0132] Specifically, based on the enhanced semantic feature matrix generated in the previous step, the enhanced semantic features of each node are extracted. After being processed by the multi-head self-attention mechanism and the high-order feature aggregation method, this feature matrix already contains rich semantic information and complex relationships between nodes. The feature vector of each node reflects its semantic position and association in the entire hypergraph, thus providing a solid foundation for subsequent similarity calculations. Next, based on these enhanced semantic features, the semantic similarity between nodes is calculated. This step is crucial because semantic similarity can reveal the deep relationship between nodes, not just the surface text matching. Commonly used methods include cosine similarity, Euclidean distance, etc., which can accurately measure the similarity between two vectors. In the five-defense logic specification text, calculating the semantic similarity between nodes can help determine which nodes are semantically related, thereby further understanding the logical relationship in the text. By calculating the semantic similarity, semantically related node pairs can be determined. These node pairs represent components in the text that have logical connections. For example, in a specification involving safety operations, "overvoltage" and "disconnect power" may be semantically related node pairs because they are closely related in operation logic. This step ensures that the system can capture the implicit logical relationships in the text, not just the explicit text descriptions. Based on the semantic relationships between these nodes, logical rules in the form of conditional statements can be defined. These logical rules reflect the operational requirements and safety specifications in the five-defense logic specifications. For example, semantically related node pairs can be converted into the form of conditional statements of "if...then...", specifically, "if the voltage reaches 10kV, then the power supply should be disconnected immediately." This kind of logical rule in the form of conditional statements is easy to understand and verify, and can clearly express the preconditions and subsequent actions of the operation. Converting these logical rules into formal logical representations is a key step to ensure the computability of the rules. Formal logical representations usually use methods such as symbolic logic or Boolean algebra to convert rules described in natural language into logical expressions that can be processed by computers. For example, the above conditional statement can be expressed as if voltage == 10kV then is connected (power), and this formal logical representation is easy to program and automatically execute. Finally, based on these formal logical representations, computable logical rules are generated. These logical rules can be directly applied to actual operations and monitored and executed by automation systems. For example, in an industrial environment, an automation system based on the five-defense logic specification can monitor the voltage level of the equipment in real time and automatically disconnect the power supply when the voltage is detected to be too high, thereby preventing accidents. This not only improves the safety and reliability of operations, but also reduces the burden of manual monitoring.

[0133] Embodiment 9: The method further includes: Step 6: Optimizing the generated logical rules through an optimal transmission method of entropy regularization.

[0134] Specifically, Example 9 elaborates on the process of optimizing the generated logical rules by the optimal transmission method of entropy regularization in the five-defense logical specification text automatic conversion method. This optimization step aims to improve the effectiveness and robustness of the logical rules, making them more efficient and reliable in practical applications. First of all, it is necessary to understand the basic principles of the optimal transmission method of entropy regularization. The optimal transmission (Optimal Transport, OT) problem is to calculate the optimal match between different probability distributions, aiming to convert one distribution to another at the lowest transmission cost. The optimal transmission method of entropy regularization introduces an entropy regularization term to the traditional OT problem to improve computational efficiency and stability. By adding the entropy regularization term, a smoother and more robust solution can be obtained, thereby avoiding the instability and computational difficulties that may occur in the traditional OT method. In the five-defense logical specification text automatic conversion method, the generated logical rules often involve the matching of different operating conditions and response actions. Through the optimal transmission method of entropy regularization, these logical rules can be optimized to ensure their effectiveness and consistency under different conditions. For example, when the operating conditions of the device change, the optimized logical rules can adjust the response actions more flexibly, thereby ensuring the safety and reliability of the system. Specifically, the optimization process of step 6 includes the following key links. First, it is necessary to construct the matching relationship between the logical rules and define the cost function to measure the transmission cost between different rules. This cost function can be set according to factors such as the complexity of the rules, execution efficiency, and accuracy. For example, for two logical rules R1 and R2, the transmission cost can be calculated based on the similarity of their triggering conditions and response actions to determine the optimal match between them. Next, by introducing the entropy regularization term, the optimal transmission problem is transformed into an optimization problem with entropy regularization. The introduction of the entropy regularization term helps to smooth the transmission matrix and avoid the numerical instability problem that may occur in the traditional OT method. Specifically, the entropy regularization term can be expressed by the following formula:

[0135] C(P)=∑ i,j P ij log(P ij )-∑ i,j P ij log(K ij );

[0136] Where P is the transmission matrix, P ij are the elements; K is the initial transmission matrix, K ij are the elements; i,j are subscript indices. By minimizing this regularized cost function, an optimized transmission matrix P can be obtained *, which represents the optimal matching relationship between logical rules. In actual operation, the optimized transmission matrix P * It can guide the adjustment and optimization of logical rules. For example, for a specific operating condition, if the system detects that the current logical rules cannot effectively cope with the changing environmental conditions, the optimized transmission matrix can provide a suggestion for an alternative rule, thereby adjusting the response strategy of the system to ensure the continuity and safety of the operation. Finally, through this optimization process, the generated logical rules can not only maintain high efficiency and accuracy, but also be flexibly adjusted under different operating conditions, providing higher robustness and adaptability. This optimization strategy is particularly important for the automated management of the five-defense logical specifications, because it can effectively cope with complex and dynamic industrial operating environments and ensure that the system can operate stably under various conditions. In general, Example 9 optimizes the generated logical rules by introducing the optimal transmission method of entropy regularization, making these rules more efficient, robust and reliable in practical applications. Through this optimization method, the five-defense logical specification text automatic conversion method can better cope with complex operating environments and provide higher security and reliability. The optimized logical rules can not only accurately reflect the technical specifications and operating requirements in the text, but also can be flexibly adjusted in actual operations to ensure that the system can operate stably under various conditions. This optimization process provides important technical support for the automated management of the five-defense logical specifications and improves the safety and standardization of industrial operations.

[0137] The above is a detailed introduction to the five-defense logic standard text automatic conversion method provided in the embodiment of the present invention. This article uses specific examples to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for technical personnel in this field, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A method for automatic conversion of five-defense logic specification text, characterized in that: The method comprises: Step 1: Preprocess the five-defense logic specification text, split it into multiple sentences, and filter out the sentences containing quantitative requirements as the preprocessing results; Step 2: Hash embedding is performed on the preprocessing results to convert the text corresponding to the sentences in the preprocessing results into a low-dimensional vector of fixed length; Step 3: Based on the low-dimensional vector, semantically annotate the low-dimensional vector corresponding to each sentence to generate a semantic label sequence; Step 4: Convert the semantic label sequence of the sentence into a hypergraph structure to capture high-order relationships; use the hypergraph convolutional network to perform convolution operations on the hypergraph to enhance the semantic features and obtain the enhanced semantic feature matrix; Step 5: Generate computable logical rules based on the enhanced semantic feature matrix.

2. The five-defense logic standard text automatic conversion method as claimed in claim 1 is characterized in that: Step 1 specifically includes: dividing the five-defense logic specification text into multiple sentences using semicolons, periods or line breaks as delimiters; screening each sentence to screen out sentences containing quantitative requirements, and forming a sentence set of the screened sentences as a preprocessing result; wherein, sentences containing quantitative requirements are defined as sentences containing the following elements: numbers, units of measurement and / or comparison operators.

3. The five-defense logic standard text automatic conversion method as described in claim 2 is characterized in that: Assume the preprocessing result is S = {s i |i∈[1,N],len(s i )>0}; where S represents a sentence set, s i represents the i-th sentence, N represents the total number of sentences, len(s i ) represents sentence s i length; in step 2, for sentence s i Use the following formula to perform hash embedding and convert it into a low-dimensional vector of fixed length: Where k is the number of hash functions; m represents sentence s i The number of characters or words in the hash function. j and l are both subscripts. The hash function is expressed using the following formula: h j (x il )=(a j ·x il +b j )mod(p); Among them, h j (x il ) is a hash function; x il Indicates sub i The ASCII code of the first character or word in a j and b j are the parameters of the jth hash function, which are random values; p is a large prime number, which is used for modular operation to ensure uniform distribution of hash values; Indicates i The first character or word in In sentence s i The frequency of occurrence in Indicates i The first character or word in Frequency of occurrence in all sentences; μ i and σ i Respectively represent the sentence s i The mean and standard deviation of the character or word position in H(s i ) is the hash embedding vector, which is expressed using the following formula: Among them, w il Indicates sentence s i The weight of the lth character or word in is the preset value.

4. The five-defense logic standard text automatic conversion method as described in claim 3 is characterized in that: Based on the low-dimensional vector, the BERT model is used to semantically annotate the low-dimensional vector corresponding to each sentence to generate a semantic label sequence.

5. The five-defense logic standard text automatic conversion method as described in claim 4 is characterized in that: After the semantic label sequence of the sentence is converted into a hypergraph structure in step 4, the hypergraph structure is represented by the following formula: Among them, G(T(s i )) is the sentence s i The semantic label sequence of ; H is the hyperedge set; E is the hypergraph edge set; V is the node set; n is the sentence s i The number of labels in v j is the node corresponding to the jth label; sim(u,v) represents the semantic similarity between node u and node v; hyperedge h k is a subset of the node set V; |h k |≥3 indicates a hyperedge h k Contains at least 3 nodes; |h k | represents the hyperedge h k The number of nodes contained in e ij Represents the connection node v i and v j The edge of sim(v i ,v j )>τ represents node v i and v j The similarity between them is greater than the preset threshold τ; It means calculating the average similarity between all node pairs of the hyperedge w(h k ); u and v represent hyperedge h k Any two nodes in d i and d j Respectively represent the node v i and v j degree; A ij are the elements of the adjacency matrix A.

6. The five-defense logic standard text automatic conversion method according to claim 5 is characterized in that Hypergraph G(Y(s i ))’s input feature matrix is ​​X=[x1,x2,…,x n ] T , where each x j Represents node v j In the hypergraph convolution operation, a multi-head self-attention mechanism is introduced to capture the relationship between nodes. The formula is as follows: Where Q = XW Q , K = XW K , V = XW V denote the query vector, key vector and value vector respectively, W Q ,W K ,W V is the weight matrix of the attention mechanism, d k is the dimension of the key vector; Attention s (Q, K, V) represents the sth attention head; s is an integer subscript index; combining the multi-head self-attention mechanism and hypergraph convolution, the output of the hypergraph convolution layer is defined as the node feature matrix H (l+1) ; In order to enhance feature representation, a high-dimensional feature fusion mechanism is introduced. The following formula is used to further extract node features through high-order tensor operations to obtain the enhanced node feature matrix F (l+1) : in, represents high-order tensor operations, represents the tensor product, KGE(H (l) ) is the node feature matrix after knowledge graph embedding.

7. The five-defense logic standard text automatic conversion method as claimed in claim 6 is characterized in that: The output H of the hypergraph convolutional layer (l+1) , calculated using the following formula: Among them, H (l) represents the node feature matrix of the lth layer, is the node feature of the jth node; is the hyperedge h k The degree matrix of is the hyperedge h k adjacency matrix, M represents the number of attention heads, W (l) is the convolution weight matrix of the lth layer, σ is the activation function; the node features of each node in the node feature matrix are aggregated and updated using the following formula to obtain the aggregated and updated results in, Represents node v i The set of neighbor nodes, d i Represents node v i degree, λ is the regularization parameter; H(i) is the node v i The set of all hyperedges of ; Represents the hyperedge h g Middle node v j The reciprocal of the degree.

8. The five-defense logic standard text automatic conversion method as claimed in claim 7 is characterized in that: In step 5, based on the enhanced semantic feature matrix, the enhanced semantic features of each node are extracted; based on the semantic features, the semantic similarity between the nodes is calculated to determine the semantically related node pairs; based on the semantic relationship between the nodes, logical rules in the form of conditional statements are defined; the logical rules are converted into formalized logical representations to generate computable logical rules.

9. The five-defense logic standard text automatic conversion method as claimed in claim 8 is characterized in that: The method also includes: Step 6: optimizing the generated logic rules through an optimal transmission method of entropy regularization.

10. An electronic device, characterized in that: It includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the automatic conversion method of the five-defense logic specification text as described in any one of claims 1-9.