State latching driving-based secondary device operation safety verification method and device, terminal equipment and storage medium

By mapping operation event descriptions to finite state machines and combining them with state transition rule matrices, operation strategy texts are generated and verified, solving the problem of the lack of state awareness in the operation of power grid secondary equipment by large language models, and improving safety and accuracy.

CN123160133APending Publication Date: 2026-11-24POWER DISPATCHING CONTROL CENT OF GUANGDONG POWER GRID CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611386637.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-08
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

In existing technologies, large language models lack the ability to perceive the state of the operation process in the operation of power grid secondary equipment, which leads to the generation of illusory content that violates the interlocking rules and affects the safety of on-site operations.

Method used

By mapping operation event descriptions to the initial state nodes of a finite state machine, combining the state transition rule matrix to determine the compliant action space, and using a large language model to generate preliminary operation strategy text, which is then input into the finite state machine for interlocking verification, the operation strategy is ensured to conform to the state transition rules. A logical value masking mechanism is used to constrain the decoding process, thereby achieving state awareness and consistency verification.

Benefits of technology

It effectively reduces the risk of generating violations of interlocking rules, improves the safety and accuracy of on-site operations, ensures that operating strategies comply with state interlocking rules, and enhances safety control capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123160133A_ABST
    Figure CN123160133A_ABST
Patent Text Reader

Abstract

This invention discloses a method, apparatus, terminal device, and storage medium for secondary equipment operation safety verification based on state interlocking, belonging to the field of power system safety management and control technology. The method includes mapping the operation event description of the secondary power equipment to be verified to the initial state node of a finite state machine; determining the compliant action space allowed to be executed by the initial state node by combining a preset state transition rule matrix; transforming the compliant action space into a dynamic lexical constraint set through a preset large language model; decoding and deducing the set based on a logical value masking mechanism; inputting the generated preliminary operation strategy text back into the finite state machine; performing interlocking verification of state transition consistency according to the state transition rule matrix; and, upon successful verification, advancing the finite state machine to the corresponding target business node based on the state transition rule matrix and the preliminary operation strategy text, generating an operation question-and-answer result. By implementing this invention, the problem of limited existing operation safety management and control is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power system safety management and control technology, and in particular to a method, device, terminal equipment and storage medium for verifying the operation safety of secondary equipment based on state interlocking drive. Background Technology

[0002] In the daily operation and maintenance of power grid secondary equipment, operators frequently need to perform on-site operations with strict timing interlocking requirements, such as enabling / disabling outlet pressure plates, switching setting zones, and starting / stopping protection functions. To improve operational accuracy, existing operation and maintenance support systems mainly introduce intelligent question-and-answer technology based on large language models to assist operators in retrieving technical procedures, on-site operating procedures, and operation ticket specifications. Regarding safety control, existing anti-misoperation interlocking methods mostly utilize hard-coded rule engines and knowledge graphs to perform post-compliance verification on the final output operation commands.

[0003] However, the large language model inference engine and the anti-misoperation locking mechanism adopt a loosely coupled decoupled design. During the construction and generation of inference prompt words, the current operation's state node variables and locking rule constraints are not injected, resulting in the model lacking the ability to perceive the state of the operation process. Therefore, when dealing with operations with strong temporal constraints, it is very easy to generate illusory content that violates the locking rules, which leads to limited on-site operation safety control. Summary of the Invention

[0004] This invention provides a method, apparatus, terminal device, and storage medium for secondary equipment operation safety verification based on state interlocking. It can effectively solve the problem that the existing technology does not inject the state node variables and interlocking rule constraints of the current operation, resulting in the model lacking the ability to perceive the state of the operation process, thus affecting the safety of on-site operation.

[0005] One embodiment of the present invention provides a secondary equipment operation safety verification method based on state interlocking drive, comprising: Obtain the operation event description of the secondary power equipment to be verified; The operation event description is mapped to the initial state node of the finite state machine, and the compliant action space allowed to be executed by the initial state node is determined by combining the preset state transition rule matrix; wherein, the finite state machine is a deterministic state model representing the operation process of the secondary equipment. The compliant action space is transformed into a dynamic lexical constraint set by a pre-set large language model. The dynamic lexical constraint set is then decoded and deduced based on a logical value masking mechanism to generate preliminary operation strategy text. The initial operation strategy text is input into the finite state machine in reverse, and the state transition consistency is checked according to the state transition rule matrix. If the latching verification passes, the finite state machine is advanced to the corresponding target business node based on the state transition rule matrix and the preliminary operation strategy text, and operation question and answer results are generated.

[0006] Furthermore, it also includes: If the lockout check fails, a penalty feedback signal is generated and returned to the large language model. The large language model is then driven to re-decode and deduce based on the current initial state node and the corresponding compliance action space to generate a new preliminary operation strategy text. The new preliminary operation strategy text is input into the finite state machine in reverse, and the state transition consistency is checked according to the state transition rule matrix.

[0007] Furthermore, obtain the operation event descriptions of the secondary power equipment to be verified, including: Obtain the operation and maintenance text data of the secondary power equipment to be verified; After performing text cleaning and terminology standardization on the maintenance text data, the device entity, operation action type, and current action status are identified. The device entity is mapped to a unique device code, and an operation event description of the secondary power equipment to be verified is generated based on the unique device code, the operation action type, and the current action status.

[0008] Furthermore, the state transition rule matrix includes: a state transition Boolean matrix for characterizing the compliance of the corresponding operation action transition under the current action state, and a state transition target mapping matrix for storing the target business node index corresponding to the migration path; The operation event description is mapped to the initial state node of the finite state machine, and the compliant action space allowed to be executed by the initial state node is determined by combining the preset state transition rule matrix, including: The device unique code and current action state in the operation event description are jointly mapped to the service state set of the finite state machine, and the initial state node of the finite state machine is activated based on the service state set. The operation action type in the operation event description is mapped to the action to be executed in the structured event set of the finite state machine; Using the initial state node and each action to be executed as an index, query the state transition Boolean matrix one by one to obtain the compliance judgment result corresponding to each transition path; The operation actions corresponding to the migration path with a compliance determination result are used as the space of compliant actions that the initial state node is allowed to execute.

[0009] Furthermore, the compliant action space is transformed into a dynamic lexical constraint set through a pre-defined large language model. Based on a logical value masking mechanism, the dynamic lexical constraint set is decoded and deduced to generate preliminary operation strategy text, including: The compliant action space is converted into a text template, and the text template is mapped into a dynamic prefix tree by the word segmenter of the preset large language model; Based on the current initial state node and the generated lexical prefixes, the dynamic lexical constraint set that the current decoding step is subject to the finite state machine locking rule is determined through the dynamic prefix tree; Determine whether the dynamic lexical constraint set is empty; if so, generate a security prompt; otherwise, at each time step of the autoregressive decoding of the large language model, obtain the unnormalized logical tensor of the large language model in the forward propagation process, and apply negative infinity penalty to illegal lexicals that do not belong to the dynamic lexical constraint set through a logical value masking mechanism to obtain the masked logical tensor. The masked logical tensor is subjected to softmax calculation to obtain a restricted probability distribution. Based on the restricted probability distribution, the legal words of the current decoding step are selected, and the legal words of each decoding step are concatenated to generate the preliminary operation strategy text.

