PLC system definition method and device based on hierarchical configuration model, equipment and medium

By constructing a hierarchical configuration model, the issues of uniformity and flexibility in PLC system I/O card configuration are resolved, enabling adaptation and dynamic updates for both conventional and complex I/O cards, thereby improving the continuity and reliability of industrial control.

CN122173157APending Publication Date: 2026-06-09XIAN THERMAL POWER RES INST CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
XIAN THERMAL POWER RES INST CO LTD
Filing Date
2026-02-25
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

Existing PLC system IO card configuration methods lack a unified configuration framework, cannot achieve multi-dimensional collaborative definition, are difficult to adapt to both conventional IO cards and complex gateway-type IO cards, require system shutdown for configuration updates, and lack deep integration with PLC system IO configuration.

Method used

A layered configuration model is constructed, including a physical layer, a logical layer, and a communication layer. The hardware interface attributes, data processing rules, and protocol parameter configurations of I/O cards are defined. Through multi-dimensional parameter configuration and online update mechanisms, unified and flexible management of I/O cards is achieved.

Benefits of technology

It enables unified and flexible configuration management of PLC system I/O cards, supports dynamic hot updates of multiple types of I/O cards, avoids system interruptions when configuration is modified, and improves the continuity and reliability of industrial control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122173157A_ABST
    Figure CN122173157A_ABST
Patent Text Reader

Abstract

This application relates to the field of computers, specifically to a method, apparatus, device, and medium for defining a PLC system based on a hierarchical configuration model. The method includes: constructing a hierarchical configuration model for defining a PLC system, wherein the hierarchical configuration model includes a physical layer, a logical layer, and a communication layer. The physical layer is used to define the hardware interface attributes of I / O cards in the PLC system, the logical layer is used to define the data processing rules of the I / O cards, and the communication layer is used to define the protocol parameter configuration of the I / O cards; configuring the parameters of the I / O cards in multiple dimensions, including hardware attribute dimensions, communication parameter dimensions, and data rule dimensions; and updating the architecture of the I / O cards online based on a configuration request verification strategy, an incremental data synchronization strategy, and a double-buffer switching strategy. This solves the technical problem of the inability to uniformly configure and manage I / O cards in PLC systems in the prior art, achieving the technical effect of unified and flexible configuration management of I / O cards in PLC systems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computers, and in particular to a method, apparatus, device and medium for defining a PLC system based on a hierarchical configuration model. Background Technology

[0002] A PLC (Programmable Logic Controller) is a microprocessor-based digital electronic device designed for industrial environments. It enables logic control, sequential control, timing, counting, and arithmetic operations through programming, and can load control instructions into memory for storage and execution. In industrial automation, the PLC system serves as the core control device, and the flexibility of its I / O card configuration directly impacts the adaptability and maintainability of the entire control system.

[0003] However, existing gateway configurations mostly use dedicated web interfaces or hardware integration methods, lacking deep integration with PLC system IO configuration, lacking a unified configuration framework, unable to be incorporated into a unified standardized definition system, unable to achieve multi-dimensional collaborative definition, and the configuration methods are difficult to adapt to both conventional IO cards and complex gateway-type IO cards.

[0004] Therefore, existing technologies suffer from the technical problem that PLC system I / O cards cannot be uniformly configured and managed.

[0005] Application content The purpose of this application is to provide a PLC system definition method, device, equipment and storage medium based on a hierarchical configuration model, so as to achieve the technical effect of unified and flexible configuration management of PLC system IO cards.

[0006] Firstly, this application provides a PLC system definition method based on a hierarchical configuration model, including: Construct a layered configuration model for defining the PLC system. The layered configuration model includes a physical layer, a logic layer, and a communication layer. The physical layer is used to define the hardware interface attributes of the I / O cards in the PLC system. The logic layer is used to define the data processing rules of the I / O cards. The communication layer is used to define the protocol parameter configuration of the I / O cards. The parameters of the I / O card are configured in multiple dimensions, including hardware attribute dimension, communication parameter dimension, and data rule dimension. Based on configuration request verification strategy, incremental data synchronization strategy and dual buffer switching strategy, the architecture of IO card is updated online.

