Facility control method, electronic device, and storage medium
By establishing a mapping relationship between virtual points and field equipment in the facility control method, and loading and executing control logic scripts, the problems of flexibility and efficiency of the facility control method are solved. This achieves decoupling of hardware and adaptability to business needs, and reduces the risk of equipment changes.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN WANWEI ZHIXING TECHNOLOGY CO LTD
- Filing Date
- 2026-02-28
- Publication Date
- 2026-06-09
AI Technical Summary
Existing facility control methods lack flexibility and efficiency, making it difficult to adapt to changes in field equipment and business needs. Furthermore, the lack of effective commissioning methods and version management results in a high risk of control strategy updates.
By establishing a mapping relationship between virtual points and field devices, loading control logic scripts and executing trigger rules, monitoring trigger conditions and executing scripts, obtaining virtual point writing actions and converting them into physical control commands, flexible control logic configuration and execution are supported.
This decouples facility control methods from hardware, improves configuration efficiency and adaptability, meets real-time and planning requirements, and reduces the impact of equipment replacement and protocol changes.
Smart Images

Figure CN122172624A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of facility control, and in particular to facility control methods, electronic devices, and non-transitory computer-readable storage media. Background Technology
[0002] With the development of modern logistics and industrial automation, large-scale facilities (such as cold storage and intelligent buildings) are placing higher demands on the real-time performance, intelligence level, and energy efficiency control of their operations and management. On the one hand, the construction and modification of control logic has a high barrier to entry; changes, such as in the physical location of field equipment or communication protocols, often require recompiling the underlying code, lacking flexibility. On the other hand, a single periodic scanning mechanism makes it difficult to flexibly define the triggering timing of control logic according to business needs. Furthermore, the lack of effective debugging methods and version management mechanisms makes updating control strategies in a production environment highly risky. Therefore, a flexible and efficient facility control method is desired.
[0003] It should be noted that the content described herein is only to provide background information in relation to this disclosure and does not necessarily belong to the prior art. Summary of the Invention
[0004] In view of the above problems, this disclosure aims to provide facility control methods, electronic devices, non-transitory computer-readable storage media, and computer program products.
[0005] The facility control method of the first aspect of this disclosure includes: establishing a mapping relationship between virtual points and physical points of field equipment; loading a control logic script and associated execution trigger rules, wherein the execution trigger rules include the timing when the control logic script is invoked; executing the control logic script when the execution trigger rules are detected; acquiring write actions for virtual points generated during the execution of the control logic script, and converting the write actions into corresponding physical control instructions based on the mapping relationship and transmitting them to the field equipment.
[0006] According to certain embodiments of the facility control method, optionally, the execution of triggering rules includes at least one of the following: cyclically triggering the control logic script according to a configured time interval parameter; triggering the control logic script when the value change of a configured monitoring target exceeds the trigger threshold or a state transition occurs, wherein the monitoring target is a specified virtual point; and triggering the control logic script when the system clock reaches a configured time point.
[0007] Optionally, in the facility control method according to certain embodiments, the control logic script is further configured to be invoked by other control logic scripts through a function call interface and to return calculation results.
[0008] According to certain embodiments of the facility control method, optionally, the control logic script is further configured to include internal variables and global variables. The internal variables are valid during a single execution of the control logic script, while the global variables are stored in a shared memory area and can be read and modified by different control logic scripts.
[0009] Optionally, in a facility control method according to certain embodiments, the control logic script is further configured to include a soft timer object, and the method further includes: calculating a current timing value based on the system clock, and updating the output status bit of the soft timer object according to the timing value for the control logic script to read.
[0010] Optionally, the facility control method according to certain embodiments may further include: parsing the reference relationships of virtual points in all loaded control logic scripts, constructing a dependency topology graph between the control logic scripts and the virtual points; receiving a query request for a target virtual point or target device, and outputting a reference list based on the dependency topology graph.
[0011] Optionally, the facility control method according to certain embodiments may further include: monitoring the data quality status of virtual points; when an abnormal data quality status of a source virtual point is detected, automatically propagating the abnormal status to downstream virtual points dependent on the source virtual point based on a dependency topology graph; and suspending the execution of the control logic script that reads the virtual point with the abnormal status.
[0012] Optionally, the facility control method according to certain embodiments may further include: monitoring the execution time or resource usage during the execution of a control logic script; and suspending the current execution of the control logic script when a timeout or an infinite loop is detected during the execution of the control logic script.
[0013] Optionally, the facility control method according to certain embodiments is characterized in that the method further includes: starting a debugging mode before the control logic script enters the operation scheduling; in the debugging mode, using real-time virtual point values as input to execute the control logic script, blocking the write actions generated by the control logic script, and returning the simulation calculation results and output status on the debugging interface.
[0014] Optionally, the facility control method according to certain embodiments is characterized in that the debugging mode further includes: when the control logic script is updated, keeping the old version of the script running online to control the field equipment, and starting the new version of the script to enter the virtual running state; comparing the virtual output result of the new version of the script with the actual output result of the old version of the script, and switching the new version of the script to the formal running state based on the comparison result.
[0015] Optionally, the facility control method according to certain embodiments may further include: associating a control logic script with a timetable object, the timetable object including a preset time period; and enabling the triggering of the control logic script based on execution triggering rules when the current system time is within the preset time period configured in the timetable object.
[0016] Optionally, the facility control method according to certain embodiments may further include: when multiple different control logic scripts attempt to write to the same virtual point within the same scheduling cycle, allowing the highest priority or latest write request to take effect, and discarding other conflicting write requests.
[0017] The second aspect of this disclosure is a non-transitory computer-readable storage medium that stores instructions that, when executed by a processor, perform a facility control method according to any embodiment herein.
[0018] The electronic device of the third aspect of this disclosure includes a processor and a memory, the memory storing instructions that, when executed by the processor, perform a facility control method according to any embodiment herein.
[0019] The computer program product of the fourth aspect of this disclosure includes a computer program that, when executed by a processor, performs the facility control method of any embodiment herein. Attached Figure Description
[0020] Figure 1 A schematic flowchart of a facility control method 100 according to some embodiments is shown.
[0021] Figure 2 A schematic diagram of a module of an electronic device 200 according to some embodiments is shown. Detailed Implementation
[0022] The following description describes some of the various embodiments of this disclosure, intended to provide a basic understanding of the disclosure. It is not intended to identify key or decisive elements of the disclosure or to limit the scope of protection sought.
[0023] For purposes of brevity and illustrative purposes, the principles of this disclosure are described herein primarily with reference to exemplary embodiments thereof. However, those skilled in the art will readily recognize that the same principles are equivalently applicable to all types of facility control methods, electronic devices, non-transitory computer-readable storage media, computer program products in which these same principles can be implemented, and that any such variations do not depart from the true spirit and scope of this patent application.
[0024] Furthermore, reference is made in the accompanying drawings, which illustrate specific exemplary embodiments. Electrical, mechanical, logical, and structural changes may be made to these embodiments without departing from the spirit and scope of this disclosure. Moreover, while features of this disclosure are disclosed in combination with only one of several embodiments, such features may be combined with one or more other features of other embodiments if desired and / or advantageous for any given or identifiable function. Therefore, the following description should not be considered limiting in any sense, and the scope of this disclosure is defined by the appended claims and their equivalents.
[0025] Terms such as “possessing” and “comprising” indicate that, in addition to having the units (modules) and steps that are directly and explicitly stated in the specification and claims, the technical solutions of this disclosure do not exclude the presence of other units (modules) and steps that are not directly or explicitly stated.
[0026] In this document, the term "facilities" or "large-scale facilities" is used to refer to any physical system or location that includes physical equipment and requires environmental control, energy management, or automation. It can refer to temperature-sensitive storage environments such as cold storage facilities and cold chain logistics centers, as well as scenarios such as commercial buildings, industrial plants, data centers, water treatment plants, or agricultural greenhouses. Within this scope, "facilities" typically have distributed networks of sensors and actuators and specific management requirements regarding real-time operation, energy costs, or equipment security. Although this disclosure frequently uses "cold storage facilities" as examples, this is merely for the purpose of facilitating understanding of typical application scenarios of the technical solutions and should not be considered a limitation on the scope of protection of the term "facilities."
[0027] In this document, "field device" or "physical device" refers to hardware entities deployed in a controlled facility that interact directly with the physical world, and their associated underlying controllers. This includes, but is not limited to, input devices that sense the physical environment (such as temperature sensors, pressure transmitters, meters, and flow meters), output devices that perform physical actions (such as compressors, fans, pumps, valves, and relays), and field controllers that are directly connected to these input and output devices.
[0028] In this article, "edge" or "edge computing" refers to a computing architecture and processing mode that is close to the data source or field device, positioned between the physical field device and the remote cloud platform. The term "script" or "control logic script" refers to a piece of program code written or configured by the user, containing a series of logical judgments, operational rules, or flow control instructions. The term "variable" refers to a named storage space in system memory used to store specific numerical or state information, while "global variable" specifically refers to shared data units whose scope covers the entire edge system or multiple independent control scripts. The term "point" generally refers to the smallest unit of data monitoring or control, while "virtual point" refers to a logical object or data structure built at the software level to carry data or state. A "virtual point" can be configured to map to a specific physical interface (in which case it acts as a hardware proxy or cache), or it can not map to any physical interface and only serve as a container for storing intermediate computational values (such as runtime, cumulative energy consumption).
[0029] Figure 1 A schematic flowchart of a facility control method 100 according to some embodiments is shown. The facility control method 100 may include the following steps 110-140.
[0030] In step 110, a mapping relationship is established between virtual points and physical points of field devices. Specifically, the physical point data of field devices (such as PLC register addresses, I / O port status bits, etc.) is often heterogeneous and volatile; the physical address definitions of devices from different brands or models may be completely different. Virtual points, on the other hand, are equivalent to a standardized and unified set of logical objects built in system memory. Therefore, this step can establish the association between the logic control layer and the physical device layer. For example, configuration information can be received to map a specific physical address to a virtual point with a semantic name. This mapping relationship can be stored in a database or configuration file. By establishing this mapping, complex and variable physical attributes can be encapsulated into unified logical objects, allowing subsequent control logic to be defined only for virtual points without needing to concern itself with the underlying physical implementation details.
[0031] For example, in cold storage facilities, field devices / physical equipment (such as screw compressors, air coolers, electronic expansion valves, etc.) are typically connected via specific physical communication interfaces (such as RS-485) and communication protocols. Configuration information can be received to map specific register addresses or I / O ports of these physical devices to virtual points with business semantics. For example, a specific register address of a cold storage controller can be mapped to a virtual point named "Warehouse Temperature 1". Through this mapping, subsequent control logic can be defined based on virtual points without needing to concern itself with the underlying physical addressing details.
[0032] In step 120, the control logic script and associated execution trigger rules are loaded. The execution trigger rules specify when the control logic script will be invoked. This step involves injecting user-defined business logic into the edge computing environment to deploy the control strategy. This involves receiving user-written control logic scripts, which can be written in interpreted languages such as JavaScript, Lua, or Python, and contain read / write operations on the aforementioned virtual points. Simultaneously, to enable the static script to run, associated execution trigger rules can be configured. These rules can be considered metadata attached to the script, instructing the scheduler under what conditions to load and execute the script. For example, rules can define whether the script needs to run continuously, only when a specific event occurs, or at a specific time.
[0033] Specifically, taking a cold storage scenario as an example, the control logic script can contain various business logics for cold storage operation. For instance, in a cold storage management scenario, it might determine whether the storage temperature has reached a set value to start or stop the refrigeration unit, or calculate superheat to adjust the opening of the expansion valve. Simultaneously, the loaded execution trigger rules define the script's operating mechanism. For example, for fault protection logic requiring real-time response, the rule can be configured to trigger based on data changes; for periodic energy consumption statistics logic, the rule can be configured to trigger at set times. This creates a configuration method that separates the logic content from the triggering mechanism, allowing the same set of logic code to adapt to different operating scenarios.
[0034] In step 130, when the execution trigger rule is detected, the control logic script is executed. This step is performed by the system's internal scheduling engine or event listener. The scheduling engine can be in a continuous listening state, comparing the current system state (such as time, changes in point values) with the trigger rules loaded in step 120 in real time. Once a trigger condition for a script is detected (e.g., the current time matches a timed moment, or a monitored virtual point value changes abruptly), the scheduling engine can immediately allocate computing resources, load the script's context environment, and execute the code instructions in the script sequentially. During execution, the script engine can read the latest data from the virtual point cache in memory as input parameters for logical operations. This rule-based dynamic execution mechanism enables the system to automatically respond to environmental changes or time processes.
[0035] Taking a cold storage scenario as an example, when the value of the virtual point "No. 1 temperature" changes and meets the preset trigger rules, or when the system clock reaches the preset defrost time, the corresponding control logic script can be invoked (e.g., invoked by electronic devices). During execution, the script reads the current value of the virtual point in memory as input, performs logical operations, and obtains the corresponding control result (e.g., deciding to turn on the defrost heater).
[0036] In step 140, write actions targeting virtual points generated during the execution of the control logic script are acquired, and these write actions are converted into corresponding physical control commands based on the mapping relationship and transmitted to the field devices. When the script logic determines that the device state needs to be changed and a value assignment operation is performed on the corresponding virtual point, the write action will be captured or intercepted by the system's middleware layer. At this time, the action only remains at the virtual level. Subsequently, the mapping relationship table established in step 110 can be called to find the physical device address (such as the specific IP address, slave ID, and register address) and communication protocol type corresponding to the written virtual point. Based on this information, the logical values generated by the script can be converted into control messages (such as binary data frames) that conform to the physical device protocol specifications and sent to the field devices through the physical communication interface.
[0037] For example, in a cold storage scenario, when the script generates output (e.g., setting the "defrost start / stop" virtual point to the "on" state), the action is first applied at the virtual point level. Subsequently, based on the mapping relationship established in step 110, the physical device address and protocol format corresponding to that virtual point can be found. For example, the "on" state can be converted into a write register instruction under a specific protocol and sent to the on-site air cooler controller. In this way, the conversion and execution from logical decision-making to physical device action is achieved.
[0038] Through steps 110-140 above, an edge control process that decouples control logic from the underlying hardware is constructed. Using virtual points as an intermediary, this method 100 frees the development and maintenance of upper-level control strategies from the specific models or communication protocols of the underlying physical devices. When field devices are replaced or protocols change, only the mapping relationship needs to be adjusted, without reconstructing complex control scripts. Simultaneously, the separate configuration of scripts and trigger rules improves flexibility, enabling it to adapt to various business scenarios and thus enhancing the configuration efficiency of facility management. This method 100 is particularly suitable for the management of large facilities such as cold storage facilities, utilizing virtual points to represent the diversity of underlying refrigeration equipment, allowing control logic to exist independently of the hardware. Furthermore, configurable trigger rules can meet the different needs of cold storage control for real-time performance (such as temperature alarms) and planning (such as peak-shifting power consumption), improving the adaptability of facility control strategies.
[0039] In some embodiments, executing triggering rules includes at least one of the following: cyclically triggering the control logic script according to a configured time interval parameter; triggering the control logic script when the value change of a configured monitoring target exceeds a trigger threshold or a state transition occurs, wherein the monitoring target is a specified virtual point; and triggering the control logic script when the system clock reaches a configured time point. To meet the diverse industrial control needs of large facilities (e.g., cold storage), the scheduler can support the coexistence of multiple triggering modes. For example, a timer (e.g., every 1000 milliseconds) can be configured, suitable for feedback control scenarios requiring continuous calculation. Alternatively, the script can be woken up only when the value change of the monitored virtual point exceeds a dead zone threshold or a state transition occurs, thereby avoiding invalid calculations. Or, the script can be triggered at specific times based on the clock, suitable for periodic tasks.
[0040] For example, in a cold storage control scenario, these three rules are applicable to different business needs. A PID temperature control script can be configured to execute cyclically at fixed time intervals (e.g., every second) to ensure smooth compressor frequency regulation; a fault handling script can be configured to trigger only when the virtual point status of "compressor fault alarm" changes from 0 to 1, achieving millisecond-level response to faults; or an energy consumption statistics script can be configured to trigger at midnight every day to complete the archiving of daily report data.
[0041] In some embodiments, the control logic script can optionally be further configured to be invoked by other control logic scripts through a function call interface and return the calculation result. In some complex control scenarios, multiple scripts may need to use the same calculation logic. To avoid code redundancy, the system allows such general logic to be written as an independent functional script and provides an external calling interface. During execution, other business scripts can call this functional script and obtain the result through, for example, API nesting, thus achieving modular reuse of control logic.
[0042] Taking a cold storage scenario as an example, the control scripts for multiple cold rooms may need to calculate the air dew point temperature to prevent condensation. In this case, the dew point calculation logic can be encapsulated into a separate script. When the temperature control scripts for each cold room are running, they can directly call this calculation script, pass in the current storage temperature and humidity, and obtain the dew point temperature return value. This not only reduces code duplication but also facilitates subsequent unified modification of the calculation formula.
[0043] In some embodiments, the control logic script may optionally be further configured to include internal variables and global variables. Internal variables are valid only during a single execution of the control logic script, while global variables are stored in a shared memory area and can be read and modified by different control logic scripts. Specifically, internal variables may exist only within the context of a single script execution, used to store temporary intermediate values, and are destroyed after execution. Global variables, on the other hand, are stored in a shared memory area, acting as a system-level state sharing medium, allowing different control scripts to read them to perceive the overall system state or modify them to transmit signals.
[0044] For example, in cold storage energy management, a global variable can be defined to represent the "current electricity price period." The timetable script updates the status of this variable (e.g., peak / flat / valley) according to the system clock, while the temperature control scripts of each independent cold storage room read this variable. When the global variable indicates "valley electricity period," each temperature control script automatically lowers its set temperature to store cold. This facilitates coordinated operation between different subsystems within the facility.
[0045] In some embodiments, the control logic script may optionally be further configured to include a soft timer object. The method further includes: calculating the current timing value based on the system clock, and updating the output status bit of the soft timer object according to the timing value for the control logic script to read. The elapsed time is calculated by recording the start timestamp and comparing it with the current clock; the status bit of the object is updated when the set time is reached. The script determines subsequent actions by querying the status bit, achieving smooth timing control. For example, in refrigeration control, to protect the compressor, the control script can start a 3-minute timer after issuing a stop command. In each subsequent execution, the script first queries whether the timer has completed; only when the status bit indicates completion is a start command allowed.
[0046] In some embodiments, method 100 may further include: parsing the reference relationships of virtual points in all loaded control logic scripts, constructing a dependency topology graph between control logic scripts and virtual points; receiving query requests for target virtual points or target devices, and outputting a reference list based on the dependency topology graph. During the script loading phase, the virtual points referenced in the code (e.g., their IDs) can be parsed to construct the dependency topology graph. When a query request is received, a list of all scripts that read or write to the target point can be output based on the topology graph, thus providing a visual dependency query. For example, in a cold storage maintenance scenario, when a temperature sensor is damaged and needs replacement, or when a unit needs to be shut down for some operations, maintenance personnel can quickly query all control scripts that depend on that sensor using this function. This can help personnel assess operational risks and prevent errors in other logic (such as overheat protection) due to missing sensor data.
[0047] In some embodiments, method 100 may further include: monitoring the data quality status of virtual points; when an abnormal data quality status of a source virtual point is detected, automatically propagating the abnormal status to downstream virtual points dependent on the source virtual point based on the dependency topology graph; and suspending the execution of the control logic script that reads the virtual point with the abnormal status. In, for example, the management site of a large facility, physical equipment may experience communication failures or numerical over-range failures. Based on this, a predetermined data quality status can be maintained for each virtual point. When the source point has an abnormal quality, the abnormal label can be propagated downstream based on the dependency topology graph, and the scheduler checks the quality of the input points before execution. Once an abnormal dependent point is detected, script execution is immediately suspended, thus constructing a cascading fault suppression mechanism.
[0048] For example, if a temperature sensor in a cold storage facility experiences a disconnection, its corresponding virtual point is marked as a faulty value. In this case, the system can automatically identify the device script that relies on that temperature point (e.g., a script controlling an electronic expansion valve) and forcibly stop its operation, maintaining the valve opening unchanged or resetting it to a safe position. This prevents the script from outputting incorrect adjustment commands due to reading incorrect parameter values (e.g., temperature values), thus protecting the physical equipment in the facility.
[0049] In some embodiments, method 100 may further include: monitoring the execution time or resource consumption during the execution of the control logic script; and terminating the current execution of the control logic script when a timeout or infinite loop is detected. Considering that user-written scripts may have logical flaws or excessive complexity, the runtime of each script instance can be monitored in real time, and its execution can be forcibly terminated and an alarm triggered once a safety threshold is exceeded.
[0050] For example, if a user mistakenly uses an infinite loop structure or involves time-consuming complex calculations when writing temperature control logic, causing the script to freeze, the monitoring mechanism will intervene when the set timeout (e.g., 100 milliseconds) is reached, forcibly terminating the script process. This ensures that the edge gateway's main control program and other critical tasks are not affected, maintaining the overall stability of the facility and its equipment.
[0051] In some embodiments, method 100 may further include: initiating a debug mode before the control logic script enters the execution schedule; in debug mode, executing the control logic script using real-time virtual point values as input, masking the write actions generated by the control logic script, and returning the simulation calculation results and output status on the debug interface. In debug mode, the script runs in a virtual form, reading real field data as input for calculation, but its output instructions are masked at the driver layer, and only the simulation results are displayed on the interface. This allows users to verify some control logic without interfering with the operation of the equipment.
[0052] Optionally, the debugging mode further includes: when the control logic script is updated, keeping the old version of the script running online to control the field equipment, and starting the new version of the script into a virtual running state; comparing the virtual output of the new version of the script with the actual output of the old version of the script, and switching the new version of the script to the formal running state based on the comparison results. When optimizing the core algorithm, the old script continues to control the equipment, while the new script runs virtually in the background without outputting anything. The system continuously compares the output differences between the two to help maintenance personnel assess the stability of the new algorithm and smoothly switch it off after confirming that it is error-free. For example, in the scenario of cold storage facility management, when upgrading the superheat control algorithm of the electronic expansion valve, the new algorithm may introduce more complex PID parameters. Through virtual operation, the new algorithm can run in the background for a period of time. If the maintenance personnel find that the valve opening change calculated by the new algorithm is more stable and does not show abnormal fluctuations when the storage temperature fluctuates, they can transfer control to the new script based on this verification result.
[0053] In some embodiments, method 100 may further include: associating a control logic script with a time schedule object, the time schedule object including a preset time period; and enabling the triggering of the control logic script based on execution triggering rules when the current system time is within the preset time period configured in the time schedule object. This introduces a business time constraint. The time schedule object defines a valid time window, and the scheduler adds a gating judgment before processing the trigger, allowing the script to be triggered only within the time range, thus implementing business rules constraining the control logic. For example, defrosting operations in cold storage are typically scheduled during non-operating hours at night. The defrosting control script can be associated with a time schedule of "02:00-04:00". Even during the day, if the sensor detects a frost signal, the script will not be triggered because it is not within the preset time period. Only at 2:00 AM, when the frost conditions are met, will the defrosting logic actually start.
[0054] In some embodiments, method 100 may further include: when multiple different control logic scripts attempt to write to the same virtual point within the same scheduling cycle, allowing the highest priority or most recent write request to take effect, and discarding other conflicting write requests. In a multi-task concurrent environment, write conflicts may occur. Correspondingly, an arbitration mechanism can be established to determine control ownership based on priority or timestamp, preventing equipment state fluctuations. For example, in a cold storage system, a temperature control script may simultaneously request to start the compressor, while a high-pressure protection script may request to shut down the compressor. If the high-pressure protection script has a higher priority, the arbitration mechanism will discard the temperature control script's start request and execute the protection script's shutdown request, ensuring the safety of the facility's equipment.
[0055] In summary, the facility control method provided in this disclosure offers a complete lifecycle control logic management solution. From logic configuration, triggering, and execution to monitoring and debugging, this method not only solves the access problem of heterogeneous hardware through mapping technology, but also meets the needs of facility management sites for flexibility and collaboration.
[0056] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is also provided that stores instructions that, when executed, perform a facility control method according to any embodiment of this disclosure.
[0057] The term "non-transitory computer-readable storage medium" or "memory" as used in this disclosure can refer to any available medium accessible by a general-purpose or special-purpose computer. For example, computer-readable media may include RAM, ROM, EPROM, EROM, etc. 2 PROM, registers, hard disks, flash memory, solid-state drives (SSDs), SD cards, eMMC storage, removable disks, CD-ROMs or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other temporary or non-temporary medium capable of carrying or storing desired program code units in the form of instructions or data structures and accessible by a general-purpose or special-purpose computer, or a general-purpose or special-purpose processor, such as a central processing unit (CPU) and a graphics processing unit (GPU). Combinations of the above should also be included within the scope of protection for computer-readable media. An exemplary storage medium is coupled to a processor so that the processor can read and write information from / to the storage medium. In an alternative, the storage medium may be integrated into the processor. The processor and storage medium may reside in an ASIC. The ASIC may reside in a computing terminal (e.g., an edge computing device, an industrial gateway, a programmable logic controller (PLC), or an intelligent controller). In an alternative, the processor and storage medium may reside as discrete components in the computing terminal.
[0058] This disclosure also provides an electronic device including a memory and a processor, the memory storing instructions that, when executed by the processor, implement a facility control method according to any of the foregoing embodiments. Figure 2 This is a schematic diagram of a module of an electronic device 200 provided in certain embodiments of the present disclosure, such as... Figure 2 As shown, the electronic device 200 includes a memory 201, a processor 202, and a computer program stored in the memory 201 and executable on the processor 202.
[0059] In some examples, the processor 202 described above may include a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or a graphics processing unit (GPU), a system-on-a-chip (SOC), a microcontroller (MCU), a digital signal processor (DSP), a field-programmable gate array (FPGA), or an ARM architecture processor, or may be configured to implement one or more integrated circuits of the present disclosure embodiments.
[0060] Memory 201 may include read-only memory (ROM), random access memory (RAM), disk storage media device, optical storage media device, flash memory device, electrical, optical, or other physical / tangible memory storage device. Therefore, typically, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the facility control method according to embodiments of this disclosure.
[0061] The processor 202 runs a computer program corresponding to the executable program code by reading the executable program code stored in the memory 201, in order to implement the facility control method in the above embodiments.
[0062] In some examples, the electronic device 200 may also include a communication interface 203 and a bus 204. For example, Figure 2 As shown, the memory 201, processor 202, and communication interface 203 are connected through bus 204 and complete communication with each other.
[0063] The communication interface 203 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this disclosure. Input devices and / or output devices can also be connected through the communication interface 203. For example, the communication interface 203 may include wired interfaces (such as RS-485 interface, RS-232 interface, Ethernet interface RJ45 interface, fiber optic interface) and wireless interfaces (such as Wi-Fi module, Bluetooth module, ZigBee module, LoRa module, NB-IoT module or 4G / 5G communication module) to support communication protocols such as Modbus, BACnet or MQTT.
[0064] Bus 204 includes hardware, software, or both, and couples the components of electronic device 200 together. For example, and not as a limitation, bus 204 may include an industrial control bus, a Universal Serial Bus (USB), an Integrated Circuit Interconnect (I2C) bus, a Serial Peripheral Interface (SPI), a Universal Asynchronous Receiver / Transmitter (UART), a General Purpose Input / Output (GPIO) bus, a Controller Area Network (CAN) bus, an RS-485 bus, a Low Pin Count (LPC) bus, a memory bus, a MicroChannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-E) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, a Controller Area Network (CAN) bus, a Local Interconnect Network (LIN), an Ethernet bus, or other suitable buses, or a combination of two or more of these. Where appropriate, bus 204 may include one or more buses. Although specific buses are described and illustrated in the embodiments of this disclosure, this disclosure contemplates any suitable bus or interconnect.
[0065] This disclosure also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the facility control method in the above embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0066] It should be noted that the various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. For device embodiments, computer-readable storage medium embodiments, and computer program product embodiments, relevant parts can be referred to the description section of the method embodiments. This disclosure is not limited to the specific steps and structures described above and shown in the figures. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this disclosure. Furthermore, for the sake of brevity, detailed descriptions of known methods and techniques are omitted here.
[0067] The aspects of this disclosure have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer (e.g., an industrial control computer, an edge server, an embedded device), or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowchart illustrations, and combinations of blocks in the block diagrams and / or flowchart illustrations, can also be implemented by special-purpose hardware performing the specified functions or actions, or can be implemented by a combination of special-purpose hardware and computer instructions.
[0068] The foregoing primarily describes the facility control method, electronic equipment, and non-transitory computer-readable storage medium of this disclosure. Although only some specific embodiments of this disclosure have been described, those skilled in the art will understand that this disclosure can be implemented in many other forms without departing from its spirit and scope. Therefore, the examples and embodiments shown are to be considered illustrative rather than restrictive, and this disclosure may cover various modifications and substitutions without departing from the spirit and scope of this disclosure as defined by the appended claims.
Claims
1. A facility control method, characterized in that, include: Establish a mapping relationship between virtual locations and the physical locations of field equipment; Load the control logic script and the associated execution triggering rules, wherein the execution triggering rules include the timing when the control logic script is invoked; When the execution triggering rule is detected to be met, the control logic script is executed; The system acquires the write actions for virtual points generated during the execution of the control logic script, and converts the write actions into corresponding physical control commands based on the mapping relationship and transmits them to the field device.
2. The facility control method according to claim 1, characterized in that, The execution triggering rule includes at least one of the following: The control logic script is triggered cyclically according to the configured time interval parameters; When the value change of the configured monitoring target exceeds the trigger threshold or a state change occurs, the control logic script is triggered, and the monitoring target is the specified virtual point. The control logic script is triggered when the system clock reaches the configured time point.
3. The facility control method according to claim 1, characterized in that, The control logic script is further configured to be invoked by other control logic scripts through a function call interface and to return the calculation results.
4. The facility control method according to claim 1, characterized in that, The control logic script is further configured to include internal variables and global variables. The internal variables are valid during a single execution of the control logic script, and the global variables are stored in a shared memory area and can be read and modified by different control logic scripts.
5. The facility control method according to claim 1, characterized in that, The control logic script is further configured to include a soft timer object, and the method further includes: calculating the current timing value based on the system clock, and updating the output status bit of the soft timer object according to the timing value for the control logic script to read.
6. The facility control method according to claim 1, characterized in that, The method further includes: Analyze the reference relationships of virtual points in all loaded control logic scripts, and construct a dependency topology graph between control logic scripts and virtual points; Receive query requests for target virtual points or target devices, and output a reference list based on the dependency topology graph.
7. The facility control method according to claim 6, characterized in that, The method further includes: Monitor the data quality status of the virtual points; When an abnormal data quality status is detected at the source virtual point, the abnormal status is automatically propagated to the downstream virtual points that depend on the source virtual point based on the dependency topology graph. The execution of the control logic script for reading virtual points with abnormal states was aborted.
8. The facility control method according to claim 1, characterized in that, The method further includes: Monitor the execution time or resource consumption during the execution of the control logic script; When the execution of the control logic script times out or an infinite loop occurs, the current execution of the control logic script is terminated.
9. The facility control method according to claim 1, characterized in that, The method further includes: Before the control logic script enters the execution schedule, debug mode is started; In the debugging mode, the control logic script is executed using real-time virtual point values as input, the write actions generated by the control logic script are blocked, and the simulation results and output status are returned in the debugging interface.
10. The facility control method according to claim 9, characterized in that, The debugging mode further includes: When the control logic script is updated, the old version of the script is kept running online to control the field devices, and the new version of the script is started to enter the virtual running state. The virtual output of the new version of the script is compared with the actual output of the old version of the script, and the new version of the script is switched to the formal running state based on the comparison result.
11. The facility control method according to claim 1, characterized in that, The method further includes: Associate the control logic script with a time schedule object, the time schedule object including a preset time period; When the current system time is within the preset time period configured in the time schedule object, the control logic script is triggered based on the execution triggering rule.
12. The facility control method according to claim 1, characterized in that, The method further includes: When multiple different control logic scripts attempt to write to the same virtual point within the same scheduling cycle, the highest priority or most recent write request is allowed to take effect, and other conflicting write requests are discarded.
13. An electronic device, characterized in that, include: At least one processor; as well as The memory that is communicatively connected to the at least one processor The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the facility control method according to any one of claims 1 to 12.
14. A non-transitory computer-readable storage medium, characterized in that, The non-transitory computer-readable storage medium stores a computer program that, when executed by a processor, implements the facility control method according to any one of claims 1 to 12.