[0010] Further, the preliminary operation strategy text is input in reverse into the finite state machine, and a locking check for state transition consistency is performed according to the state transition rule matrix, including: The initial operation strategy text is input in reverse into the finite state machine to extract the target operation action; The target operation action and the current initial state node are input into the state transition rule matrix, and a preset consistency locking check function is called to perform a Boolean-type determination. If all verification factors in the consistency locking verification function are determined to be compliant, the locking verification is deemed to have passed. If any check factor in the consistency latch check function is determined to be non-compliant, the latch check is deemed to fail.

[0011] Furthermore, based on the state transition rule matrix and the preliminary operation strategy text, the finite state machine is advanced to the corresponding target business node, generating operation question-and-answer results, including: Based on the state transition target mapping matrix in the state transition rule matrix, query the target business node index corresponding to the current compliant migration path, and advance the finite state machine from the initial state node to the corresponding target business node; The initial operation strategy text that has passed the lockout verification is converted into standardized operation guidance content, and operation Q&A results are generated based on the standardized operation guidance content.

[0012] As an improvement to the above solution, another embodiment of the present invention provides a secondary equipment operation safety verification device based on state interlocking drive, comprising: The operation event description acquisition module is used to acquire the operation event description of the secondary power equipment to be verified. The compliance action space determination module is used to map the operation event description to the initial state node of the finite state machine, and determine the compliance action space that the initial state node is allowed to execute by combining the preset state transition rule matrix; wherein, the finite state machine is a deterministic state model representing the operation process of the secondary equipment; The preliminary operation strategy text generation module is used to transform the compliant action space into a dynamic lexical constraint set through a preset large language model, and to decode and deduce the dynamic lexical constraint set based on a logical value masking mechanism to generate the preliminary operation strategy text. The latching verification module is used to input the preliminary operation strategy text in reverse into the finite state machine and perform latching verification of state transition consistency according to the state transition rule matrix. The operation question and answer result generation module is used to advance the finite state machine to the corresponding target business node based on the state transition rule matrix and the preliminary operation strategy text, and generate operation question and answer results, when the latching verification passes.

[0013] Another embodiment of the present invention provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements a secondary device operation security verification method based on state interlocking drive as described in the above embodiments.

[0014] Another embodiment of the present invention provides a computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform a secondary device operation security verification method based on state interlocking drive as described in the above embodiment.

[0015] By implementing this invention, at least the following beneficial effects are achieved: This invention provides a method, apparatus, terminal device, and storage medium for secondary equipment operation safety verification based on state-locked driving. The method maps operation event descriptions to initial state nodes of a finite state machine. It uses the state transition rule matrix of the finite state machine as a unified locking rule carrier, applying it to the locking verification of large language model decoding and deduction and state transition consistency. This ensures that anti-misoperation locking rules are implemented throughout the entire process, achieving deep coupling between the state-locked mechanism and model reasoning at the architectural level, thus solving the problem of control lag caused by their disconnect. Using the compliant action space corresponding to the initial state node as boundary constraints is equivalent to using the current business stage state as the core constraint condition, enabling the generated initial operation strategy to... The abbreviated text is limited to the allowed range of the current state, realizing the state node constraint of the current operation and possessing the ability to perceive the state of the secondary equipment operation process; then, the compliant action space is transformed into a dynamic lexical constraint set, which is directly applied to the decoding and deduction process through a logical value masking mechanism, compressing the generation space of non-compliant content from the source of reasoning and decoding, and fundamentally reducing the risk of generating illusory content that violates the locking rules; finally, state transition consistency locking verification is performed based on the state transition rule matrix. Through the dual verification mechanism of pre-generation constraints and post-rule verification, it is ensured that the final operation question and answer result conforms to the state locking rules, effectively strengthening the security control capability and improving the safety of on-site operations. Attached Figure Description

[0016] Figure 1 This is a flowchart illustrating a secondary equipment operation safety verification method based on state interlocking drive, according to an embodiment of the present invention. Figure 2 This is an overall flowchart of security verification provided by an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of a secondary equipment operation safety verification device based on state interlocking drive, according to an embodiment of the present invention. Detailed Implementation

[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0018] See Figure 1 To address the problem in existing technologies where the absence of injected state node variables and locking rule constraints for the current operation leads to a lack of state awareness of the operational process, thus affecting on-site operational safety, an embodiment of this invention provides a flowchart illustrating a secondary equipment operation safety verification method based on state locking, comprising: S1. Obtain the operation event description of the secondary power equipment to be verified; Specifically, state-based interlocking refers to using the anti-misoperation interlocking rules of secondary power equipment operation as the core constraint, and controlling the operation of the entire operation assistance process through the node transitions of a finite state machine. All generated operation instructions must meet the interlocking requirements of state transitions. Secondary equipment operation safety verification targets secondary equipment such as relay protection devices, pressure plates, and circuit breakers, verifying whether they comply with operating procedures, timing requirements, and interlocking rules. Operation event descriptions are structured descriptions of the current operation object, state, and intended action of the secondary equipment.

[0019] To illustrate, the structured event information corresponding to the current operation is obtained from the field business system, which clarifies the equipment object, its state, and related action information of the current operation, providing data support for the subsequent state machine initialization.

[0020] Preferably, the description of the operation events of the secondary power equipment to be verified is obtained, including: Obtain the operation and maintenance text data of the secondary power equipment to be verified; After performing text cleaning and terminology standardization on the maintenance text data, the device entity, operation action type, and current action status are identified. The device entity is mapped to a unique device code, and an operation event description of the secondary power equipment to be verified is generated based on the unique device code, the operation action type, and the current action status.

[0021] Specifically, maintenance text data represents plain text data related to the maintenance of secondary equipment at the substation site, including operation tickets, setting sheets, relay protection procedures, and switchboard activation / deactivation records from multiple sources. Text cleaning removes redundant characters, formatted errors, and invalid content from the original text to improve data quality. Terminology standardization unifies the same terminology used in different ways on-site into a standard term, such as standardizing "switching plate" and "connecting plate" into the standard term "hard switching plate," eliminating semantic ambiguity. Equipment entities represent secondary equipment objects, such as relay protection devices, circuit breakers, and setting zones. A unique equipment code is a unique identifier assigned to each piece of secondary equipment.

[0022] To illustrate, it connects to the substation's on-site operation ticket system, setting sheet management system, relay protection procedure library, and other business databases to collect various plain text operation and maintenance data related to the current operation.

[0023] First, the collected raw maintenance text data is cleaned to remove irrelevant formatting symbols, redundant notes, and invalid content, resulting in neat, plain text. Then, terminology standardization is performed, unifying various colloquial and varied expressions used on-site into standard power terminology within the system to avoid semantic discrepancies. After preprocessing, entity recognition extracts three core types of information from the text: the specific equipment entity, the type of operation to be performed, and the current operational status of the equipment.

[0024] The extracted device entities need to be mapped to a device database using a globally unique device identifier to ensure the accuracy of subsequent rule matching. Finally, the three core fields—device identifier, operation action type, and current action status—are integrated to form a structured description of the operation event.