[0007] Furthermore, the hardware interface attributes include at least one of the following: card type identifier, number of channels, signal type, and electrical parameters.

[0008] Furthermore, the data processing rules include at least one of the following: data filtering method, range conversion rules, and alarm threshold settings. Furthermore, the protocol parameter configuration includes at least one of the following: baud rate, checksum method, slave address, and data frame format applicable to Profibus DP, Can Open, and Modbus series gateway I / O cards.

[0009] Furthermore, the hardware attribute dimension includes basic card information, channel characteristics, and power parameters; the communication parameter dimension includes protocol type, connection parameters, and transmission strategy; and the data rule dimension includes data mapping relationships, conversion formulas, and update frequency.

[0010] Furthermore, the parameters of the I / O card are configured in multiple dimensions, including: In the hardware attribute dimension, enter the hardware-related parameters, including card model, firmware version, and operating voltage; In the communication parameter dimension, communication parameters are set, and a mapping relationship between communication parameters and communication layer protocol type is established. Among them, communication parameters include Modbus RTU, baud rate, and parity method. In terms of data rules, the mapping relationship between the physical layer and the logical layer, the data transformation formula and the update frequency are defined, and the parameters of the logical layer are correlated.

[0011] Furthermore, the architecture of the I / O card is updated online, including: Upon receiving an update request, check the validity and completeness of the parameters and reject invalid requests. Transmitting changed configuration parameters, and ensuring data integrity through CRC check; The verified configuration is written to the standby buffer, and the primary and standby buffers are switched through atomic operations to make the new configuration effective. Automatically records configuration update version information and supports historical version rollback.

[0012] Secondly, this application also provides a PLC system definition device based on a hierarchical configuration model, comprising: The building module is used to build a layered configuration model for defining the PLC system. The layered configuration model includes a physical layer, a logic layer, and a communication layer. The physical layer is used to define the hardware interface attributes of the I / O cards in the PLC system, the logic layer is used to define the data processing rules of the I / O cards, and the communication layer is used to define the protocol parameter configuration of the I / O cards. The configuration module is used to configure the parameters of the I / O card in multiple dimensions, including hardware attribute dimensions, communication parameter dimensions, and data rule dimensions. The update module is used to perform online updates to the architecture of IO cards based on configuration request verification strategies, incremental data synchronization strategies, and double buffer switching strategies.

[0013] Thirdly, this application also provides an electronic device, comprising: processor; Memory used to store processor-executable instructions; The processor is used to execute the above-described PLC system definition method based on the hierarchical configuration model by running instructions in memory.

[0014] Fourthly, this application also provides a computer storage medium storing instructions that, when executed, implement the above-mentioned PLC system definition method based on a hierarchical configuration model.

[0015] This application embodiment constructs a layered configuration model for defining a PLC system. This model includes a physical layer, a logical layer, and a communication layer. The physical layer defines the hardware interface attributes of the I / O cards in the PLC system, the logical layer defines the data processing rules for the I / O cards, and the communication layer defines the protocol parameter configurations for the I / O cards. The model configures the I / O cards across multiple dimensions, including hardware attribute dimensions, communication parameter dimensions, and data rule dimensions. Based on configuration request verification strategies, incremental data synchronization strategies, and double-buffer switching strategies, the architecture of the I / O cards is updated online. This solves the technical problem of the inability to uniformly configure and manage I / O cards in PLC systems in existing technologies, achieving a unified and flexible configuration management effect for PLC system I / O cards.

[0016] Other features and advantages of this application will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures pointed out in the description, claims and drawings. Attached Figure Description

