Logic expression generation method and device, computer equipment and storage medium
By acquiring secondary equipment ledger information, selecting target rule items in the rule information database, matching actual signal identifiers, and performing adaptation processing, the target logical expression is generated, which solves the consistency and reliability problems of logical configuration in the substation secondary system and realizes the automation and standardization of logical expressions.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CYG CONTRON
- Filing Date
- 2026-01-09
- Publication Date
- 2026-04-24
AI Technical Summary
The configuration of logic expressions in existing substation secondary systems relies on manual compilation, resulting in poor engineering consistency. This makes it difficult to meet the requirements of large-scale engineering construction and intelligent operation and maintenance for the automation, standardization, and reliability of secondary logic. It is also prone to omissions, confusion, or logical errors due to differences in equipment types and complex signal numbering.
By acquiring secondary equipment ledger information, the target rule item is selected from the rule information database based on the logical type, the actual signal identifier is matched and an initial logical expression is generated, and the target logical expression is generated by combining the applicable condition field for adaptation processing.
It improves the correctness, consistency, and engineering applicability of the generated logical expressions, avoids configuration errors caused by device differences or mixed rules, and meets the needs of large-scale engineering construction and intelligent operation and maintenance.
Smart Images

Figure CN121920953A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power system automation, and in particular to a method, apparatus, computer equipment, and storage medium for generating logical expressions. Background Technology
[0002] Currently, in the field of power system automation, substation secondary systems undertake key functions such as relay protection, control interlocking, five-prevention interlocking, and operation monitoring. Various protection and control logics are typically configured in the form of logical expressions to describe the logical relationships between different secondary signals, thereby achieving correct control of circuit breakers, disconnectors, and related secondary equipment. The correctness of these logical expressions directly affects the safety and reliability of substation operation.
[0003] In current engineering practice, the secondary logic expressions for substations are typically manually compiled by engineers based on secondary equipment ledgers, design specifications, and operational experience. Engineers need to identify different devices, functional pressure plates, and their corresponding signal numbers item by item, and manually construct the logical relationships according to design specifications. This method relies on manual understanding and experience-based judgment, resulting in a complex and labor-intensive logic configuration process. Furthermore, the same or similar logic writing work often needs to be repeated across different projects and sites.
[0004] As the scale of smart substation construction continues to expand, the number of secondary equipment within the substations has increased significantly, leading to a continuous increase in the complexity of secondary logic configuration. In this context, relying solely on manually compiled logic expressions is prone to omissions, confusion, or logical errors due to differences in equipment types, device characteristics, or complex signal numbering, increasing the risks associated with engineering commissioning and operation maintenance.
[0005] Therefore, the existing logic expression configuration methods in substation secondary systems still have shortcomings in terms of engineering consistency and adaptability, making it difficult to meet the requirements of large-scale engineering construction and intelligent operation and maintenance for the automation, standardization and reliability of secondary logic. Summary of the Invention
[0006] Therefore, it is necessary to provide a method, apparatus, computer equipment, and storage medium for generating logical expressions to address the aforementioned technical problems. This method has the advantages of meeting the requirements of large-scale engineering construction and intelligent operation and maintenance for the automation, standardization, and reliability of secondary logic.
[0007] A method for generating logical expressions, the method comprising: Obtain secondary equipment ledger information, wherein the secondary equipment ledger information includes the logical type of a logical object and the signal identifier corresponding to the logical object; Based on the logical type, a corresponding target rule item is selected from the pre-built rule information library. The target rule item includes a logical template containing condition placeholders, condition information corresponding to each condition placeholder, and an applicable condition field used to limit the scope of application of the rule. Based on the condition information, the corresponding actual signal identifier is matched in the secondary equipment ledger information, and the condition placeholder in the logic template is replaced with the actual signal identifier to generate an initial logic expression. Based on the applicable condition field, the initial logical expression is adapted to obtain the target logical expression.
[0008] Optionally, before obtaining the secondary equipment ledger information, the method further includes: Obtain the function type of the logical object and the device attribute or device type to which the logical object belongs; Based on the function type and the device attribute or device type to which the logical object belongs, the logical type corresponding to the logical object is determined according to a preset mapping relationship.
[0009] Optionally, before selecting the corresponding target rule item from the pre-built rule information base based on the logical type, the method further includes: Obtain user logic specifications; Based on the user logic specifications, semantic parsing is performed to obtain at least one rule entry; The original condition description in each rule entry is structured to obtain the condition information corresponding to the rule entry, and a logical template containing condition placeholders is generated according to the logical relationship between the condition information. Based on the condition information, the logical template, and the applicable condition field used to limit the scope of application of the rule, a rule item corresponding to each rule entry is generated; The rule information database is constructed based on the rule items corresponding to each rule entry.
[0010] Optionally, the step of constructing the rule information database based on the rule items corresponding to each rule entry includes: Determine the scope of application for each of the rule items; The rule items are organized hierarchically according to their applicable scope to obtain the rule information library. Each layer of the rule information library contains the rule items within the same applicable scope.
[0011] Optionally, the condition information includes at least one of four constraints: equipment type, operation action, voltage level, and interval type. Based on the condition information, the step of matching the corresponding actual signal identifier in the secondary equipment ledger information and replacing the condition placeholder in the logic template with the actual signal identifier to generate an initial logic expression includes: The actual signal identifier is obtained by filtering signal identifiers that meet at least one of the four constraints: equipment type, operation action, voltage level, and interval type, from the secondary equipment ledger information. Establish the correspondence between the actual signal identifier and the condition placeholder; Based on the correspondence, the actual signal identifier is used to replace the condition placeholder in the logic template to obtain the initial logic expression.
[0012] Optionally, the step of replacing the condition placeholder in the logic template with the actual signal identifier based on the correspondence to obtain the initial logic expression includes: When the same condition placeholder corresponds to multiple actual signal identifiers, the multiple actual signal identifiers are combined according to the preset logical combination rules to obtain the combined logical expression. Replace the condition placeholders with the combined logical expression to generate the initial logical expression.
[0013] Optionally, the applicable condition field includes wiring method and voltage level. The process of adapting the initial logic expression based on the applicable condition field to obtain the target logic expression includes: Based on the wiring method and voltage level, determine the target logic part in the initial logic expression that does not match the wiring method or voltage level; The target logic part is ignored, deleted, or replaced to obtain the target logic expression.
[0014] A logical expression generation apparatus, the apparatus comprising: The acquisition module is used to acquire secondary equipment ledger information, which includes the logical type of a logical object and the signal identifier corresponding to the logical object. The selection module is used to select a corresponding target rule item from a pre-built rule information library based on the logical type. The target rule item includes a logical template containing condition placeholders, condition information corresponding to each condition placeholder, and an applicable condition field for limiting the scope of application of the rule. The generation module is used to match the corresponding actual signal identifier in the secondary equipment ledger information based on the condition information, and replace the condition placeholder in the logic template with the actual signal identifier to generate an initial logic expression. An adaptation module is used to adapt the initial logical expression based on the applicable condition field to obtain the target logical expression.
[0015] A computer device includes a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, wherein the processor, when executing the computer-readable instructions, implements the method for generating the above-mentioned logical expression.
[0016] A readable storage medium storing computer-readable instructions, which, when executed by a processor, implement the method for generating the above-mentioned logical expression.
[0017] The above-mentioned logical expression generation method, apparatus, computer equipment, and storage medium acquire secondary equipment ledger information, which includes the logical type of a logical object and the signal identifier corresponding to the logical object; based on the logical type, select a corresponding target rule item from a pre-built rule information library, the target rule item including a logical template containing condition placeholders, condition information corresponding to each condition placeholder, and an applicable condition field for limiting the scope of application of the rule; based on the condition information, match the corresponding actual signal identifier in the secondary equipment ledger information, and replace the condition placeholders in the logical template with the actual signal identifier to generate an initial logical expression; based on the applicable condition field, perform adaptation processing on the initial logical expression to obtain the target logical expression. By introducing logical types determined based on secondary equipment ledger information during the generation of logical expressions, and selecting corresponding rule items from the rule information library accordingly, logical objects with the same function but belonging to different devices or different engineering scenarios can be effectively distinguished, avoiding logical configuration errors caused by device differences or rule mixing. At the same time, by matching signal identifiers in the ledger with condition information and generating initial logical expressions, and then adapting the initial logical expressions based on the applicable condition fields in the rule items, the generated logical expressions can be matched with the applicable engineering conditions, thereby improving the correctness, consistency, and engineering applicability of the generated logical expressions. Attached Figure Description
[0018] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a flowchart illustrating a method for generating logical expressions according to an embodiment of the present invention; Figure 2 This is a flowchart illustrating a method for generating logical types in one embodiment of the present invention; Figure 3 This is a flowchart illustrating a method for generating a rule information database in one embodiment of the present invention; Figure 4 This is a flowchart illustrating another method for generating logical expressions according to an embodiment of the present invention; Figure 5 This is a schematic diagram of a logical expression generation device in one embodiment of the present invention; Figure 6 This is a schematic diagram of a computer device according to an embodiment of the present invention. Detailed Implementation
[0020] 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, not all, of the embodiments of the present invention. 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.
[0021] In one embodiment, such as Figure 1 As shown, a method for generating logical expressions is provided, including the following steps: 101. Obtain secondary equipment ledger information.
[0022] In this embodiment of the invention, the secondary equipment ledger information is used to describe the basic data set of various secondary equipment and their associated signals in the substation secondary system. It can be understood as a structured record of the configuration status and signal relationships of the secondary equipment. This ledger information includes at least the logical type of a logical object and the signal identifier corresponding to that logical object. The logical object represents the smallest functional unit participating in logical operations or configurations. A logical object can be a functional pressure plate, trip output, interlocking condition, or control condition in a protection device; it is not directly equivalent to specific hardware but rather an abstract object used to establish logical relationships during the logical configuration process.
[0023] Logical types are used to distinguish and identify the role and applicable scenarios of logical objects in an engineering project. They can be understood as a logical classification result that incorporates device attributes or engineering attributes on top of the functional type. By introducing logical types, logical objects with the same functional name but originating from different devices or applicable to different engineering conditions can be differentiated, thus providing a clear basis for subsequent rule matching. For example, the logical rules corresponding to the trip output function may differ in different protection devices; logical types can prevent the misuse of rules during the rule selection process.
[0024] Signal identifiers are used to uniquely identify specific secondary signals associated with logical objects in the secondary equipment ledger. They can be understood as the actual source of signals involved in judgments or calculations within logical expressions. Signal identifiers typically correspond one-to-one with specific signals in protection devices, pressure plate circuits, or control circuits. They are used to replace condition placeholders in the logic template during logic generation, enabling abstract logical rules to establish a mapping relationship with real signals in the project. By maintaining the correspondence between logical objects and signal identifiers in the ledger, a reliable data foundation can be provided for the automatic generation of subsequent logical expressions.
[0025] Secondary equipment ledger information can be obtained through various existing engineering data sources, and the specific method is not limited. In practical applications, secondary equipment ledgers are usually established during the substation design, commissioning, or operation and maintenance phases and maintained in the form of electronic documents or databases. For example, during the engineering design phase, ledger information can be derived from secondary design drawings, protection configuration lists, or device point tables, and a structured ledger can be formed through manual entry or batch import. During the commissioning or operation and maintenance phase, ledger information can also be directly exported from substation automation systems, relay protection management platforms, or configuration tools.
[0026] In some implementation scenarios, ledger information can also be obtained by parsing configuration files, communication protocol description files, or device parameter files, thereby automatically extracting device identifiers, signal names, and their corresponding relationships. Regardless of the acquisition method, the ledger information is organized into a unified data format before entering the logic generation process to ensure that the logical type of the logical object and its corresponding signal identifier can be accurately identified and invoked, providing a consistent data foundation for the generation of subsequent logical expressions.
[0027] 102. Based on the logical type, select the corresponding target rule item from the pre-built rule information library.
[0028] In this embodiment of the invention, when selecting rules based on logical types, a pre-built rule information database is used to store rule content corresponding to different logical types, enabling logical objects to directly match applicable rule entries according to their own logical types. Through this method, logical types serve as a key index for rule selection, allowing logical objects with the same function but originating from different devices or applicable to different engineering scenarios to be associated with different rules, thereby avoiding rule misuse.
[0029] The target rule item describes the logical relationship that a certain type of logical object should adopt under specific conditions. Its content includes at least a logical template, condition information, and an applicable condition field. The logical template represents the structural form of the logical relationship and can be understood as an expression framework composed of condition placeholders and logical operators. The condition placeholders represent logical conditions that have not yet been bound to specific signals. This logical template reflects the logical structure of the rule itself, independent of the signal numbers in a specific project.
[0030] Condition information describes the constraint characteristics corresponding to each condition placeholder. It can be understood as an attribute description of the condition represented by the placeholder, used for matching with signals in the secondary equipment ledger during subsequent processing. Condition information typically includes equipment type, operation action, voltage level, or interval type, used to limit which signals can serve as the actual source of the condition placeholder, thereby ensuring that the logic template can correctly bind to the real signals in the project during instantiation.
[0031] The Applicability Conditions field defines the engineering conditions under which a rule applies; it can be understood as a constraint description on the rule's scope of application. This field does not directly participate in the calculation of the logical expression, but is used to determine whether the logical content corresponding to the rule should be retained or adjusted after the logic is generated. For example, under different wiring methods or different voltage levels, some logic branches may not be applicable; the Applicability Conditions field can provide a basis for subsequent logic adaptation processing.
[0032] By encapsulating logical templates, condition information, and applicable condition fields into target rule items and organizing them according to logical types, the rule information library can be reused in different projects. At the same time, it provides a clear and controllable source of rules for subsequent ledger-based logical instantiation and project adaptation.
[0033] Furthermore, in the process of selecting target rule items from the rule information base based on logical types, the logical type is used to characterize the differences of logical objects under different devices or engineering scenarios, making the rule selection more targeted. In practical applications, the logical type corresponding to the logical object can be read from the secondary equipment ledger information first, and then rule items matching the logical type can be filtered in the rule information base to determine the applicable logical template and condition constraints.
[0034] For example, when a logical object in the ledger is identified as "trip output pressure plate_line", rule items related to line protection trip output can be selected from the rule information database to generate the corresponding logical relationship; when the logical object is identified as "trip output pressure plate_bus differential", the rule item corresponding to the bus differential protection trip output is selected. Although the above logical objects have the same functional name, their logical types differ due to different devices. By distinguishing the logical types, it can be ensured that the rule content that matches the characteristics of the actual device is selected.
[0035] In similar scenarios, for logical objects with the same functional name but originating from different devices, such as incomplete phase protection, reclosing protection, or bus differential protection, different logic templates can be automatically distinguished and selected based on a pre-determined logic type strategy, thereby avoiding the misuse of rules during logic generation. Through this method, the rule selection process no longer relies on manual judgment of device differences but achieves automatic matching based on logic type, improving the accuracy and consistency of rule application.
[0036] 103. Based on the conditional information, match the corresponding actual signal identifier in the secondary equipment ledger information, and replace the conditional placeholder in the logic template with the actual signal identifier to generate the initial logic expression.
[0037] In this embodiment of the invention, after the rule selection is completed, the condition placeholders in the logic template need to be associated with the actual secondary signals in the project so that the abstract logic structure can be transformed into a logic expression that can be used for project configuration. To this end, based on the condition information given in the rule, the recorded signals are matched in the secondary equipment ledger information to determine the actual signal identifiers corresponding to each condition placeholder.
[0038] Condition information describes the constraint characteristics represented by the condition placeholders. By limiting attributes such as equipment type, operation action, voltage level, or interval type, signal identifiers that meet the constraint conditions can be filtered from the ledger information. During the matching process, each condition placeholder corresponds to at least one signal identifier that meets the condition, thereby establishing a correspondence between the condition placeholders and the actual signal identifiers.
[0039] After establishing the correspondence, the matching actual signal identifiers replace the condition placeholders in the logic template, transforming the original logic template containing only placeholders into a logic expression composed of specific secondary signals. Through this replacement process, the logical relationships in the logic template are fully preserved, while the participants in the logical operations change from abstract conditions to signals that actually exist in the project. Ultimately, an initial logic expression is obtained without considering project adaptation conditions, providing a foundation for subsequent logic adaptation processing.
[0040] 104. Based on the applicable condition field, the initial logical expression is adapted to obtain the target logical expression.
[0041] In this embodiment of the invention, after generating the initial logical expression, it is necessary to adapt the logical expression to specific engineering conditions to ensure that the logical result can be correctly applied to the actual engineering environment. To this end, an applicable condition field is introduced in the rule item to judge and adjust the initial logical expression, thereby obtaining a target logical expression that meets the engineering requirements.
[0042] The Applicable Conditions field describes the scope of the project to which the logical rules apply. It can be understood as a constraint on the conditions under which the logical expression takes effect, such as the wiring method or voltage level used in the project. By comparing the Applicable Conditions field with the actual conditions of the current project, logical parts in the initial logical expression that do not match the project conditions can be identified.
[0043] During the adaptation process, logical parts that do not meet the applicable conditions can be ignored, deleted, or replaced according to rules. This ensures that the logical expression maintains overall logical consistency while removing content that is inapplicable under the current engineering conditions. After adaptation, the resulting logical expression can be matched with the specific wiring method and voltage level, thus forming a target logical expression that can be directly used for engineering configuration.
[0044] In this embodiment of the invention, secondary equipment ledger information is obtained, which includes the logical type of a logical object and the signal identifier corresponding to the logical object. Based on the logical type, a corresponding target rule item is selected from a pre-built rule information library. The target rule item includes a logical template containing condition placeholders, condition information corresponding to each condition placeholder, and an applicable condition field for limiting the scope of application of the rule. Based on the condition information, the corresponding actual signal identifier is matched in the secondary equipment ledger information, and the condition placeholder in the logical template is replaced with the actual signal identifier to generate an initial logical expression. Based on the applicable condition field, the initial logical expression is adapted to obtain a target logical expression. By introducing logical types determined based on secondary equipment ledger information during the generation of logical expressions, and selecting corresponding rule items from the rule information library accordingly, logical objects with the same function but belonging to different devices or different engineering scenarios can be effectively distinguished, avoiding logical configuration errors caused by device differences or rule mixing. At the same time, by matching signal identifiers in the ledger with condition information and generating initial logical expressions, and then adapting the initial logical expressions based on the applicable condition fields in the rule items, the generated logical expressions can be matched with the applicable engineering conditions, thereby improving the correctness, consistency, and engineering applicability of the generated logical expressions.
[0045] Optionally, before obtaining the secondary equipment ledger information, the functional type of the logical object and the device attribute or device type to which the logical object belongs can also be obtained; based on the functional type and the device attribute or device type to which the logical object belongs, the logical type corresponding to the logical object is determined according to a preset mapping relationship.
[0046] In this embodiment of the invention, before obtaining the secondary equipment ledger information, the functional attributes of the logical object can be further analyzed to determine the logical type corresponding to the logical object. The functional type is used to characterize the basic functional meaning of the logical object in the secondary system, while the device attribute or device type is used to characterize the specific device category in which the function is located. By combining the two, a logical type identifier can be formed to distinguish different engineering semantics.
[0047] In practical implementation, the functional type corresponding to a logical object can be identified from the secondary equipment ledger information, such as a trip output pressure plate or an incomplete phase protection pressure plate. Simultaneously, the device attribute or device type to which the logical object belongs can be identified, such as a line protection device or a bus differential protection device. Based on this, according to a pre-configured mapping relationship, the functional type and device attribute are combined to determine the logical type corresponding to the logical object.
[0048] For example, when a logical object's function type is a trip output pressure plate and its device is a line protection device, a logical type identifier containing the device's characteristics can be generated based on the mapping relationship. When logical objects of the same function type originate from a bus differential protection device, a logical type identifier corresponding to the bus differential protection is generated. In this way, even if the function names are the same, different logical types can be formed based on device differences, thus providing a basis for distinguishing subsequent rule selection.
[0049] The generation strategy for logical types can be flexibly configured under different functional scenarios. For some functional types, logical types can be generated by combining functional types with device attributes; for other functional types, logical types can be kept consistent with functional types without introducing device attributes, thus adapting to the configuration requirements of different logical rules. Through the above-mentioned logical type generation method based on mapping relationships, the flexibility of logical type configuration can be improved while ensuring the rule differentiation capability.
[0050] Furthermore, the logical type can be determined through methods such as... Figure 2 The flowchart illustrating the generation method of the logical type further explains that, through... Figure 2As can be seen, the generation process of logical types can begin by reading the secondary equipment ledger information. By reading the ledger, basic configuration data related to the logical object can be obtained, providing a data source for subsequent identification and judgment. This stage focuses on the objective information already existing in the ledger, without involving logical rules or engineering judgments.
[0051] After reading the ledger information, the function type corresponding to the logical object is identified. The function type is used to characterize the functional meaning of the logical object in the secondary system, such as trip output, protection activation or blocking conditions, etc. This information reflects the functional attributes of the logical object at the business semantic level and is an important basis for subsequent logical type generation.
[0052] Based on identifying the function type, the device type to which the logical object belongs is further identified. The device type is used to characterize the specific device category in which the function resides, such as a line protection device or a bus differential protection device. By introducing the device type, the engineering context of the same function in different devices can be distinguished, providing a basis for the differentiated generation of logical types.
[0053] After obtaining the function type and device type, the corresponding function mapping model is found based on these two. The function mapping model describes the generation strategy that should be adopted when generating logical types for different function types, and can reflect which functions need to distinguish device characteristics and which functions can directly use the function type itself as the logical type.
[0054] Next, it is determined whether a device suffix needs to be introduced into the function type. This determination is used to determine the specific structure of the logical type. When the generation strategy corresponding to the function type requires reflecting device differences, device characteristics need to be introduced into the logical type; when the generation strategy does not require reflecting device differences, the function type can be directly used as the logical type.
[0055] When the judgment result requires the inclusion of a device suffix, the device characteristics and function type are combined based on the identified device type to generate a logical type containing the device identifier. This type is used to distinguish logical objects with the same function name under different devices. This method avoids the mixing of logical rules between different devices.
[0056] When the judgment result does not require the introduction of a device suffix, the function type is directly used as the logical type to keep the logical type concise and consistent with the function semantics, so as to meet the configuration requirements of the corresponding rule.
[0057] After completing the above judgment and generation processes, the logical type generation process ends, and the obtained logical type can be used for subsequent matching of rule information base and generation of logical expressions.
[0058] Optionally, before selecting the corresponding target rule item from the pre-built rule information base based on the logical type, the user logical specification can be obtained; semantic parsing processing can be performed based on the user logical specification to obtain at least one rule entry; structuring processing can be performed based on the original condition description in each rule entry to obtain the condition information corresponding to the rule entry, and a logical template containing condition placeholders can be generated according to the logical relationship between the condition information; rule items corresponding to each rule entry can be generated based on the condition information, logical template, and applicable condition fields used to limit the scope of rule application; and a rule information base can be constructed based on the rule items corresponding to each rule entry.
[0059] In this embodiment of the invention, to construct a rule information base, user logic specifications can be obtained first. User logic specifications describe engineering logic constraints in text format, and the text content includes protection rule information, equipment types, operational actions, and logical relationships between conditions. Semantic parsing processing revolves around these elements. For example, it can identify semantic fragments such as line protection activation and transformer protection activation in protection rule information; it can identify category descriptions such as switches and trip output pressure plates in equipment types; it can identify operational action information, where H represents "on" or "activated," and L represents "off" or "deactivated"; and it can identify AND and OR in condition combination relationships, used to represent AND and OR relationships.
[0060] After semantic parsing, the original condition descriptions in the rule entries are structured to obtain the corresponding condition information. This condition information is used to express the constraint attributes of each condition in a structured form, which can be organized using condition nodes. Each condition node contains fields such as protection rule information (rule), device type (devtype), operation action (act), voltage level (voltage), and bay type (baytype). Each original condition description in a rule entry corresponds to a condition node, and the combination relationships between condition nodes are determined by the parsed AND, OR, and bracket structures, thus providing input for the construction of the logic template.
[0061] After the condition information is structured, a logic template containing condition placeholders is generated based on the logical relationships between the condition information. The logic template is used to express the logical structure of the rule entries, and the condition placeholders are used to express the position of the condition in the logical structure. Taking a closed line switch rule with a voltage level of 110kV and an action of H as an example, the user logic specification can give the rule description "Line protection engaged & (non-full-phase 1 engaged | non-full-phase 2 engaged)". In this rule description, line protection engaged, non-full-phase 1 engaged, and non-full-phase 2 engaged correspond to three condition nodes, and are mapped to condition placeholders IN1, IN2, and IN3 respectively, thereby generating the logic template IN1&(IN2|IN3). Here, "&" corresponds to AND, "|" corresponds to OR, and parentheses are used to limit the logical priority; IN1 to IN3 are condition placeholders, which are used for replacement when binding with ledger signals later.
[0062] Subsequently, rule items corresponding to the rule entries are generated based on condition information, logic templates, and applicable condition fields used to limit the scope of rule application. Rule items are used to standardize and encapsulate rule entries, including equipment type information, action information, rule description information, logic template information, condition information, and applicable condition fields. The applicable condition fields limit the engineering scope to which the rule item applies, and may include voltage level information and wiring method information. Continuing with the previous example, a rule item can record the equipment type as a switch, the action corresponding to H, the rule description as "line protection engaged & (non-full-phase 1 engaged | non-full-phase 2 engaged)", the voltage level as 110kV, the wiring method as double busbar connection, and simultaneously associate the logic template IN1 & (IN2 | IN3) and the condition information corresponding to IN1 to IN3. By repeatedly performing the above parsing, structuring, and template processing on each rule entry in the user logic specification, multiple rule items can be obtained. These multiple rule items form a rule information library, which is used for subsequent selection of target rule items according to logic type and generation of logical expressions.
[0063] Furthermore, the generation of the rule information base can be achieved through methods such as... Figure 3 The flowchart illustrating the method for generating the rule information base further explains that, through... Figure 3As can be seen, the generation process of the rule information base first includes semantic parsing of the user's logical specifications. Semantic parsing is used to identify key information related to the logical rules from the original text of the user's logical specifications, enabling further processing of the text description. Through semantic parsing, the protection rule information involved in the rules can be identified, such as line protection activation or transformer protection activation; the equipment type corresponding to the rule can also be identified, such as switch or trip output pressure plate; and the operational actions described in the rule can be identified to distinguish different states such as closed, open, activated, or deactivated, and the logical connection methods between conditions can be identified, such as AND and OR relationships, providing a basis for subsequent processing.
[0064] After semantic parsing, the conditions obtained from the semantic parsing are extracted and structured condition information is generated. This process transforms the original condition descriptions in the rule entries into condition information with explicit constraint attributes. Each original condition description, after structuring, forms a condition information item, used to describe an independently judgeable logical condition in the rule, and may include information such as functional meaning, equipment type, operation action, voltage level, or interval type, thus providing a clear basis for subsequent logic generation and signal matching.
[0065] After obtaining the structured conditional information, the logical relationships between the conditional information are analyzed. Logical relationship analysis is used to determine how multiple conditions are combined in a rule, including AND, OR, and priority relationships defined by parentheses. Through the analysis of logical relationships, the hierarchy and combination order of the conditional information in the overall logical structure can be clarified, thus clearly expressing the logical structure of the rule entries.
[0066] After completing the logical relationship analysis, the conditional information is combined with the analyzed logical relationships to generate a logical template. The logical template is used to abstractly express the logical structure of the rule entries, where the position of each conditional information within the logical structure is indicated by conditional placeholders. The number and arrangement of conditional placeholders in the logical template correspond one-to-one with the number of conditional information and the logical relationships in the rule entries, thereby achieving decoupling between the logical structure and specific engineering signals.
[0067] After generating the logical template, the condition information, logical template, and constraint information related to the rule's scope of application are written into the rule information database. This process is used to uniformly manage the logical rules corresponding to rule entries in the form of rule items, so that each rule is stored in a standardized data format. A rule item contains a logical template, condition information, and an applicable condition field used to limit the rule's scope of application, enabling the rule to be correctly selected and used in different engineering scenarios.
[0068] Once all rule entries in the user logic specification have undergone the above processing and been written into the rule information database, the construction of the rule information database is complete. The completed rule information database can serve as a unified data source for the generation of subsequent logic expressions, enabling different projects to generate consistent and applicable logic expressions based on the same rule information database, while incorporating their respective secondary equipment ledger information.
[0069] Optionally, in the step of constructing a rule information database based on the rule items corresponding to each rule entry, the scope of application of each rule item can also be determined; the rule items are organized hierarchically according to their scope of application to obtain the rule information database, in which each layer contains rule items within the same scope of application.
[0070] In this embodiment of the invention, during the process of constructing a rule information database based on the rule items corresponding to each rule entry, the scope of application of the rule items can be further processed. The scope of application is used to characterize the applicable conditions of the rule item in engineering applications, in order to distinguish the differences in rules between different manufacturers, different regions, or different site environments. By determining the scope of application of the rule items, it can be clarified in which engineering scenarios each rule item should be selected and used.
[0071] In practical implementation, rule items can be organized hierarchically based on the engineering constraint information they correspond to, grouping rule items with the same scope of application into the same level. In the rule information database constructed in this way, different levels correspond to different scopes of application, thus forming a hierarchical rule organization. When selecting rules in the hierarchical rule information database, rule items with more clearly defined scopes of application can be prioritized based on the actual engineering situation. If no matching rule exists, then rule items with more general scopes of application will be matched upwards.
[0072] To adapt to the complexity of industry engineering scenarios, significant differences among manufacturers, and varying design specifications across regions, the rule information database can adopt a hierarchical, inherited organizational structure. Rule items can be divided into a general rule layer, a manufacturer-specific rule layer, a user-defined rule layer, and a site-specific rule layer. The general rule layer stores basic rules applicable to all manufacturers and engineering scenarios; the manufacturer-specific rule layer describes the differences in logical configurations between different manufacturers; the user-defined rule layer meets additional specification requirements proposed by specific regions or organizations; and the site-specific rule layer stores supplementary rules applicable only to specific substations or projects.
[0073] Through the aforementioned hierarchical organization, the rule information database maintains a unified structure while flexibly adapting to different rule combinations based on varying engineering conditions. The resulting rule information database serves as a unified data source for generating subsequent logical expressions, enabling different substations to automatically generate highly consistent and uniformly formatted logical expressions simply by replacing secondary equipment ledger information. Furthermore, the rule information database supports automatic construction based on user-defined logical specifications and also allows for manual adjustments or additions of rules during engineering applications. This provides a platform for the long-term accumulation and reuse of engineering experience, effectively reducing manual configuration and maintenance costs.
[0074] Optionally, the condition information includes at least one of four constraints: equipment type, operation action, voltage level, and interval type. In the step of matching the corresponding actual signal identifier in the secondary equipment ledger information based on the condition information and replacing the condition placeholder in the logic template with the actual signal identifier to generate the initial logic expression, the following steps can also be taken: filtering signal identifiers that satisfy at least one of the four constraints (equipment type, operation action, voltage level, and interval type) from the secondary equipment ledger information to obtain the actual signal identifier; establishing a correspondence between the actual signal identifier and the condition placeholder; and replacing the condition placeholder in the logic template with the actual signal identifier based on the correspondence to obtain the initial logic expression.
[0075] In this embodiment of the invention, during the process of matching the corresponding actual signal identifier in the secondary equipment ledger information based on conditional information and generating an initial logical expression, the conditional information is used to limit the filtering range of ledger signals. The conditional information may include at least one of four constraints: equipment type, operation action, voltage level, and interval type, and is used to describe the attribute characteristics of each condition in the rule entry in the project.
[0076] In practical implementation, the secondary equipment ledger information can be filtered based on conditional information, selecting signal identifiers that meet the corresponding constraints as actual signal identifiers. For example, when the conditional information includes equipment type constraints, only signal identifiers matching that equipment type are filtered from the ledger; when the conditional information includes operation action constraints, only signal identifiers corresponding to the engaged or disengaged state are filtered; when the conditional information includes voltage level or interval type constraints, only signal identifiers matching that voltage level or interval type are filtered. Through the above filtering process, one or more actual signal identifiers that meet the constraints can be determined for each piece of conditional information.
[0077] After obtaining the actual signal identifiers through screening, a correspondence is established between the actual signal identifiers and the condition placeholders in the logic template. Each condition placeholder in the logic template corresponds to a condition, indicating the position of that condition in the logical structure. Through this correspondence, it can be determined which actual signal identifiers should replace each condition placeholder.
[0078] Taking the rule for a line with a logic type of trip output pressure plate as an example, its logic template can correspond to the combination relationship between line protection activation and incomplete phase protection conditions. For the condition information indicating line protection activation, the corresponding trip output pressure plate signal identifier of the line protection device can be matched from the secondary equipment ledger, such as TZCK1 and TZCK2; for the condition information indicating the activation of the first set of incomplete phase protection, the first set of incomplete phase protection pressure plate signal identifier can be matched, such as 1FQX1 and 1FQX2; for the condition information indicating the activation of the second set of incomplete phase protection, the second set of incomplete phase protection pressure plate signal identifier can be matched, such as 2FQX1 and 2FQX2. The above signal identifiers are respectively associated with different condition placeholders in the logic template.
[0079] After establishing the correspondence, the actual signal identifiers replace the condition placeholders in the logic template, generating an initial logic expression. When the same condition placeholder corresponds to multiple actual signal identifiers, these identifiers can be combined according to the preset logical combination method in the rules, and used as logical sub-expressions corresponding to the condition placeholders in the overall logical calculation. For example, in input-type rules, multiple signal identifiers can be combined using AND relationships and represented in the logic expression with corresponding values, where the signal value corresponding to the input state can be defined as 1, and the signal value corresponding to the exit state can be defined as 0. Through the above replacement and combination processing, a logic template containing only condition placeholders can be transformed into an initial logic expression composed of specific ledger signals.
[0080] Optionally, in the step of replacing the condition placeholder in the logic template with the actual signal identifier based on the correspondence to obtain the initial logic expression, when the same condition placeholder corresponds to multiple actual signal identifiers, the multiple actual signal identifiers can be combined according to the preset logic combination rules to obtain the combined logic expression; the combined logic expression replaces the condition placeholder to generate the initial logic expression.
[0081] In this embodiment of the invention, during the process of replacing the condition placeholders in the logic template with actual signal identifiers based on the correspondence to generate the initial logic expression, there may be a situation where the same condition placeholder corresponds to multiple actual signal identifiers. This situation typically occurs in scenarios where a logic condition is represented by multiple parallel signals in an engineering project, such as when the same function is configured with corresponding signals in multiple devices or multiple circuits.
[0082] When multiple actual signal identifiers are detected to correspond to the same condition placeholder, these identifiers can be combined according to preset logical combination rules to generate a combined logical expression corresponding to the condition placeholder. Logical combination rules describe the logical combination of multiple actual signals, and their form can be determined based on the logical meaning of the rule entries. For example, for conditions representing an active state, multiple actual signal identifiers can be combined using an AND relationship; for conditions indicating that multiple conditions are met if any one is satisfied, they can be combined using an OR relationship. By setting logical combination rules, multiple actual signal identifiers participate in the calculation as a whole condition in the logical expression.
[0083] After logical combination, the resulting logical expression is used as a replacement to replace the corresponding condition placeholders in the logical template, thereby generating an initial logical expression containing specific signals and their logical relationships. In this way, even if a condition in a rule entry corresponds to multiple signal identifiers in the project ledger, the consistency between the logical structure and the rule semantics can be maintained, avoiding incomplete logical expression generation or deviations in logical meaning due to differences in the number of signals.
[0084] Optionally, the applicable condition field includes wiring method and voltage level. In the step of adapting the initial logic expression based on the applicable condition field to obtain the target logic expression, the target logic part in the initial logic expression that does not match the wiring method or voltage level can also be determined based on the wiring method and voltage level; the target logic part can be ignored, deleted, or replaced to obtain the target logic expression.
[0085] In this embodiment of the invention, during the adaptation process of the initial logical expression based on the applicable condition field, the applicable condition field is used to limit the scope of application of the rules and logical expression in a specific engineering scenario. The applicable condition field may include wiring method and voltage level, and is used to describe the engineering condition constraints that should be met when the logical expression is generated.
[0086] After generating the initial logical expression, further adaptation processing can be performed on the initial logical expression based on the differences in the devices to which the logical objects belong and the engineering conditions. Since the pressure plate function and device attributes have been integrated through logical types in the previous processing, the logical objects corresponding to different devices have been distinguished in the rule information library. Therefore, in the adaptation processing stage, it is possible to automatically determine whether the rules on which the current initial logical expression is based match the actual engineering conditions based on the logical type, thereby avoiding the situation where pressure plates with the same name are misused in different devices due to differences in logical rules.
[0087] In practical implementation, the logic components in the initial logic expression can be matched and judged based on the wiring method and voltage level recorded in the applicable conditions field. When a logic component in the initial logic expression that does not match the current wiring method or voltage level is detected, that logic component is identified as the target logic component, and adaptation processing is performed on the target logic component. The adaptation processing may include one or more operations such as ignoring, deleting, or replacing the target logic component to make the logic expression consistent with the actual engineering conditions.
[0088] For example, in engineering scenarios with a single busbar connection, if the initial logic expression contains logic conditions related to busbar II, the logic part corresponding to busbar II can be automatically ignored or deleted during the adaptation process, thereby maintaining the simplicity and correctness of the logic expression. In engineering scenarios with a voltage level of 110kV, only logic conditions that match the 110kV voltage level are retained, and logic parts that do not meet the voltage level are not adopted, so as to avoid mixing rules of different voltage levels.
[0089] Through the above adaptation process, a target logic expression matching the current device type, wiring method, and voltage level can be obtained. The generated target logic expression can be output according to engineering requirements and can be further presented in the form of a logic expression, a logic structure display, or a record containing source information to facilitate engineering application, debugging, and maintenance.
[0090] like Figure 4 As shown in the figure, this embodiment of the invention also provides a flowchart of another method for generating logical expressions, through... Figure 4 As can be seen, the method for generating this logical expression first includes reading the secondary equipment ledger information. This ledger information describes the configuration of each logical object in the project and its corresponding signal. By reading the ledger information, the signal identifiers of the logical objects and the device attribute information related to those objects can be obtained, providing a basic data source for subsequent rule matching and logic generation.
[0091] After reading the ledger information, the system matches corresponding rule items in the rule information database based on the attribute information of the logical objects in the ledger. The rule information database pre-stores multiple rule items, each describing the structure and applicable conditions of a logical rule. By matching the ledger information with the logical type or scope of application in the rule items, rule items matching the current logical object can be filtered from the rule information database.
[0092] After a rule is matched, different rules are automatically selected based on device differences. Since different devices may have different logical configurations, even if the logical object names are the same, their corresponding logical rules may be different. Therefore, in this process, the device attributes to which the logical object belongs can be combined to further filter or confirm the matched rule items, thereby automatically selecting rules that are consistent with the device characteristics and avoiding logical errors caused by device differences when manually selecting rules.
[0093] After determining the final rule items to be adopted, the final logical expression is generated based on the logical templates and condition information in the rule items. This process can be achieved by replacing the condition placeholders in the logical templates of the rule items with the corresponding actual signal identifiers in the ledger, and combining them with the logical relationships defined in the rules to process the signals, thereby obtaining a logical expression that can be directly used for engineering configuration.
[0094] While generating the final logical expression, traceability information related to that expression can also be recorded. This traceability information describes the source of the logical expression's generation, including the rule items used, the corresponding logic templates, the actual signal identifiers involved in the generation, and the mapping relationships in the ledger. By recording this traceability information, the basis for the logical expression's generation can be traced and verified during subsequent debugging, review, or changes, thereby improving the controllability of the logic configuration process and the reliability of the project.
[0095] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0096] In one embodiment, a logical expression generation apparatus is provided, which corresponds one-to-one with the logical expression generation methods in the above embodiments. For example... Figure 5 As shown, the device for generating this logical expression includes an acquisition module 501, a selection module 502, a generation module 503, and an adaptation module 504. Detailed descriptions of each functional module are as follows: The acquisition module 501 is used to acquire secondary equipment ledger information, the secondary equipment ledger information including the logical type of the logical object and the signal identifier corresponding to the logical object; The selection module 502 is used to select a corresponding target rule item from a pre-built rule information library based on the logical type. The target rule item includes a logical template containing condition placeholders, condition information corresponding to each condition placeholder, and an applicable condition field for limiting the scope of application of the rule. The generation module 503 is used to match the corresponding actual signal identifier in the secondary equipment ledger information based on the condition information, and replace the condition placeholder in the logic template with the actual signal identifier to generate an initial logic expression. The adaptation module 504 is used to perform adaptation processing on the initial logical expression based on the applicable condition field to obtain the target logical expression.
[0097] Optionally, the device further includes: The second acquisition module is used to acquire the function type of the logical object and the device attribute or device type to which the logical object belongs; The first determining module is used to determine the logical type corresponding to the logical object according to a preset mapping relationship based on the functional type and the device attribute or device type to which the logical object belongs.
[0098] Optionally, the device further includes: The third acquisition module is used to acquire user logic specifications; The semantic parsing module is used to perform semantic parsing processing based on the user logic specification to obtain at least one rule entry. The structuring module is used to perform structuring processing based on the original condition description in each rule entry to obtain the condition information corresponding to the rule entry, and generate a logical template containing condition placeholders according to the logical relationship between the condition information. The second generation module is used to generate rule items corresponding to each rule entry based on the condition information, the logic template, and the applicable condition field used to limit the scope of application of the rule; The construction module is used to construct the rule information database based on the rule items corresponding to each rule entry.
[0099] Optionally, the building module is further configured to: Determine the scope of application for each of the rule items; The rule items are organized hierarchically according to their applicable scope to obtain the rule information library. Each layer of the rule information library contains the rule items within the same applicable scope.
[0100] Optionally, the condition information includes at least one of four constraints: equipment type, operating action, voltage level, and interval type. The generation module 503 is further used for: The actual signal identifier is obtained by filtering signal identifiers that meet at least one of the four constraints: equipment type, operation action, voltage level, and interval type, from the secondary equipment ledger information. Establish the correspondence between the actual signal identifier and the condition placeholder; Based on the correspondence, the actual signal identifier is used to replace the condition placeholder in the logic template to obtain the initial logic expression.
[0101] Optionally, the generation module 503 is further configured to: When the same condition placeholder corresponds to multiple actual signal identifiers, the multiple actual signal identifiers are combined according to the preset logical combination rules to obtain the combined logical expression. Replace the condition placeholders with the combined logical expression to generate the initial logical expression.
[0102] Optionally, the adapter module 504 is further configured to: Based on the wiring method and voltage level, determine the target logic part in the initial logic expression that does not match the wiring method or voltage level; The target logic part is ignored, deleted, or replaced to obtain the target logic expression.
[0103] Each module in the above-mentioned logical expression generation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0104] In one embodiment, a computer device is provided, which may be a terminal device, and its internal structure diagram may be as follows: Figure 6 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computational and control capabilities. The memory includes a readable storage medium storing computer-readable instructions. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer-readable instructions implement a method for generating a logical expression. The readable storage medium provided in this embodiment includes both non-volatile and volatile readable storage media.
[0105] In this application embodiment, a computer device is provided, including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor. When the processor executes the computer-readable instructions, it implements the steps of the logical expression generation method described above.
[0106] In one embodiment of the application, a readable storage medium is provided, which stores computer-readable instructions. When the computer-readable instructions are executed by a processor, they implement the steps of the method for generating the logical expression described above.
[0107] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing related hardware with computer-readable instructions. These computer-readable instructions can be stored in a non-volatile readable storage medium or a volatile readable storage medium. When executed, these computer-readable instructions can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0108] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0109] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A method for generating logical expressions, characterized in that, The method includes: Obtain secondary equipment ledger information, wherein the secondary equipment ledger information includes the logical type of a logical object and the signal identifier corresponding to the logical object; Based on the logical type, a corresponding target rule item is selected from the pre-built rule information library. The target rule item includes a logical template containing condition placeholders, condition information corresponding to each condition placeholder, and an applicable condition field used to limit the scope of application of the rule. Based on the condition information, the corresponding actual signal identifier is matched in the secondary equipment ledger information, and the condition placeholder in the logic template is replaced with the actual signal identifier to generate an initial logic expression. Based on the applicable condition field, the initial logical expression is adapted to obtain the target logical expression.
2. The method for generating logical expressions as described in claim 1, characterized in that, Before obtaining the secondary equipment ledger information, the method further includes: Obtain the function type of the logical object and the device attribute or device type to which the logical object belongs; Based on the function type and the device attribute or device type to which the logical object belongs, the logical type corresponding to the logical object is determined according to a preset mapping relationship.
3. The method for generating logical expressions as described in claim 1, characterized in that, Before selecting the corresponding target rule item from the pre-built rule information base based on the logical type, the method further includes: Obtain user logic specifications; Based on the user logic specifications, semantic parsing is performed to obtain at least one rule entry; The original condition description in each rule entry is structured to obtain the condition information corresponding to the rule entry, and a logical template containing condition placeholders is generated according to the logical relationship between the condition information. Based on the condition information, the logical template, and the applicable condition field used to limit the scope of application of the rule, a rule item corresponding to each rule entry is generated; The rule information database is constructed based on the rule items corresponding to each rule entry.
4. The method for generating logical expressions as described in claim 3, characterized in that, The rule information database is constructed based on the rule items corresponding to each rule entry, including: Determine the scope of application for each of the rule items; The rule items are organized hierarchically according to their applicable scope to obtain the rule information library. Each layer of the rule information library contains the rule items within the same applicable scope.
5. The method for generating logical expressions as described in claim 1, characterized in that, The condition information includes at least one of four constraints: equipment type, operation action, voltage level, and interval type. Based on the condition information, the corresponding actual signal identifier is matched in the secondary equipment ledger information, and the condition placeholder in the logic template is replaced with the actual signal identifier to generate an initial logic expression, including: The actual signal identifier is obtained by filtering signal identifiers that meet at least one of the four constraints: equipment type, operation action, voltage level, and interval type, from the secondary equipment ledger information. Establish the correspondence between the actual signal identifier and the condition placeholder; Based on the correspondence, the actual signal identifier is used to replace the condition placeholder in the logic template to obtain the initial logic expression.
6. The method for generating logical expressions as described in claim 5, characterized in that, The step of replacing the condition placeholder in the logic template with the actual signal identifier based on the correspondence to obtain the initial logic expression includes: When the same condition placeholder corresponds to multiple actual signal identifiers, the multiple actual signal identifiers are combined according to the preset logical combination rules to obtain the combined logical expression. Replace the condition placeholders with the combined logical expression to generate the initial logical expression.
7. The method for generating logical expressions as described in claim 1, characterized in that, The applicable condition field includes wiring method and voltage level. The adaptation process performed on the initial logic expression based on the applicable condition field to obtain the target logic expression includes: Based on the wiring method and voltage level, determine the target logic part in the initial logic expression that does not match the wiring method or voltage level; The target logic part is ignored, deleted, or replaced to obtain the target logic expression.
8. A device for generating logical expressions, characterized in that, The device includes: The acquisition module is used to acquire secondary equipment ledger information, which includes the logical type of a logical object and the signal identifier corresponding to the logical object. The selection module is used to select a corresponding target rule item from a pre-built rule information library based on the logical type. The target rule item includes a logical template containing condition placeholders, condition information corresponding to each condition placeholder, and an applicable condition field for limiting the scope of application of the rule. The generation module is used to match the corresponding actual signal identifier in the secondary equipment ledger information based on the condition information, and replace the condition placeholder in the logic template with the actual signal identifier to generate an initial logic expression. An adaptation module is used to adapt the initial logical expression based on the applicable condition field to obtain the target logical expression.
9. A computer device comprising a memory, a processor, and computer-readable instructions stored in the memory and running on the processor, characterized in that, When the processor executes the computer-readable instructions, it implements the method for generating logical expressions as described in any one of claims 1 to 7.
10. A readable storage medium having computer-readable instructions stored thereon, characterized in that, When the computer-readable instructions are executed by a processor, they implement the method for generating logical expressions as described in any one of claims 1 to 7.