[0025] Schematic representation: the identifiable equipment entities cover various secondary equipment objects such as relay protection devices, hard pressure plates, soft pressure plates, circuit breakers, setting zones, and control circuits; the identifiable action states include static states such as pressure plate engaged / disengaged, circuit breaker closed / open, and setting zone currently active; the identifiable operation types include common maintenance operations such as engaging, disengaging, switching, starting, resetting, and verifying. Entity recognition and action extraction employ a dedicated recognition model adapted to the power industry, with specific optimizations for power terminology, and the recognition accuracy meets the requirements of on-site engineering applications.

[0026] In this embodiment, the standardized device codes and status fields can be accurately mapped to the nodes of the finite state machine, avoiding state recognition errors caused by semantic ambiguity and ensuring the accuracy of subsequent interlocking verification.

[0027] S2. Map the operation event description to the initial state node of the finite state machine, and determine the compliant action space allowed to be executed by the initial state node by combining the preset state transition rule matrix; wherein, the finite state machine is a deterministic state model representing the operation process of the secondary equipment. Specifically, a finite state machine is a deterministic state model representing the operation process of secondary equipment. It decomposes the complete operation process into multiple discrete business state nodes, with transitions between nodes following fixed locking rules. The state transition rule matrix represents a rule carrier storing the allowed operations and corresponding target states under each business state of the secondary equipment, serving as the core basis for preventing accidental locking. The compliant action space represents the set of all allowed operations that conform to the anti-accidental locking rules under the current business state.

[0028] Specifically, the finite state machine is constructed based on the power industry's relay protection regulations, field operation regulations, and historical compliant operation tickets. All state nodes and migration paths have been reviewed and confirmed by professional operation and maintenance personnel, ensuring strict business compliance.

[0029] To illustrate, after obtaining the description of the operation event, the device and state information are first mapped to specific nodes in the state machine to locate the current process stage of the operation, i.e., the initial state node. Then, using this initial state node as an index, a pre-stored state transition rule matrix is ​​queried to filter out all operation actions that conform to the locking rules, forming the compliant action space in the current state. This is equivalent to defining the legal operation range before the model generates content, thus defining the safety boundary from the source.

[0030] In a preferred embodiment of the present invention, the operation process of the secondary power equipment is abstracted into a deterministic finite state machine, which is defined as a quintuple: ,in, This represents a set of secondary equipment business statuses (such as operation preparation, pressure plate verification). S represents a set of structured events, corresponding to the extracted operation action types; S is a set of business states. The initial identification state, or initial state node, is determined by the joint mapping of the device's unique code and the current action state, representing the starting physical reference for the current service execution; A set of termination states for operations completed or archived; This is the state transition function. It uniquely maps the combination of the device's unique code and the current action state field to the business state set. Specific states in And assign it to the initial recognition state. This activates the initial state node of the finite state machine. Simultaneously, the operation action type field is read and mapped to an event set. Specific actions to be performed .

[0031] Preferably, the state transition rule matrix includes: a state transition Boolean matrix for characterizing the compliance of the corresponding operation action transition under the current action state, and a state transition target mapping matrix for storing the target business node index corresponding to the migration path; The operation event description is mapped to the initial state node of the finite state machine, and the compliant action space allowed to be executed by the initial state node is determined by combining the preset state transition rule matrix, including: The device unique code and current action state in the operation event description are jointly mapped to the service state set of the finite state machine, and the initial state node of the finite state machine is activated based on the service state set. The operation action type in the operation event description is mapped to the action to be executed in the structured event set of the finite state machine; Using the initial state node and each action to be executed as an index, query the state transition Boolean matrix one by one to obtain the compliance judgment result corresponding to each transition path; The operation actions corresponding to the migration path with a compliance determination result are used as the space of compliant actions that the initial state node is allowed to execute.

[0032] Specifically, the state transition Boolean matrix uses Boolean values ​​(0 or 1) to represent the legality of transitions between states and actions. A matrix element of 1 indicates that the transition path is compliant, and 0 indicates that it is non-compliant. The state transition target mapping matrix is ​​isomorphic to the state transition Boolean matrix and is used to store the index of the target business node corresponding to each compliant transition path, clarifying the landing point of the finite state machine after the action is executed. The business state set is a summary of all legal business state nodes in the finite state machine, corresponding to each stage in the operation process. The structured event set is a summary of all legal operation actions in the finite state machine, corresponding to various executable operation events. The action to be executed represents the operation action extracted from the operation event description and planned to be executed, used to match the transition rules.

[0033] To illustrate, the operation event description is parsed, and two fields—the unique device code and the current action state—are read. These are then checked against a pre-defined device state database, and the combination of these two fields is uniquely mapped to a specific node in the business state set. This node is the initial state node for the current operation, completing the activation and initialization of the state machine. Simultaneously, the action type field in the operation event description is read and mapped to a standard action entry in the structured event set, serving as the action to be verified.

[0034] Using the initial state as the row index and each action to be executed as the column index, query the corresponding element in the state transition Boolean matrix one by one. An element value of 1 indicates that executing the action from the current state is compliant; an element value of 0 indicates that the action violates the locking rule and is not allowed to be executed. Summarizing all the actions determined to be compliant constitutes the compliant action space in the current initial state, which is the rigid boundary of the content generated by the subsequent model.

[0035] To illustrate, the construction of the state transition Boolean matrix strictly follows the anti-misoperation interlocking procedures for secondary power equipment, and the legality of each transition path is reviewed and confirmed by professionals. The construction of the state transition target mapping matrix deeply integrates historical compliant operation tickets and relay protection procedures. It extracts deterministic triplet logic chains of preceding state-operation action-subsequent state from a large number of structured operation events, and records the target state corresponding to the legal transition into the mapping matrix; for illegal actions, the corresponding position in the matrix is ​​set to empty, maintaining the interlocked state.

[0036] In a preferred embodiment of the present invention, the business state set of the finite state machine includes four nodes: operation preparation state, platen verification state, platen operation state, and operation completion state. The structured event set includes three actions: platen input, platen output, and verification state. In the preset state transition Boolean matrix, the column value of the platen output corresponding to the platen verification state row is 1, and the column value of the platen input row is 0. After obtaining the operation event description, the device code and the current state—platen input—are jointly mapped to the platen verification state in the business state set, activating it as the initial state node. At the same time, the operation action type is mapped to the proposed actions of platen output and platen input. Using the platen verification state as the row index, the matrix elements corresponding to the two actions are queried respectively, and it is determined that platen output is compliant and platen input is non-compliant. Finally, the compliant action of platen output is selected, constituting the compliant action space of the current state.