[0017] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 A flowchart illustrating a PLC system definition method based on a hierarchical configuration model, provided in this application embodiment; Figure 2 A schematic diagram illustrating a PLC system definition method based on a hierarchical configuration model provided in this application embodiment; Figure 3 A flowchart illustrating another PLC system definition method based on a hierarchical configuration model provided in this application embodiment; Figure 4 A structural diagram of a PLC system definition device based on a hierarchical configuration model provided in this application embodiment; Figure 5 This is a structural diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0018] To facilitate a clear description of the technical solutions in the embodiments of this application, the terms "first" and "second" are used in the embodiments of this application to distinguish identical or similar items with essentially the same function and effect. For example, the first threshold and the second threshold are only used to distinguish different thresholds and do not limit their order. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and the terms "first" and "second" are not necessarily different.

[0019] It should be noted that, in this application, the terms "exemplary" or "for example" are used to indicate that something is being described as an example, illustration, or illustration. Any embodiment or design described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0020] In this application, "at least one" means one or more, and "more than one" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can mean: a, b, c, a combination of a and b, a combination of a and c, a combination of b and c, or a, b, and c, where a, b, and c can be single or multiple.

[0021] Existing PLC system I / O card configuration methods suffer from the following shortcomings: First, traditional configuration methods struggle to adapt to both conventional I / O cards and complex gateway-type I / O cards simultaneously. Conventional I / O cards typically require only simple hardware parameter configuration, while complex cards such as Profibus DP masters, Modbus masters, CanOpen masters, and Modbus TCP masters require extensive protocol parameter settings. Existing technologies often employ dedicated configuration tools for each, lacking a unified configuration framework. Second, I / O card definitions are often one-dimensional, focusing only on hardware interface attributes and neglecting the correlation between data processing rules and communication protocol parameters. Although existing technologies include hardware designs integrating multiple I / O types, their configuration methods remain limited to physical layer parameter settings, failing to achieve multi-dimensional collaborative definitions. Third, configuration updates require system shutdown. In traditional PLC systems, I / O configuration modifications require stopping the PLC to take effect, causing significant inconvenience in industrial scenarios with high continuity requirements. While existing configuration methods based on OPC UA or ontology semantic models achieve some degree of remote configuration, they do not address the issue of dynamic hot updates. Furthermore, existing Modbus gateway configurations mostly employ dedicated web interfaces or hardware integration methods, lacking deep integration with PLC system I / O configuration and failing to be incorporated into a unified, standardized definition system. Therefore, there is an urgent need for a PLC system configuration method that can cover multiple types of I / O cards, support multi-dimensional definitions, and enable dynamic hot updates.

[0022] To address the technical problems existing in the prior art, embodiments of this application provide a PLC system definition method based on a hierarchical configuration model, such as... Figure 1 As shown: Figure 1 A flowchart of a PLC system definition method based on a hierarchical configuration model provided in this application embodiment includes: S101: Construct a layered configuration model for defining the PLC system. The layered configuration model includes a physical layer, a logic layer, and a communication layer. The physical layer is used to define the hardware interface attributes of the I / O cards in the PLC system. The logic layer is used to define the data processing rules of the I / O cards. The communication layer is used to define the protocol parameter configuration of the I / O cards. Specifically, this embodiment constructs a three-layer configuration model consisting of a physical layer, a logic layer, and a communication layer. The functions of each layer are as follows: The physical layer defines the inherent hardware attributes of the I / O cards, including card type identification, number of channels, signal type (digital / analog), and electrical parameters (voltage / current range). For special communication gateway cards, it also includes the definition of the hardware interface type (e.g., RS485, Ethernet). The logic layer defines the processing rules for I / O data, realizing the conversion from raw data to application data. This includes data filtering methods (e.g., moving average, median filtering), range conversion rules (e.g., 4-20mA to 0-100%), alarm threshold settings (upper limit, lower limit), etc., establishing a mapping relationship with the physical layer channels. The communication layer defines the communication parameter configuration based on the protocol characteristics of gateway-type I / O cards. For various gateways such as Profibus DP master, Modbus master, CanOpen master, and Modbus TCP master, the configuration model enables collaborative operation with the underlying physical layer interface and the upper logic layer data, including parameters such as baud rate, parity method (odd / even / no parity), slave address range, data frame format (RTU / ASCII), and timeout. The physical layer provides hardware interface capabilities as the foundation, the logic layer handles data processing as the intermediate layer, and the communication layer supports protocol conversion as the extension layer. These three layers interact with parameters through an internal data bus, forming a complete I / O card configuration system. The configuration model can also include a gateway adaptation module for configuring specific protocol parameters for various gateway I / O cards such as Profibus DP, CanOpen, and Modbus series.

[0023] S102: Configure parameters for IO cards in multiple dimensions, including hardware attribute dimensions, communication parameter dimensions, and data rule dimensions; Specifically, this embodiment standardizes the definition of IO cards from three dimensions, with the following parameter categories: Hardware attribute dimension: covering basic card information (model, firmware version), channel characteristics (channel number, signal type), power parameters (operating voltage, power consumption), and other physical characteristic parameters. Communication parameter dimension: including protocol type (Modbus TCP / RTU, custom protocol), connection parameters (IP address, port number, baud rate), transmission strategy (polling cycle, timeout retries), and other communication-related settings, with particular emphasis on enhanced support for Modbus master gateway protocol parameters. Data rule dimension: defining data mapping relationships (correspondence between physical channels and logical variables), conversion formulas (engineering quantity conversion algorithms), update frequencies (data refresh cycles), and other data processing-related rules to achieve automated processing from raw collected data to application data. The multi-dimensional definition achieves associated storage through a unified data structure. Changes to parameters in each dimension automatically trigger consistency checks in the relevant dimensions, ensuring the integrity of the configuration data.

[0024] S103: Based on the configuration request verification strategy, incremental data synchronization strategy, and dual buffer switching strategy, the architecture of the IO card is updated online.

[0025] Specifically, this embodiment designs a dynamic hot update process based on double-buffering technology to achieve online configuration activation. The steps are as follows: Configuration request verification: Upon receiving a configuration update request, the system first performs validity verification (parameter range check) and integrity check (mandatory parameter verification). Invalid configuration requests are rejected, and an error message is returned. Incremental data synchronization: For configuration data that passes verification, an incremental update method is used to transmit only a subset of changed parameters, reducing data transmission volume. CRC check is used during synchronization to ensure data transmission correctness. Double-buffering switching: The system maintains a primary buffer (currently running configuration) and a backup buffer (configuration to be updated). After configuration data synchronization is complete, an atomic operation switches the backup buffer to the primary buffer, and the new configuration takes effect immediately. The old configuration is retained in the backup buffer for rollback. During the update process, the PLC system continues to run. Buffer separation enables parallel execution of configuration updates and IO data processing, avoiding system interruptions.

[0026] By constructing a layered configuration model for defining PLC systems, which includes a physical layer, a logical layer, and a communication layer, the physical layer defines the hardware interface attributes of I / O cards in the PLC system, the logical layer defines the data processing rules of I / O cards, and the communication layer defines the protocol parameter configuration of I / O cards. The model configures I / O cards across multiple dimensions, including hardware attribute dimensions, communication parameter dimensions, and data rule dimensions. Based on configuration request verification strategies, incremental data synchronization strategies, and dual-buffer switching strategies, the architecture of I / O cards is updated online. This solves the technical problem of the inability to uniformly configure and manage I / O cards in PLC systems in existing technologies, achieving a unified and flexible configuration management effect for PLC system I / O cards.

[0027] Optionally, the hardware interface attributes include at least one of the following: card type identifier, number of channels, signal type, and electrical parameters.