[0037] In a preferred embodiment of the present invention, a state transition Boolean matrix is ​​established based on the secondary equipment anti-misoperation interlocking procedure. For the current action state With the proposed action Its matrix element definition Strictly defined as: Secondly, establish an isomorphic state transition target mapping matrix. The specific construction rules of this matrix are deeply bound to plain text data: the system extracts structured operation events from relay protection procedures and historical operation ticket texts, and mines deterministic triplet logic chains containing the preceding state, operation action, and subsequent state; for the Boolean matrix, the system determines the migration path as valid (i.e., The exact physical successor state parsed from the triplet logical chain is entered as the target node index. In the middle; for illegal actions not appearing in the procedure text, set to null or point to the current state to maintain the lock. After storing the index of the target node of the legal action, the current action state. The compliant action space rigidly permitted by the finite state machine can be defined as Among them, the state transition operator The mathematical continuity completeness is defined as: .

[0038] The binary decision method of the Boolean matrix in this embodiment has an extremely fast calculation speed, which can meet the low latency requirements of real-time on-site verification and is suitable for operation and maintenance scenarios with high response speed requirements. When the on-site operation procedures are updated, only the element values ​​in the matrix need to be modified accordingly, without changing the core program logic, which facilitates subsequent rule iteration and on-site adaptation.

[0039] S3. The compliant action space is transformed into a dynamic lexical constraint set through a preset large language model. The dynamic lexical constraint set is decoded and deduced based on the logical value masking mechanism to generate preliminary operation strategy text. Specifically, the large language model is a pre-trained language model with natural language understanding and generation capabilities, used to generate operation guidance text that conforms to power operation and maintenance scenarios. The dynamic lexical constraint set represents the mapping of the compliant action space to lexical-level constraints that the model can recognize, limiting the model to only generating lexicals within the set during the decoding process. The logical value masking mechanism punishes the predicted logical values ​​of illegal lexicals, forcing their generation probability to zero. The preliminary operation strategy text represents the operation guidance text generated by the model after restricted decoding, which has not yet undergone final verification. Based on the general base model, a dedicated large language model for secondary equipment operation safety verification is obtained through fine-tuning and training using corpora from the power secondary equipment operation and maintenance field, including relay protection regulations, field operation tickets, setting sheet specifications, and equipment operation and maintenance manuals.

[0040] Schematic illustration: After defining the compliant action space, it is converted into a set of lexical constraints recognizable by the model's decoding layer—a dynamic set of lexical constraints. During the model's autoregressive text generation process, a logistic masking mechanism operates in real-time at each decoding step, allowing the model to select output content only within the range of legal lexical terms. This constrains the model's output from the underlying lexical generation stage, preventing the generation of illegal content. Through word-by-word restricted decoding, the initial operational strategy text is finally generated.

[0041] Preferably, the compliant action space is transformed into a dynamic lexical constraint set through a preset large language model, and the dynamic lexical constraint set is decoded and deduced based on a logical value masking mechanism to generate preliminary operation strategy text, including: The compliant action space is converted into a text template, and the text template is mapped into a dynamic prefix tree by the word segmenter of the preset large language model; Based on the current initial state node and the generated lexical prefixes, the dynamic lexical constraint set that the current decoding step is subject to the finite state machine locking rule is determined through the dynamic prefix tree; Determine whether the dynamic lexical constraint set is empty; if so, generate a security prompt; otherwise, at each time step of the autoregressive decoding of the large language model, obtain the unnormalized logical tensor of the large language model in the forward propagation process, and apply negative infinity penalty to illegal lexicals that do not belong to the dynamic lexical constraint set through a logical value masking mechanism to obtain the masked logical tensor. The masked logical tensor is subjected to softmax calculation to obtain a restricted probability distribution. Based on the restricted probability distribution, the legal words of the current decoding step are selected, and the legal words of each decoding step are concatenated to generate the preliminary operation strategy text.

[0042] Specifically, the text template is a template text that converts the compliant action space into natural language form, serving as a framework constraint for the content generated by the model. The dynamic prefix tree is used to maintain the legal words allowed to be generated in the current decoding step in real time, updating dynamically as the generation process progresses. The unnormalized logic tensor represents the raw predicted value output by the model's forward propagation, representing the generation probability of each word, and has not yet undergone probability normalization. The negative infinity penalty assigns a negative infinity value to the logic value of illegal words, causing it to approach 0 in subsequent probability calculations. The Softmax calculation converts the logic values ​​into a probability distribution, outputting the generation probability of each word, with the sum of all word probabilities being 1. The restricted probability distribution represents the probability distribution obtained after masking constraints, where only legal words have a generation probability, and illegal words have a probability of 0.

[0043] To illustrate, the compliant action space is first converted into a text template in natural language form to clarify the scope of legal action expressions. Then, the model's word segmenter is invoked to split the text template into a sequence of lexical units and construct a dynamic prefix tree as the carrier of lexical-level constraints.

[0044] At each step of the autoregressive decoding process, based on the generated lexical prefixes, the next allowed lexical term is matched in the dynamic prefix tree, forming the dynamic lexical constraint set for the current decoding step. As the generation process progresses, the prefix tree nodes move forward continuously, and the constraint set is dynamically updated.

[0045] Before formal decoding, an empty set check is performed. If the dynamic lexical constraint set is empty, it means there are no valid subsequent lexical terms under the current prefix. Continuing decoding will result in a logical exception, and the system will directly terminate the decoding thread and output a preset safety warning to prevent the program from entering an infinite loop. If the dynamic lexical constraint set is not empty, decoding is performed normally: the original logical tensor output by the model is obtained, and a penalty value of negative infinity is uniformly applied to all illegal lexical terms that are not in the dynamic lexical constraint set.

[0046] The masked logical tensor is fed into the Softmax function for calculation. Illegal words, due to their negative infinity logical values, have their calculated probabilities compressed to 0. The remaining legal words undergo automatic probability renormalization, forming a restricted probability distribution. The legal word with the highest probability is selected as the output of the current step and appended to the generated sequence. This word-by-word generation process is repeated until the model outputs a termination word. Finally, all words are concatenated to form a complete preliminary operational strategy text.

[0047] Indicatively, this embodiment abandons the traditional post-probability zeroing operation and directly applies a mask to the unnormalized logical values ​​before Softmax calculation, avoiding floating-point overflow issues that may occur during calculation of extremely large vocabularies, resulting in stronger numerical stability. The empty set exception protection mechanism is a hardware-level blocking mechanism; once triggered, it directly terminates the decoding thread, preventing the spread of logical exceptions from the underlying layer. In addition, the dynamic prefix tree is updated synchronously with lexical generation; each generated lexical advances a tree node, ensuring that the constraints at each step precisely match the current generation progress.

[0048] In a preferred embodiment of the present invention, the established compliance action space It is directly used as the current restricted action generation boundary of the large language model and transformed into a text template, which is then mapped to a dynamic prefix tree by the word segmenter. Given the current action state Prefixes of already generated lexical units In the During autoregressive decoding, the set of dynamically valid tokens constrained by the state machine locking rules is: ,in, A pre-built set of tokens for large language models, containing all the basic text units that the model can generate; This is the state transition function for the prefix tree.

[0049] To avoid floating-point overflow when calculating extremely large vocabularies, this invention abandons the traditional post-probability zero-mapping operation and constructs a state machine-based dynamic logical value masking mechanism (Logit Masking, LM). A dynamic masking penalty function is defined. It directly affects the unnormalized logical tensor of the model: . Assuming the model is in the first The original unnormalized logical tensor vector obtained through forward propagation is: ,in For specific word elements The predicted scalar value. The final physical joint probability distribution of the constrained decoding is calculated using the masked Softmax function: In the formula, This represents the valid words actually output at the current time step.

[0050] Before calculating the exponent, - In the logic of introducing illegal words, the probability weight of the illegal word element is exp(- The denominator will be forcibly compressed to 0 during the Softmax computation phase. The global summation operation of the denominator automatically completes the renormalization of the probabilities of the remaining legal tokens, forcibly clearing the joint probability of generating illegal operations in the large model to zero at the algorithm tensor level, ensuring the absolute stability of numerical computation and the safety of physical boundaries.

[0051] Among them, the dynamic valid set is determined before decoding, if This triggers a hardware-level block, immediately terminating the current autoregressive decoding thread, discarding the illegally generated branch, and preventing the program from falling into a logical infinite loop.

[0052] In a preferred embodiment of the present invention, taking the generation of the text "Exit Main Protection Plate" as an example, the compliant action space "Exit Main Protection Plate" is first converted into a text template, which is then split by a word segmenter to construct a dynamic prefix tree. In the first decoding step, the generated prefix is ​​empty. The prefix tree determines that the dynamic word constraint set only contains the word "exit". The empty set is determined not to be empty, and decoding continues. The model forward propagates and outputs the original logic tensor, where the input logic value was originally the highest, but it belongs to an illegal word and is subject to a negative infinity penalty; the logic value of "exit" retains its original value. After Softmax calculation, the probability of "exit" is 100%, and it is selected as the first output word. After generating "exit", the prefix tree node advances to after "exit", and the constraint set in the second step is updated to "main protection". The masking and probability calculation process is repeated to select the second word "main protection". The prefix tree continues to advance, and the constraint set in the third step is "plate", selecting the third word "plate". Subsequently, the model outputs the termination word, and decoding ends. The three words are concatenated to obtain the preliminary operation strategy text: "Exit Main Protection Plate". If the constraint set is empty at any step during the decoding process, the system will immediately terminate the decoding and output a safety message indicating that there are no valid operation instructions in the current state.

[0053] This embodiment applies a mask before normalization, avoiding the floating-point precision issues caused by traditional post-rounding, resulting in a more reliable calculation process and suitability for power scenarios with extremely high security requirements. It proactively terminates decoding in advance to anticipate abnormal scenarios with no valid tokens, preventing division-by-zero errors or logical loops and improving system robustness. The prefix tree is dynamically updated during the generation process, with constraints at each step precisely adapting to the current context, ensuring security without unduly limiting the model's expressive power.

[0054] S4. Input the preliminary operation strategy text into the finite state machine in reverse, and perform a locking check on the consistency of state transition according to the state transition rule matrix. Specifically, the latching check for state transition consistency involves inputting the generated operation strategy back into the state machine to verify whether it conforms to the state transition rules; this is a secondary check step.

[0055] To illustrate, after generating the preliminary operation strategy text, the text is sent back to the finite state machine for secondary verification. The operation actions in the generated preliminary operation strategy text are parsed, and the state transition rule matrix is ​​used to verify again whether the action truly meets the locking requirements of the current state, which is equivalent to adding another layer of security.

[0056] Preferably, the preliminary operation strategy text is input in reverse into the finite state machine, and a locking check for state transition consistency is performed according to the state transition rule matrix, including: The initial operation strategy text is input in reverse into the finite state machine to extract the target operation action; The target operation action and the current initial state node are input into the state transition rule matrix, and a preset consistency locking check function is called to perform a Boolean-type determination. If all verification factors in the consistency locking verification function are determined to be compliant, the locking verification is deemed to have passed. If any check factor in the consistency latch check function is determined to be non-compliant, the latch check is deemed to fail.

[0057] Specifically, the consistency latching verification function is used to perform secondary verification. The input is the generated operation strategy and the current state, and the output is the final verification result. Each verification factor corresponds to a specific latching rule, such as timing compliance, state matching, device permissions, etc.

[0058] To illustrate, the initial strategy text is first parsed to extract the core target operation information and clarify the specific operation content generated.

[0059] The extracted target action and the current initial state node are input into the state transition rule matrix, and the consistency locking check function is called to perform the judgment. The check function checks each check factor item by item to verify whether the action conforms to all locking rules in the current state.

[0060] If all check factors in the consistency lockout check function are deemed compliant, the lockout check is considered successful. The overall check function will only output a compliance result and the lockout check is considered successful when all check factors are deemed compliant and none violate the rules. If any check factor is deemed non-compliant, regardless of the compliance of other factors, the overall check result will be non-compliant, the lockout check will be considered uncompliant, and the subsequent interception and feedback process will be triggered.

[0061] Indicatively, the verification factors included in the consistency interlocking verification function can be flexibly configured according to field requirements. Common verification factors include: state-sequence matching factor, used to verify whether the action meets the timing requirements of the current operation stage; equipment interlocking condition factor, used to verify whether the equipment currently meets the physical conditions for executing the action; cross-equipment interlocking factor, used to verify whether the action will affect the safe operation of associated equipment; and operation permission factor, used to verify whether the action is within the permission scope of the current operation.

[0062] In a preferred embodiment of the present invention, the generated preliminary strategy sequence is fed back to the state machine for secondary consistency verification, and a consistency locking verification function is constructed. Perform secondary physical interception: ,in, Current action state Total number of activated verification rules. Each verification factor. It is a strict Boolean decision value.

[0063] If and only if all check factors Overall verification function The process proceeds using a finite state machine; if any logical conflict exists that causes a certain... ,but This directly triggers the hardware-level blocking mechanism and sends out a penalty feedback request for re-analysis.

[0064] Once the post-consistency check passes, the finite state machine officially advances to the next legal state node, outputting the final intelligent auxiliary operation suggestions or Q&A results to the on-site operators. Simultaneously, the state transition log, large model generation results, rule verification report, and user confirmation record are written to the security audit database, achieving a closed-loop traceability throughout the entire process.

[0065] In a preferred embodiment of the present invention, upon receiving the preliminary operation strategy text: "Activate the main protection pressure plate," the target operation action is first parsed and extracted as "Activate the pressure plate." The activation action and the current initial pressure plate verification state are input into the state transition rule matrix, and the consistency interlocking verification function is called. The verification function checks each factor: the timing matching factor determines that the activation action does not meet the timing requirements of the pressure plate verification state, and is therefore deemed non-compliant; the equipment interlocking condition factor verifies that the current equipment does not meet the activation conditions, and is also deemed non-compliant. Since there is at least one non-compliant verification factor, the overall verification function outputs a non-compliant result, determining that the interlocking verification fails, and triggering the blocking and feedback process. If the extracted target action is "Exit the pressure plate," and all verification factors are deemed compliant, then the interlocking verification is ultimately deemed successful.

[0066] In this embodiment, the front-end decoding constraint restricts the content from the generation end, while the back-end consistency check verifies it again from the rule end. The two lines of defense complement each other. Even if the front-end constraint is abnormal, the back-end check can still intercept it, further improving security.

[0067] S5. If the interlocking verification passes, the finite state machine is advanced to the corresponding target business node based on the state transition rule matrix and the preliminary operation strategy text, and operation question and answer results are generated.

[0068] Specifically, the target business node represents the next business state node that the finite state machine will transition to after the operation is completed. The operation Q&A result represents the standardized operation guidance content that is finally output to the on-site operators after complete security verification.

[0069] To illustrate, if the secondary verification confirms that the operation is fully compliant, the state machine is advanced from the current initial node to the corresponding target business node according to the preset transition path in the state transition rule matrix, completing one state transition. Simultaneously, the verified operation strategies are compiled into standardized operation Q&A results and output to on-site operators.

[0070] Preferably, based on the state transition rule matrix and the preliminary operation strategy text, the finite state machine is advanced to the corresponding target business node, generating operation question-and-answer results, including: Based on the state transition target mapping matrix in the state transition rule matrix, query the target business node index corresponding to the current compliant migration path, and advance the finite state machine from the initial state node to the corresponding target business node; The initial operation strategy text that has passed the lockout verification is converted into standardized operation guidance content, and operation Q&A results are generated based on the standardized operation guidance content.

[0071] Specifically, the target business node index is a unique identifier of the target node stored in the state transition target mapping matrix, used to locate the specific target state.

[0072] To illustrate, after the interlock verification passes, the state transition target mapping matrix is ​​queried using the current initial state and compliant actions as indexes to obtain the corresponding target business node index. Then, the state machine is controlled to complete the node jump, transitioning from the initial state to the target state, completing a full state transition. Simultaneously, the verified preliminary policy text is organized and optimized according to the standard format for on-site operations and maintenance, supplementing necessary safety precautions to form standardized operational guidance content. Finally, it is packaged into an operational Q&A result and output to the operators.

[0073] To illustrate, after the state machine completes node advancement, it automatically archives all relevant information for this state transition, including the pre-migration state, executed actions, post-migration state, verification results, and generation time, storing it in the security audit database to achieve traceability and record-keeping throughout the entire operation process. The output operation Q&A results can be directly pushed to the on-site maintenance terminal or communicated to operators via voice broadcast, adapting to different on-site work scenarios. Furthermore, the compliance action space corresponding to the new node is updated synchronously after state advancement, preparing for verification of the next operation.

[0074] In a preferred embodiment of the present invention, after the interlocking verification is passed, the state transition target mapping matrix is ​​queried using the initial state (pressure plate verification state) and the compliant action (pressure plate exit) as indexes to obtain the target business node as the pressure plate operation execution state. The finite state machine is controlled to advance from the pressure plate verification state to the pressure plate operation execution state, completing the state transition. At the same time, the preliminary operation strategy text "Exit 220kV Line A Main Protection Hard Pressure Plate" is standardized, supplemented with safety precautions, and formed an operation Q&A result: Operation instruction: Exit 220kV Line A Main Protection Hard Pressure Plate; Precautions: Before operation, please confirm that the protection device is in normal operating condition; after operation, please check the pressure plate position indicator status.

[0075] In this embodiment, after each compliance operation verification is passed, the finite state machine automatically advances to the next stage. The state transition of the entire operation process is fully controllable and meets the timing requirements of secondary equipment operation.

[0076] Preferably, it further includes: If the lockout check fails, a penalty feedback signal is generated and returned to the large language model. The large language model is then driven to re-decode and deduce based on the current initial state node and the corresponding compliance action space to generate a new preliminary operation strategy text. The new preliminary operation strategy text is input into the finite state machine in reverse, and the state transition consistency is checked according to the state transition rule matrix.

[0077] Specifically, the penalty feedback signal represents the feedback control signal sent to the large language model when the verification detects non-compliant content. This signal informs the model that the generated result is non-compliant, triggering a regeneration process. Upon receiving the penalty feedback signal, the large language model re-executes the restricted decoding process while maintaining the current state constraints, generating a new operation strategy.

[0078] To illustrate, when the latch check for state transition consistency detects that the generated preliminary operation strategy text violates the latch rule, the process is not directly interrupted. Instead, a corresponding penalty feedback signal is generated and sent back to the inference input layer of the large language model, explicitly informing the model that the generated content violates the latch rule. After receiving the feedback, the model still uses the current initial state node and the compliant action space as the constraint boundary to re-execute the complete restricted decoding process and generate a new preliminary operation strategy text.

[0079] After the new policy text is generated, it also needs to be sent to the state machine for a second consistency lockout check to confirm its compliance. If the lockout check passes, the process proceeds according to the first implementation method and the result is output; if it still fails, the feedback re-deduction process can be triggered again until compliant content is generated or the preset retry limit is reached. To avoid the abnormal situation of infinite loop, a maximum number of retries is preset, usually set to 3 times. If multiple consecutive generation attempts fail the lockout check, the generation process will be terminated and a preset security prompt will be output, while the operation and maintenance management personnel will be notified. In addition, the penalty feedback signal not only includes the violation judgment result, but also carries specific violation information, helping the model to more accurately adjust the generation direction and improve the first-pass rate of re-deduction.

[0080] In a preferred embodiment of the present invention, taking the operation of the 220kV A-line main protection pressure plate as an example, it is assumed that when the large language model is generated for the first time, due to the deviation in the distribution of the corpus, a preliminary operation strategy text is generated: "Activate the 220kV A-line main protection hard pressure plate". This preliminary operation strategy text is input into the finite state machine for consistency verification. It is determined that the current initial state is the pressure plate operation preparation state. The action of activation does not conform to the interlocking rules of this state, and the interlocking verification fails. Subsequently, a penalty feedback signal is generated and returned to the large language model to clearly indicate that the action is in violation. After receiving the feedback, the model still uses the pressure plate operation preparation state and the corresponding compliant action space as constraints to re-execute the restricted decoding deduction and generate a new preliminary operation strategy text: "Exit the 220kV A-line main protection hard pressure plate". The newly generated strategy is sent into the state machine again for interlocking verification. The action is confirmed to be compliant, the verification passes, and the subsequent state is advanced and the result is output according to the normal process.

[0081] This embodiment can complete error correction without manual intervention. The entire process is closed-loop and self-consistent, without any process breaks. Automatic error correction avoids the step of manually submitting requests repeatedly. Operators only need to wait for the final compliance result, which is more in line with the needs of continuous on-site operations.

[0082] In a preferred embodiment of the present invention, such as Figure 2As shown, after the process starts, multi-source single-modal text acquisition and preprocessing are first performed, ultimately generating a structured operation event description including the device's unique code, operation action type, and current action state. Then, based on the pre-constructed state transition Boolean matrix and state transition target mapping matrix, the device's unique code in the operation event description is jointly mapped to the current action state, activating the initial state node of the finite state machine. Using this initial state node and the extracted intended action as an index, the state transition Boolean matrix is ​​queried to determine the legal action space under the current initial node. Next, the token-level dynamic prefix mapping is completed through the word segmenter of the large language model, constructing the corresponding dynamic prefix tree, and sinking the constraints of the action space down to the word unit granularity. After the mapping is completed, the autoregressive decoding step t officially starts. The system checks if the dynamic legal token set corresponding to the current decoding step is empty. If the set is empty (e.g., there are no matching legal subsequent tokens under the currently generated prefix), the empty set protection mechanism is triggered, directly interrupting the current decoding thread and outputting a preset safety warning to prevent the program from falling into a logical exception. If the set is not empty, dynamic logic masking penalty is executed: the unnormalized logic tensor output from the forward propagation of the current step is obtained, and negative infinity logic values ​​are applied to all illegal tokens based on the dynamic legal token set to complete the masking process. After masking is completed, the system checks if the current token autoregressive decoding has ended. If not, the system returns to the autoregressive decoding step, advances the prefix tree node, updates the legal token set for the next step, and repeats the loop of empty set determination, masking penalty, and token generation, generating the operation strategy text word by word. After the initial strategy is generated, the consistency verification function is called to perform the judgment: if the verification judgment result is C=0 (verification fails), the penalty feedback signal is sent back to the decoding stage, driving the large language model to restart autoregressive decoding based on the current initial state node and the legal action space, generate a new initial strategy again and perform the verification, forming a closed-loop error correction process; if the judgment result is C=1 (verification passes), the finite state machine is advanced to the next legal node, and the verified operation strategy is organized into standardized operation suggestions and output to the field operation and maintenance terminal.

[0083] In a preferred embodiment of the present invention, taking the operation of the main protection pressure plate of a 220kV substation line protection device as an example, the on-site operator needs to perform the main protection pressure plate deactivation operation. First, the operation event description corresponding to the current operation is obtained, clarifying that the operation object is the 220kV A-line main protection hard pressure plate, and the current action state is "initiated". The device and state information are mapped to a finite state machine, and the initial state node is located as the pressure plate operation preparation state. Then, the state transition rule matrix is ​​queried, and the only compliant action in this state is deactivating the main protection pressure plate, thus determining that the compliant action space only contains this action. After receiving the compliant action space, the large language model converts it into a dynamic lexical constraint set. During the decoding and generation process, the logical value masking mechanism will block illegal lexicals such as "initiated" and "switched", only allowing the generation of legal lexicals such as "deactivated" and "main protection pressure plate", and finally generating the preliminary operation strategy text: Deactivate 220kV A-line main protection hard pressure plate. The preliminary operation strategy text is input into the finite state machine in reverse, and the consistency is checked against the state transition rule matrix. It is confirmed that the action of deactivating the main protection pressure plate meets the blocking requirements of the current state, and the blocking check passes. Finally, the finite state machine progresses from the pressure plate operation preparation state to the pressure plate operation execution state, generating and outputting standardized operation Q&A results to guide on-site personnel in performing the operation.

[0084] In existing technologies, locking rules only take effect after output, completely disconnected from the model generation process. This embodiment uses the same set of state transition rules simultaneously for pre-boundary constraints, generation process constraints, and post-consistency checks, allowing locking rules to permeate the entire model inference chain. This addresses the control lag caused by the disconnect between the two at the architectural level, breaking the loose coupling architecture between the large model and anti-misoperation locking, and achieving deep integration of locking rules and model inference. Existing models are unaware of their current operation stage when generating content, easily outputting instructions with timing errors. This embodiment, through state node mapping, injects the current operation stage as a core constraint into the generation process. The model can only generate content allowed by the current state, essentially letting the model know which step of the operation it is in, naturally preventing the output of content violating timing rules, thus giving the model state awareness of the operation process. Existing post-interception can only delete illegal content after it is generated, failing to prevent the model from generating illegal content. This embodiment directly applies constraints at the token decoding layer, preventing illegal tokens from being generated at all, clearing the probability of illegal operations from the algorithm source. This provides a higher level of protection than post-interception, resulting in higher security. Meanwhile, the pre-generation constraints and post-consistency checks work together to ensure the compliance of the output content. This can not only avoid anomalies at the model generation level, but also deal with the risks brought about by temporary changes in state. The overall security control reliability is far higher than that of a single post-check.

[0085] By implementing this embodiment, the description of operational events is mapped to the initial state node of a finite state machine. The state transition rule matrix of the finite state machine serves as a unified locking rule carrier, acting on the locking verification of large language model decoding and state transition consistency. This ensures that the anti-misoperation locking rules are implemented throughout the entire process, achieving deep coupling between the state locking mechanism and model reasoning at the architectural level, thus resolving the problem of control lag caused by the disconnect between the two. Using the compliant action space corresponding to the initial state node as a boundary constraint is equivalent to using the current business stage state as the core constraint condition, limiting the generated preliminary operation strategy text to the allowable range of the current state. The current operational state node constraints enable the system to perceive the state of secondary equipment operation processes. Then, the compliant action space is transformed into a dynamic set of lexical constraints, which is directly applied to the decoding and deduction process through a logical value masking mechanism. This compresses the generation space of non-compliant content from the source of reasoning and decoding, fundamentally reducing the risk of generating illusory content that violates locking rules. Finally, state transition consistency locking verification is performed based on the state transition rule matrix. Through a dual verification mechanism of pre-generation constraints and post-rule verification, it is ensured that the final operation question and answer result conforms to the state locking rules, effectively strengthening security control capabilities and improving the safety of on-site operations.

[0086] See Figure 3 This is a schematic diagram of a secondary equipment operation safety verification device based on state interlocking drive according to an embodiment of the present invention, comprising: Operation event description acquisition module 101 is used to acquire the operation event description of the power secondary equipment to be verified. The compliance action space determination module 102 is used to map the operation event description to the initial state node of the finite state machine, and determine the compliance action space that the initial state node is allowed to execute by combining the preset state transition rule matrix; wherein, the finite state machine is a deterministic state model that represents the operation process of the secondary equipment. The preliminary operation strategy text generation module 103 is used to transform the compliant action space into a dynamic lexical constraint set through a preset large language model, and to decode and deduce the dynamic lexical constraint set based on a logical value masking mechanism to generate the preliminary operation strategy text. The latching verification module 104 is used to input the preliminary operation strategy text into the finite state machine in reverse and perform latching verification of state transition consistency according to the state transition rule matrix. The operation question and answer result generation module 105 is used to advance the finite state machine to the corresponding target business node based on the state transition rule matrix and the preliminary operation strategy text, and generate operation question and answer results when the latching verification passes.

[0087] This invention provides a secondary equipment operation safety verification device based on state interlocking. The device comprises: an operation event description acquisition module to acquire operation event descriptions of the secondary power equipment to be verified; a compliance action space determination module to map the operation event descriptions to initial state nodes of a finite state machine, and a preset state transition rule matrix to determine the compliant action space allowed to be executed by the initial state nodes; wherein the finite state machine is a deterministic state model representing the operation process of the secondary equipment; a preliminary operation strategy text generation module to transform the compliant action space into a dynamic lexical constraint set using a preset large language model, and to decode and deduce the dynamic lexical constraint set based on a logical value masking mechanism to generate preliminary operation strategy text; an interlocking verification module to input the preliminary operation strategy text back into the finite state machine, and to perform interlocking verification for state transition consistency based on the state transition rule matrix; and finally, an operation question-and-answer result generation module to advance the finite state machine to the corresponding target business node based on the state transition rule matrix and the preliminary operation strategy text, if the interlocking verification passes, generating operation question-and-answer results.

[0088] This invention maps operational event descriptions to the initial state nodes of a finite state machine. Using the state transition rule matrix of the finite state machine as a unified locking rule carrier, it applies to the locking verification of large language model decoding and state transition consistency. This ensures that anti-misoperation locking rules are implemented throughout the entire process, achieving deep coupling between the state locking mechanism and model inference at the architectural level, thus solving the problem of control lag caused by the disconnect between the two. Using the compliant action space corresponding to the initial state node as boundary constraints is equivalent to using the current business stage state as the core constraint condition, limiting the generated preliminary operation strategy text to the allowable range of the current state, thereby achieving the current... The system constrains the state nodes of operations, enabling it to perceive the state of secondary equipment operation processes. Then, it transforms the compliant action space into a dynamic set of lexical constraints, which is directly applied to the decoding and deduction process through a logical value masking mechanism. This compresses the generation space of non-compliant content from the source of reasoning and decoding, fundamentally reducing the risk of generating illusory content that violates locking rules. Finally, it performs state transition consistency locking verification based on the state transition rule matrix. Through a dual verification mechanism of pre-generation constraints and post-rule verification, it ensures that the final operation question-and-answer result conforms to the state locking rules, effectively strengthening security control capabilities and improving the safety of on-site operations.

[0089] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.

[0090] Those skilled in the art will understand that, for convenience and brevity, the specific working process of the device described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0091] Another embodiment of the present invention provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements a secondary device operation security verification method based on state interlocking drive as described in the above embodiments. The terminal device may be a desktop computer, laptop, handheld computer, cloud server, or other computing device. The terminal device may include, but is not limited to, a processor and a memory.

[0092] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the terminal device, connecting all parts of the terminal device via various interfaces and lines.

[0093] The memory can be used to store the computer program. The processor implements various functions of the terminal device by running or executing the computer program stored in the memory and calling data stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function, etc.; the data storage area may store data created based on the use of the mobile phone, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, RAM, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device or other volatile solid-state storage device.

[0094] Another embodiment of the present invention provides a computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform a secondary device operation security verification method based on state interlocking drive as described in the above embodiment.

[0095] The storage medium is a computer-readable storage medium, and the computer program is stored in the computer-readable storage medium. When the computer program is executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.

[0096] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A secondary device operation safety verification method based on state latching drive, characterized in that, include: Obtain the operation event description of the secondary power equipment to be verified; The operation event description is mapped to the initial state node of the finite state machine, and the compliant action space allowed to be executed by the initial state node is determined by combining the preset state transition rule matrix; wherein, the finite state machine is a deterministic state model representing the operation process of the secondary equipment. The compliant action space is transformed into a dynamic lexical constraint set by a pre-set large language model. The dynamic lexical constraint set is then decoded and deduced based on a logical value masking mechanism to generate preliminary operation strategy text. The initial operation strategy text is input into the finite state machine in reverse, and the state transition consistency is checked according to the state transition rule matrix. If the latching verification passes, the finite state machine is advanced to the corresponding target business node based on the state transition rule matrix and the preliminary operation strategy text, and operation question and answer results are generated.

2. The secondary device operation safety verification method based on state lockout driving according to claim 1, characterized in that, Also includes: If the lockout check fails, a penalty feedback signal is generated and returned to the large language model. The large language model is then driven to re-decode and deduce based on the current initial state node and the corresponding compliance action space to generate a new preliminary operation strategy text. The new preliminary operation strategy text is input into the finite state machine in reverse, and the state transition consistency is checked according to the state transition rule matrix.

3. The method for verifying the operation safety of secondary equipment based on state interlocking as described in claim 1, characterized in that, Obtain the operation event description of the secondary power equipment to be verified, including: Obtain the operation and maintenance text data of the secondary power equipment to be verified; After performing text cleaning and terminology standardization on the maintenance text data, the device entity, operation action type, and current action status are identified. The device entity is mapped to a unique device code, and an operation event description of the secondary power equipment to be verified is generated based on the unique device code, the operation action type, and the current action status.

4. The method for verifying the operation safety of secondary equipment based on state interlocking as described in claim 1, characterized in that, The state transition rule matrix includes: a state transition Boolean matrix used to characterize the compliance of the corresponding operation action transition under the current action state, and a state transition target mapping matrix used to store the target business node index corresponding to the migration path; The operation event description is mapped to the initial state node of the finite state machine, and the compliant action space allowed to be executed by the initial state node is determined by combining the preset state transition rule matrix, including: The device unique code and current action state in the operation event description are jointly mapped to the service state set of the finite state machine, and the initial state node of the finite state machine is activated based on the service state set. The operation action type in the operation event description is mapped to the action to be executed in the structured event set of the finite state machine; Using the initial state node and each action to be executed as an index, query the state transition Boolean matrix one by one to obtain the compliance judgment result corresponding to each transition path; The operation actions corresponding to the migration path with a compliance determination result are used as the space of compliant actions that the initial state node is allowed to execute.

5. The method for verifying the operation safety of secondary equipment based on state interlocking as described in claim 1, characterized in that, The compliant action space is transformed into a dynamic lexical constraint set using a pre-defined large language model. Based on a logical value masking mechanism, the dynamic lexical constraint set is decoded and deduced to generate preliminary operation strategy text, including: The compliant action space is converted into a text template, and the text template is mapped into a dynamic prefix tree by the word segmenter of the preset large language model; Based on the current initial state node and the generated lexical prefixes, the dynamic lexical constraint set that the current decoding step is subject to the finite state machine locking rule is determined through the dynamic prefix tree; Determine whether the dynamic lexical constraint set is empty; if so, generate a security prompt; otherwise, at each time step of the autoregressive decoding of the large language model, obtain the unnormalized logical tensor of the large language model in the forward propagation process, and apply negative infinity penalty to illegal lexicals that do not belong to the dynamic lexical constraint set through a logical value masking mechanism to obtain the masked logical tensor. The masked logical tensor is subjected to softmax calculation to obtain a restricted probability distribution. Based on the restricted probability distribution, the legal words of the current decoding step are selected, and the legal words of each decoding step are concatenated to generate the preliminary operation strategy text.

6. The method for verifying the operation safety of secondary equipment based on state interlocking as described in claim 1, characterized in that, The initial operation strategy text is input into the finite state machine in reverse, and a locking check for state transition consistency is performed according to the state transition rule matrix, including: The initial operation strategy text is input in reverse into the finite state machine to extract the target operation action; The target operation action and the current initial state node are input into the state transition rule matrix, and a preset consistency locking check function is called to perform a Boolean-type determination. If all verification factors in the consistency locking verification function are determined to be compliant, the locking verification is deemed to have passed. If any check factor in the consistency latch check function is determined to be non-compliant, the latch check is deemed to fail.

7. The method for verifying the operation safety of secondary equipment based on state interlocking as described in claim 1, characterized in that, Based on the state transition rule matrix and the preliminary operation strategy text, the finite state machine is advanced to the corresponding target business node, generating operation question-and-answer results, including: Based on the state transition target mapping matrix in the state transition rule matrix, query the target business node index corresponding to the current compliant migration path, and advance the finite state machine from the initial state node to the corresponding target business node; The initial operation strategy text that has passed the lockout verification is converted into standardized operation guidance content, and operation Q&A results are generated based on the standardized operation guidance content.

8. A state latch-based drive secondary equipment operation safety verification device, characterized in that, include: The operation event description acquisition module is used to acquire the operation event description of the secondary power equipment to be verified. The compliance action space determination module is used to map the operation event description to the initial state node of the finite state machine, and determine the compliance action space that the initial state node is allowed to execute by combining the preset state transition rule matrix; wherein, the finite state machine is a deterministic state model representing the operation process of the secondary equipment; The preliminary operation strategy text generation module is used to transform the compliant action space into a dynamic lexical constraint set through a preset large language model, and to decode and deduce the dynamic lexical constraint set based on a logical value masking mechanism to generate the preliminary operation strategy text. The latching verification module is used to input the preliminary operation strategy text in reverse into the finite state machine and perform latching verification of state transition consistency according to the state transition rule matrix. The operation question and answer result generation module is used to advance the finite state machine to the corresponding target business node based on the state transition rule matrix and the preliminary operation strategy text, and generate operation question and answer results, when the latching verification passes.

9. A terminal device, comprising: The device includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements a secondary device operation security verification method based on state interlocking drive as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform a secondary device operation security verification method based on state interlocking drive as described in any one of claims 1 to 7.