[0028] Optionally, the data processing rules include at least one of the following: data filtering method, range conversion rules, and alarm threshold settings. Optionally, the protocol parameter configuration includes at least one of the following: baud rate, checksum method, slave address, and data frame format applicable to Profibus DP, Can Open, and Modbus series gateway I / O cards.

[0029] Optionally, the hardware attribute dimension includes basic card information, channel characteristics, and power parameters; the communication parameter dimension includes protocol type, connection parameters, and transmission strategy; and the data rule dimension includes data mapping relationship, conversion formula, and update frequency.

[0030] In one embodiment, the scheme of "configuring parameters of IO card in multiple dimensions" in S102 above has been further optimized, and an alternative method is given. The specific implementation steps are as follows: S1021: In the hardware attribute dimension, enter the hardware-related parameters, including card model, firmware version, and operating voltage. S1022: In the communication parameter dimension, set the communication parameters and establish the mapping relationship between the communication parameters and the communication layer protocol type. The communication parameters include Modbus RTU, baud rate, and parity check method. S1023: In the data rules dimension, define the mapping relationship between the physical layer and the logical layer, the data transformation formula and the update frequency, and associate the parameters of the logical layer.

[0031] In one embodiment, the solution for "online updating of the architecture of the IO card" in S103 above has been further optimized, and an alternative method is provided. The specific implementation steps are as follows: S1031: After receiving an update request, check the validity and completeness of the parameters and reject invalid requests; S1032: Transmit changed configuration parameters and ensure data correctness through CRC check; S1033: Write the verified configuration to the standby buffer, and complete the primary and standby buffer switch through atomic operations to make the new configuration effective; S1034: Automatically records configuration update version information and supports historical version rollback.

[0032] In one exemplary embodiment, this application provides a PLC system definition method based on a hierarchical configuration model, which enables flexible configuration and dynamic updating of PLC system I / O cards. It is particularly suitable for complex industrial control scenarios that include conventional I / O cards and Modbus master communication gateways, such as... Figure 2 and Figure 3 As shown, Figure 2 This is a schematic diagram illustrating a PLC system definition method based on a hierarchical configuration model, provided in an embodiment of this application. Figure 3 A flowchart of another PLC system definition method based on a hierarchical configuration model provided in this application embodiment is shown below, with the specific steps as follows: Step 1: Construct a layered configuration model. Define physical layer parameters: based on the I / O card type, configure basic attributes such as hardware identifier, number of channels, and signal type. For gateway-type cards, additionally configure hardware interface type parameters. Define logic layer parameters: for each physical channel, configure data processing rules such as data filtering method, range conversion rules, and alarm thresholds. Define communication layer parameters: for gateway-type I / O cards, configure protocol type, connection parameters, and transmission strategy. This step can be omitted for regular I / O cards or the default communication parameters can be used.

[0033] Step 2: Perform multi-dimensional standardization definition. Hardware attribute dimension configuration: Enter hardware-related parameters such as card model, firmware version, and operating voltage. Communication parameter dimension configuration: Set communication parameters such as protocol type (e.g., Modbus RTU), baud rate, and parity check method, establishing a mapping relationship with the communication layer. Data rule dimension configuration: Define the mapping relationship between physical channels and logical variables, data conversion formulas, and update frequency, associating them with logical layer parameters.

[0034] Step 3: Implement dynamic hot updates. Configuration request validation: Upon receiving an update request, check the validity and completeness of parameters, rejecting invalid requests. Incremental data synchronization: Only transmitted changed configuration parameters are transmitted, and CRC checksums ensure data correctness. Dual-buffered switching: Verified configurations are written to a standby buffer, and atomic operations are used to switch between the primary and standby buffers, making the new configuration effective. Version logging: Automatically records configuration update version information, supporting historical version rollback.

[0035] Compared with existing technologies, the embodiments of this application have the following beneficial effects: Enhanced adaptability: A hierarchical configuration model achieves unified support for both conventional IO cards and complex gateway-type IO cards, solving the problem of insufficient adaptability in traditional methods. Compared with existing multi-protocol communication middleware solutions, this embodiment focuses more on the unified configuration management of IO cards. Comprehensive definition system: The multi-dimensional definition method breaks through the limitations of single hardware attribute definitions, incorporating hardware, communication, and data rules into a unified configuration framework, which is more comprehensive and systematic than the existing single-channel IO card configuration method. Uninterrupted operation guarantee: The dynamic hot update mechanism achieves online configuration updates through double-buffer switching, avoiding the problem of downtime required for configuration modifications in traditional PLC systems, and improving the continuity and reliability of industrial control processes. Simplified configuration management: The hierarchical architecture and standardized dimension definitions reduce the configuration difficulty of complex IO cards, making it easier to implement and maintain in engineering compared to semantic configuration methods based on OPC UA. Flexible scalability: The modular design allows the configuration requirements of new types of IO cards to be met by extending the parameters of the corresponding dimensions without reconstructing the entire configuration framework.

[0036] Based on the same concept, this application also provides a PLC system definition based on a hierarchical configuration model. Please refer to [reference needed].Figure 4 , Figure 4 A PLC system definition device based on a hierarchical configuration model provided in this application includes a construction module 201, a configuration module 202, and an update module 203.

[0037] Module 201 is used to build a layered configuration model for defining the PLC system. The layered configuration model includes a physical layer, a logical layer, and a communication layer. The physical layer is used to define the hardware interface attributes of the I / O cards in the PLC system, the logical layer is used to define the data processing rules of the I / O cards, and the communication layer is used to define the protocol parameter configuration of the I / O cards. Configuration module 202 is used to configure parameters of IO card in multiple dimensions, including hardware attribute dimension, communication parameter dimension and data rule dimension; The update module 203 is used to perform online updates to the architecture of IO cards based on configuration request verification strategy, incremental data synchronization strategy and double buffer switching strategy.

[0038] By constructing a layered configuration model for defining PLC systems, which includes a physical layer, a logical layer, and a communication layer, the physical layer defines the hardware interface attributes of I / O cards in the PLC system, the logical layer defines the data processing rules of I / O cards, and the communication layer defines the protocol parameter configuration of I / O cards. The model configures I / O cards across multiple dimensions, including hardware attribute dimensions, communication parameter dimensions, and data rule dimensions. Based on configuration request verification strategies, incremental data synchronization strategies, and dual-buffer switching strategies, the architecture of I / O cards is updated online. This solves the technical problem of the inability to uniformly configure and manage I / O cards in PLC systems in existing technologies, achieving a unified and flexible configuration management effect for PLC system I / O cards.

[0039] Furthermore, the hardware interface attributes include at least one of the following: card type identifier, number of channels, signal type, and electrical parameters.

[0040] Furthermore, the data processing rules include at least one of the following: data filtering method, range conversion rules, and alarm threshold settings. Furthermore, the protocol parameter configuration includes at least one of the following: baud rate, checksum method, slave address, and data frame format applicable to Profibus DP, Can Open, and Modbus series gateway I / O cards.

[0041] Furthermore, the hardware attribute dimension includes basic card information, channel characteristics, and power parameters; the communication parameter dimension includes protocol type, connection parameters, and transmission strategy; and the data rule dimension includes data mapping relationships, conversion formulas, and update frequency.

[0042] Furthermore, the configuration module 202 includes an input unit, a creation unit, and a definition unit. The input unit is used to input hardware-related parameters in the hardware attribute dimension, including card model, firmware version, and operating voltage. The establishment unit is used to set communication parameters and establish the mapping relationship between communication parameters and communication layers in the dimension of communication parameters. The protocol type includes Modbus RTU, baud rate, and parity check method. The definition unit is used to define the mapping relationship between the physical layer and the logical layer, the data transformation formula and the update frequency in the dimension of data rules, and to associate the parameters of the logical layer.

[0043] Furthermore, the update module 203 includes an inspection unit, a transmission unit, a switching unit, and an update unit. The inspection unit is used to check the validity and integrity of the parameters after receiving an update request, and to reject invalid requests. The transmission unit is used to transmit changing configuration parameters and ensures data integrity through CRC check. The switching unit is used to write the verified configuration to the standby buffer and complete the switch between the primary and standby buffers through atomic operations to make the new configuration effective. The update unit is used to automatically record configuration update version information and supports historical version rollback.

[0044] This application also provides an electronic device, please refer to... Figure 5 , Figure 5 This is a structural diagram of an electronic device provided in an embodiment of this application.

[0045] like Figure 5 As shown, the electronic device 400 includes a processor 410.

[0046] like Figure 5 As shown, the processor 410 described above can be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits used to control the execution of the program in this application.

[0047] like Figure 5 As shown, the electronic device 400 may further include a communication line 440. The communication line 440 may include a path for transmitting information between the components.

[0048] Optional, such as Figure 5As shown, the above-described electronic device may further include a communication interface 420. There may be one or more communication interfaces 420. The communication interface 420 may use any transceiver-like device for communicating with other devices or communication networks.

[0049] Optional, such as Figure 5 As shown, the electronic device may further include a memory 430. The memory 430 stores computer execution instructions for implementing the scheme of this application, and its execution is controlled by a processor. The processor executes the computer execution instructions stored in the memory, thereby implementing the PLC system definition method based on a hierarchical configuration model provided in the embodiments of this application.

[0050] like Figure 5 As shown, memory 430 can be read-only memory (ROM) or other types of static storage devices capable of storing static information and instructions, random access memory (RAM) or other types of dynamic storage devices capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. Memory 430 can exist independently and be connected to processor 410 via communication line 440. Memory 430 can also be integrated with processor 410.

[0051] Optionally, the computer execution instructions in the embodiments of this application may also be referred to as application code, and the embodiments of this application do not specifically limit this.

[0052] In a specific implementation, as one example, such as Figure 5 As shown, processor 410 may include one or more CPUs, such as Figure 5 CPU0 and CPU1 in the CPU.

[0053] In a specific implementation, as one example, such as Figure 5 As shown, the terminal device may include multiple processors, such as Figure 5 The first processor 4101 and the second processor 4102 are included. Each of these processors can be a single-core processor or a multi-core processor.

[0054] The methods disclosed in the embodiments of this application can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, a digital signal processor (DSP), an ASIC, a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied as execution by a hardware decoding processor, or as a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory; the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above-mentioned PLC system definition method based on a hierarchical configuration model.

[0055] This application also provides a computer-readable storage medium storing instructions that, when executed, implement the functions performed by the terminal device in the above embodiments.

[0056] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instructions are loaded and executed on a computer, the processes or functions described in the embodiments of this application are performed entirely or partially. The computer can be a general-purpose computer, a special-purpose computer, a computer network, a terminal, a user equipment, or other programmable device. The computer program or instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another. For example, the computer program or instructions can be transferred from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium, such as a floppy disk, hard disk, or magnetic tape; it can also be an optical medium, such as a digital video disc (DVD); or it can be a semiconductor medium, such as a solid-state drive (SSD).

[0057] Although this application has been described herein in conjunction with various embodiments, those skilled in the art, by reviewing the accompanying drawings, disclosure, and appended claims, will understand and implement other variations of the disclosed embodiments in carrying out the claimed application. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple instances. A single processor or other unit can implement several functions listed in the claims. While different dependent claims may recite certain measures, this does not mean that these measures cannot be combined to produce good results.

[0058] Although this application has been described in conjunction with specific features and embodiments, it is obvious that various modifications and combinations can be made thereto without departing from the spirit and scope of this application. Accordingly, this specification and drawings are merely exemplary illustrations of this application as defined by the appended claims, and are considered to cover any and all modifications, variations, combinations, or equivalents within the scope of this application. Clearly, those skilled in the art can make various alterations and modifications to this application without departing from the spirit and scope of this application. Thus, if such modifications and modifications of this application fall within the scope of the claims of this application and their equivalents, this application is also intended to include such modifications and modifications.

Claims

1. A PLC system definition method based on a hierarchical configuration model, characterized in that, include: Construct a layered configuration model for defining the PLC system, wherein the layered configuration model includes a physical layer, a logical layer, and a communication layer. The physical layer is used to define the hardware interface attributes of the I / O cards in the PLC system, the logical layer is used to define the data processing rules of the I / O cards, and the communication layer is used to define the protocol parameter configuration of the I / O cards. The I / O card is configured with parameters in multiple dimensions, including hardware attribute dimensions, communication parameter dimensions, and data rule dimensions. Based on the configuration request verification strategy, incremental data synchronization strategy, and dual buffer switching strategy, the architecture of the IO card is updated online.

2. The method according to claim 1, characterized in that, The hardware interface attributes include at least one of the following: card type identifier, number of channels, signal type, and electrical parameters.

3. The method according to claim 1, characterized in that, The data processing rules include at least one of the following: data filtering method, range conversion rules, and alarm threshold settings.

4. The method according to claim 1, characterized in that, The protocol parameter configuration includes at least one of the following: baud rate, verification method, slave address, and data frame format applicable to the IO cards of Profibus DP, Can Open, and Modbus series gateways.

5. The method according to claim 1, characterized in that, The hardware attribute dimension includes card basic information, channel characteristics, and power parameters; the communication parameter dimension includes protocol type, connection parameters, and transmission strategy; and the data rule dimension includes data mapping relationship, conversion formula, and update frequency.

6. The method according to claim 1, characterized in that, The parameters of the IO card are configured in multiple dimensions, including: In the hardware attribute dimension, enter the hardware-related parameters, including card model, firmware version, and operating voltage; In the communication parameter dimension, communication parameters are set, and a mapping relationship between the communication parameters and the communication layer protocol type is established. The communication parameters include Modbus RTU, baud rate, and parity check method. In the data rules dimension, the mapping relationship between the physical layer and the logical layer, the data transformation formula and the update frequency are defined, and the parameters of the logical layer are correlated.

7. The method according to claim 1, characterized in that, Online updates to the architecture of the aforementioned I / O card include: Upon receiving an update request, check the validity and completeness of the parameters and reject invalid requests. Transmitting changed configuration parameters, and ensuring data integrity through CRC check; The verified configuration is written to the standby buffer, and the primary and standby buffers are switched through atomic operations to make the new configuration effective. Automatically records configuration update version information and supports historical version rollback.

8. A PLC system definition device based on a hierarchical configuration model, characterized in that, include: A construction module is used to construct the layered configuration model for defining the PLC system. The layered configuration model includes a physical layer, a logical layer, and a communication layer. The physical layer is used to define the hardware interface attributes of the I / O cards in the PLC system. The logical layer is used to define the data processing rules of the I / O cards. The communication layer is used to define the protocol parameter configuration of the I / O cards. The configuration module is used to configure the parameters of the IO card in multiple dimensions, including hardware attribute dimension, communication parameter dimension and data rule dimension; The update module is used to perform online updates to the architecture of the IO card based on the configuration request verification strategy, the incremental data synchronization strategy, and the double buffer switching strategy.

9. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the PLC system definition method based on the hierarchical configuration model as described in any one of claims 1 to 7 by running instructions in the memory.

10. A computer storage medium, characterized in that, The computer storage medium stores instructions that, when executed, implement the PLC system definition method based on the hierarchical configuration model as described in any one of claims 1 to 7.