High-real-time virtual PLC implementation method and system for wind power control
By deploying a high-real-time virtual PLC system on a private cloud server in a wind farm, the real-time performance and stability issues of the wind power control system are resolved, enabling efficient resource utilization and convenient maintenance, and meeting the high-reliability control requirements of the wind farm.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-11
- Publication Date
- 2026-04-10
AI Technical Summary
Existing wind power control systems suffer from limited processing capacity, long response time, and poor scalability under high real-time requirements, making it difficult to meet the real-time and accuracy requirements of complex wind farm control tasks. Furthermore, the resource scheduling, task isolation, and real-time guarantee of PLCs are not perfect, resulting in insufficient reliability and stability of the control system.
A high-real-time virtual PLC implementation method based on a wind farm private cloud server is adopted. By deploying the PREEMPT_RT real-time patch host operating system, a hypervisor layer is generated, a real-time virtual machine is created, the physical server CPU is isolated and bound one-to-one with the virtual PLC instance, the SR-IOV network card virtualization function is configured, the user-space real-time protocol stack is deployed, the control logic program follows the IEC 61131-3 standard, and a dual-cycle task scheduling architecture is set up to achieve isolated execution of hard real-time control and soft real-time management tasks. Real-time performance is guaranteed through online monitoring and diagnostic functions.
It achieves a control cycle of 1 ms, task jitter of <50 µs, and network interruption latency of <30 µs, meeting the high reliability and high deterministic control requirements of wind farms. It has high resource utilization, supports standard programming, is easy to maintain, has online upgrade capabilities, and reduces system downtime.
Smart Images

Figure CN121840879A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of industrial control, in particular to a high real-time virtual PLC implementation method and system for wind power control. BACKGROUND
[0002] Current wind power control systems mostly rely on traditional PLCs for real-time control, but existing technologies have several defects in the high real-time demand field of wind power control. They have limited processing capacity, long response time, poor scalability, and other problems. When facing complex wind farm control tasks, they are difficult to meet the real-time and precision requirements. They also have deficiencies in flexibility, maintainability, and upgrading, making it difficult to meet the growing intelligent and automated demands of wind power systems. In the high-precision wind power control process, the resource scheduling, task isolation, and real-time protection of PLCs are not perfect enough, and problems such as delay and jitter are likely to occur, which can compromise the reliability and stability of the control system. SUMMARY
[0003] To solve the above technical problems, a high real-time virtual PLC implementation method and system for wind power control are provided. This technical solution solves the problems of insufficient real-time performance, large jitter, and high network delay of existing virtual PLCs, achieving a control cycle of 1 ms, task jitter of <50 µs, and network interruption delay of <30 µs, which meets the high reliability and high certainty control requirements of wind farms.
[0004] To achieve the above purposes, the technical solution adopted by the present application is as follows: A high real-time virtual PLC implementation method for wind power control, comprising: Based on the wind farm private cloud server, a PREEMPT_RT real-time patch host operating system is deployed to generate a Hypervisor layer with high real-time scheduling capability, and a real-time virtual machine is created as a virtual PLC running carrier. Based on the real-time virtual machine as a virtual PLC running carrier, the system boot parameters are modified, the specific CPU on the physical server is isolated and bound to the virtual CPU of the virtual PLC instance in a one-to-one exclusive manner, large page memory is allocated to the virtual PLC instance, 1GB or 2MB page specifications are preferentially used, and memory locking operations are performed. The SR-IOV network card virtualization function is configured, the generated virtual function is transmitted to the virtual PLC instance through the PCIe transparent transmission mode, the user-mode real-time protocol stack is deployed, and low-latency and high-precision time synchronization of network I / O are achieved. The control logic program complies with the IEC 61131-3 standard, is compiled into local machine code by an LLVM compiler, and generates a dynamic shared library for the virtual PLC real-time task to be directly loaded and run, a double-cycle task scheduling architecture is set, hard real-time control tasks and soft real-time management tasks are executed in isolation, task execution jitter is monitored online, task execution deviation is captured in real time, and an alarm is triggered and recorded when the threshold is exceeded, and real-time performance self-diagnosis and operation and maintenance analysis are supported.
[0005] Preferably, based on the wind farm private cloud server, a standard Linux distribution is installed as the host operating system, the Linux distribution kernel repository is accessed, and the Linux kernel source code matching the current host operating system kernel version is downloaded; Based on the PREEMPT-RT project website, real-time patch files corresponding to the version are obtained and applied to the kernel source code; Based on the kernel source code, the make menuconfig command is used for configuration, and in the preemption model under the general settings, the default voluntary preemption or general preemption is changed to a fully preemptible kernel to ensure that the high-precision timer function is enabled; Based on the completed configuration, the make-jN command is used to compile the kernel, after the compilation is completed, the module installation and kernel installation commands are executed, the boot configuration is updated and the server is restarted, and through the uname-a command, it is confirmed that the PREEMPT-RT word is contained in the output information, proving that the real-time kernel has been successfully loaded; Through the system package manager, QEMU-KVM and libvirt virtualization components are installed; Through libvirt configuration, the scheduling policy of the virtual CPU thread of the virtual machine is set to SCHED_FIFO, which is given a higher real-time priority, so that the virtual CPU thread of the virtual machine can immediately preempt the normal thread on the host operating system, and a real-time virtual machine is created as a virtual PLC running carrier; The higher real-time priority is taken as an example.
[0006] Preferably, the real-time preemption strength of the virtual CPU thread of the virtual machine that can immediately preempt the normal thread on the host operating system is represented as follows: Wherein, is the real-time preemption strength of the virtual CPU thread of the virtual machine that can immediately preempt the normal thread on the host operating system, and is the highest real-time priority, is the normal thread priority (usually 0), is the base of the natural logarithm, is the actual preemption delay of the PREEMPT-RT kernel, is a system time constant.
[0007] Preferably, based on the real-time virtual machine as a virtual PLC running carrier, the host operating system kernel boot parameters are guided, and the specific CPU on the isolated physical server is set; Using libvirt virtualization management tools, create a real-time virtual machine instance; Through the cputune part, the binding of the virtual CPU of the virtual machine and the physical CPU is fixed, ensuring that each virtual CPU is fixedly bound to a specific CPU on the isolated physical server in one-to-one, realizing the execution resource exclusivity; Based on the host operating system, pre-allocate large page memory pool, and when starting the real-time virtual machine, preferentially use 1GB or 2MB page size as the memory backend in the configuration; Based on the configuration virtual machine, ensure that the reserved fixed large page memory reduces the number of page table traversals, use the mlockall technology to lock all memory pages, enable the memory locking strategy, prevent memory pages from being swapped to the disk, and ensure the real-time performance of memory access.
[0008] Preferably, the comprehensive index expression for measuring the determinacy degree of the virtual PLC task running environment includes: Among them, is a comprehensive index for measuring the determinacy degree of the virtual PLC task running environment, is a type of computing resource that affects real-time performance, is a specific CPU on an isolated physical server and a one-to-one exclusive binding of virtual CPU and physical CPU, is the allocation of large pages and the execution of memory locking operations, is the probability of unpredictable and harmful interference from resource r, is the overall dependence of the task on resource r, is a single-resource determinacy factor.
[0009] Preferably, based on the host operating system, enable Intel VT-d technology in the BIOS / UEFI of the host operating system, enable SR-IOV network card virtualization function through the sysfs interface, allow the network interface card to virtualize its physical resources into multiple virtual functions VF, each virtual function VF has independent PCIe configuration space, and is regarded as a lightweight physical network card, realizing efficient segmentation and isolation of network resources; For the hardware layer, according to the multiple virtual functions VF, the host operating system is unbound to the VFIO-PCI driver, and in the libvirt configuration of the virtual machine, the virtual function VF is specified to be passed through PCIe directly to the virtual machine.
[0010] Preferably, when the virtual machine starts, the Hypervisor directly maps the resource configuration of the Virtual Function (VF) into the virtual machine, so that the VF can be recognized by the operating system of the virtual PLC instance as a standard physical network card, thus simplifying the network I / O path. Based on a virtual PLC instance, the DPDK network packet processing framework is installed. The network card is directly written to the user-space pre-allocated memory pool via DMA, and network packets are directly accessed in a polling manner. This stabilizes the network I / O latency from the kernel level of several milliseconds to less than ten microseconds, achieving extremely low latency and high-precision time synchronization for network I / O.
[0011] Preferably, the control logic program conforms to the IEC 61131-3 standard. The control logic program is compiled by the LLVM compiler to efficiently convert the high-level control logic code into native machine code and generate a native machine code dynamic shared library. The real-time operating system based on virtual PLC adopts a dual-cycle task scheduling architecture to isolate and execute hard real-time control tasks and soft real-time management tasks. For hard real-time control tasks, they are bound to a dedicated isolated virtual CPU, and a fixed short period of 1ms is set to run using sliding window technology; It operates based on a fixed short period of 1ms, reads sensor input at the beginning of each fixed period, couples local machine code dynamic shared library, and uses control signal as output; For soft real-time management tasks, a fixed long period of 10ms is set to run, which is responsible for data collection, status monitoring and log recording background management functions.
[0012] Preferably, through the dual-cycle task scheduling architecture, the system can reasonably schedule tasks according to the real-time requirements of different tasks, ensuring the priority execution of critical tasks and the normal operation of dual-cycle tasks; Based on the start and end of each cycle task, timestamps are aligned using a high-precision clock source, and the deviation between the actual interval of two adjacent cycles and the expected cycle is continuously calculated. Set a safety threshold. If the task execution time exceeds the worst-case execution time threshold or the deviation between the actual interval of two adjacent cycles and the expected cycle exceeds the allowable range, an alarm and safety handling procedure will be triggered immediately to achieve continuous diagnosis and protection of the real-time health status of the control system. The allowable range is exemplified by ±20% of the deviation between the actual interval and the expected interval between two adjacent cycles.
[0013] Furthermore, a high real-time virtual PLC implementation system for wind power control is provided, which implements a high real-time virtual PLC implementation method for wind power control, including: Data acquisition module, data binding module, time synchronization module, and data diagnostic module; The data acquisition module is used to deploy a host operating system with PREEMPT_RT real-time patching on a wind farm private cloud server, generate a Hypervisor layer with high real-time scheduling capabilities, and create a real-time virtual machine as a virtual PLC running carrier. The data binding module is electrically connected to the data acquisition module. It is used to isolate a specific CPU on the physical server and the virtual CPU of the virtual PLC instance by modifying the system boot parameters, based on the real-time virtual machine as the virtual PLC running carrier, and to allocate large page memory to the virtual PLC instance, preferably using 1GB or 2MB page specifications, and to perform memory locking operation. The time synchronization module is electrically connected to the data binding module and is used to configure the SR-IOV network card virtualization function. The generated virtual function is transmitted to the virtual PLC instance through PCIe transparent transmission, and the user-mode real-time protocol stack is deployed to achieve extremely low latency and high-precision time synchronization of network I / O. The data diagnostic module is electrically connected to the time synchronization module. It is used to compile control logic programs in accordance with the IEC 61131-3 standard into native machine code by the LLVM compiler, generating a dynamic shared library for direct loading and execution of virtual PLC real-time tasks. It sets up a dual-cycle task scheduling architecture to achieve isolated execution of hard real-time control tasks and soft real-time management tasks. It monitors task execution jitter online, captures task execution deviations in real time, triggers alarms and records them when thresholds are exceeded, and supports real-time performance self-diagnosis and operation and maintenance analysis.
[0014] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention proposes a method and system for implementing a high real-time virtual PLC for wind power control. It boasts excellent real-time performance, achieving performance comparable to hardware PLCs; high resource utilization, with a single physical server capable of supporting ≥20 vPLCs through cloud aggregation, allowing for flexible resource scaling on demand; good compatibility and openness, supporting standard IEC 61131-3 programming; and convenient maintenance, utilizing virtual machine snapshots, hot migration, and redundant copy technologies to achieve online upgrades and rapid recovery, reducing downtime. Attached Figure Description
[0015] Figure 1 A flowchart illustrating a high real-time virtual PLC implementation method for wind power control; Figure 2 This is a system framework diagram for a high real-time virtual PLC implementation for wind power control. Detailed Implementation
[0016] The following description is intended to disclose the invention and enable those skilled in the art to implement it. The preferred embodiments described below are merely examples, and other obvious variations will occur to those skilled in the art.
[0017] Reference Figure 1 As shown, a method for implementing a high-real-time virtual PLC for wind power control includes: S1. Based on the wind farm's private cloud server, deploy a host operating system with PREEMPT_RT real-time patching, generate a Hypervisor layer with high real-time scheduling capabilities, and create a real-time virtual machine as a virtual PLC running carrier. Step S1 includes the following: Based on the private cloud server of the wind farm, a standard Linux distribution is installed as the host operating system. The Linux distribution kernel repository is accessed to download the Linux kernel source code that matches the current host operating system kernel version. Based on the PREEMPT-RT project website, obtain the real-time patch files for the corresponding version and apply them to the kernel source code; Based on the kernel source code, the configuration is done through the `make menuconfig` command. According to the preemption model under the general settings, the default voluntary preemption or general preemption is changed to a fully preemptible kernel to ensure that the high-precision timer function is enabled. Based on the completed configuration, use the `make-jN` command to compile the kernel. After compilation, execute the module installation and kernel installation commands, update the boot configuration and restart the server. Use the `uname-a` command to confirm that the output information contains the words "PREEMPT-RT", which proves that the real-time kernel has been successfully loaded. Install QEMU-KVM and libvirt virtualization components using the system package manager; By configuring libvirt to set the virtual CPU thread scheduling policy of the virtual machine to SCHED_FIFO, giving it a higher real-time priority, the virtual CPU thread of the virtual machine can immediately preempt ordinary threads on the host operating system, creating a real-time virtual machine as the virtual PLC running platform. The formula is as follows: in, This allows virtual CPU threads in a virtual machine to immediately preempt ordinary threads on the host operating system, giving them real-time preemption strength. and As the highest real-time priority, It has the priority of a normal thread (usually 0). is the base of the natural logarithm. The actual preemption latency of the PREEMPT-RT kernel. The system time constant; The higher real-time priority is 99 as an example.
[0018] When using it, refer to the content of step S1 above: Wind farm control systems largely rely on traditional hardware PLCs. However, with increasing scale and system complexity, the scalability and real-time performance of traditional PLCs are significantly insufficient. Although there have been attempts to optimize control systems through virtualization, these generally face problems such as insufficient real-time performance, lack of targeted optimization, and inadequate resource utilization. This makes wind farm control systems prone to scheduling delays and resource bottlenecks under high load and multi-task scheduling scenarios, affecting system stability and efficiency. This approach, based on a wind farm private cloud server, PREEMT-RT real-time patching, and QEMU-KVM virtualization, provides high-precision real-time scheduling, ensuring immediate response and execution of critical tasks. By optimizing scheduling strategies and resource allocation, the system's real-time performance, stability, and scalability are improved, enhancing the overall efficiency and security of the wind farm control system.
[0019] S2. Based on a real-time virtual machine as the virtual PLC running carrier, by modifying the system boot parameters, a specific CPU on the physical server is isolated and exclusively bound to the virtual CPU of the virtual PLC instance. Large page memory is allocated to the virtual PLC instance, with a priority of 1GB or 2MB page specifications, and memory locking operation is performed. The boot parameters include isolcpus, rcu_nocbs, and nohz_full. Step S2 includes the following: Based on a real-time virtual machine as the virtual PLC running carrier, specific CPUs on isolated physical servers are set in the kernel boot parameters of the host operating system. Use the libvirt virtualization management tool to create real-time virtual machine instances; The cputune component binds the virtual CPUs of virtual machines to the physical CPUs, ensuring that each virtual CPU is fixedly bound to a specific CPU on an isolated physical server, thus achieving exclusive access to execution resources. Based on the host operating system, a large page memory pool is pre-allocated, and when starting a real-time virtual machine, a 1GB or 2MB page size is preferentially used as the memory backend in the configuration. Based on the virtual machine configuration, a fixed amount of large page memory is reserved to reduce the number of page table traversals. Using mlockall technology, all memory pages are locked, and a memory locking policy is enabled to prevent memory pages from being swapped to disk, ensuring real-time memory access performance. The formula is as follows: in, As a comprehensive indicator for measuring the determinism of the virtual PLC task execution environment, The types of computing resources that affect real-time performance To isolate specific CPUs on a physical server and virtual CPUs from physical CPUs through a one-to-one exclusive binding, To allocate large page memory and perform memory locking operations, Let r be the probability of unpredictable and harmful interference from resource r. This represents the overall dependence of the task on resource r. It is a single-resource deterministic factor.
[0020] When using it, refer to the content of step S2 above: PLC systems based on virtualization technology have some technical shortcomings. They fail to be deeply optimized for high real-time requirements, resulting in the virtualization platform not fully utilizing physical hardware resources, particularly in memory management. Traditional virtualization technology lacks precise resource binding between the CPU and the virtual machine, easily leading to delays in real-time task execution and affecting system stability and response speed. In memory management, the commonly used page table mapping method is inefficient and cannot guarantee real-time memory access, especially under high load, easily causing memory swapping to disk and reducing system response speed. This step, based on a virtual PLC with a real-time virtual machine, modifies system boot parameters to isolate the binding between the physical CPU and the virtual CPU and prioritizes the allocation of large page memory, which can significantly improve memory access efficiency and system real-time performance. By locking memory and optimizing memory access, efficient execution of real-time tasks is ensured, and the risk of memory swapping is reduced.
[0021] S3. Configure the SR-IOV network card virtualization function, transmit the generated virtual functions to the virtual PLC instance through PCIe pass-through, deploy the user-mode real-time protocol stack, and achieve extremely low latency and high-precision time synchronization of network I / O. Step S3 includes the following: Based on the host operating system, Intel VT-d technology is enabled in the BIOS / UEFI of the host operating system. By operating the sysfs interface, the SR-IOV network card virtualization function is enabled, allowing the network interface card to virtualize its physical resources into multiple virtual function VFs. Each virtual function VF has an independent PCIe configuration space and is regarded as a lightweight physical network card, realizing efficient segmentation and isolation of network resources. At the hardware level, based on multiple virtual function (VF) devices, the VFIO-PCI driver is unbound from the host operating system. In the libvirt configuration of the virtual machine, the virtual function VF is specified to pass through to the virtual machine via PCIe pass-through.
[0022] Step S3 also includes the following: When the virtual machine starts, the Hypervisor directly maps the resource configuration of the Virtual Function (VF) into the virtual machine, so that the VF can be recognized by the operating system of the virtual PLC instance as a standard physical network card, thus simplifying the network I / O path. Based on a virtual PLC instance, the DPDK network packet processing framework is installed. The network card is directly written to the user-space pre-allocated memory pool via DMA, and network packets are directly accessed in a polling manner. This stabilizes the network I / O latency from the kernel level of several milliseconds to less than ten microseconds, achieving extremely low latency and high-precision time synchronization for network I / O.
[0023] When using it, refer to the content of step S3 above: Currently, low-latency network I / O applications based on SR-IOV network interface card (NIC) virtualization technology, especially in high-precision time synchronization scenarios such as virtual PLCs, face problems such as poor hardware compatibility, performance bottlenecks, and insufficient driver support. This step, by enabling SR-IOV virtualization and combining it with PCIe pass-through technology, can efficiently divide physical NIC resources into multiple virtual function (VF) units, achieving efficient allocation and isolation of network resources and reducing network I / O latency to the tens of microseconds level. By using the DPDK framework to move network packet processing to user space, the performance bottleneck of kernel space is avoided, further improving the accuracy and efficiency of network I / O.
[0024] S4. The control logic program conforms to the IEC 61131-3 standard and is compiled into native machine code by the LLVM compiler to generate a dynamic shared library for the virtual PLC real-time task to load and run directly. It sets up a dual-cycle task scheduling architecture to realize the isolated execution of hard real-time control tasks and soft real-time management tasks. It monitors task execution jitter online, captures task execution deviations in real time, triggers alarms and records them when the threshold is exceeded, and supports real-time performance self-diagnosis and operation and maintenance analysis. Step S4 includes the following: The control logic program conforms to the IEC 61131-3 standard. It is compiled by the LLVM compiler to efficiently convert the high-level control logic code into native machine code and generate a native machine code dynamic shared library. The real-time operating system based on virtual PLC adopts a dual-cycle task scheduling architecture to isolate and execute hard real-time control tasks and soft real-time management tasks. For hard real-time control tasks, they are bound to a dedicated isolated virtual CPU, and a fixed short period of 1ms is set to run using sliding window technology; It operates based on a fixed short period of 1ms, reads sensor input at the beginning of each fixed period, couples local machine code dynamic shared library, and uses control signal as output; For soft real-time management tasks, a fixed long period of 10ms is set to run, which is responsible for data collection, status monitoring and log recording background management functions.
[0025] Step S4 also includes the following: Through the dual-cycle task scheduling architecture, the system can make reasonable scheduling according to the real-time requirements of different tasks, ensuring the priority execution of critical tasks and the normal operation of dual-cycle tasks. Based on the start and end of each cycle task, timestamps are aligned using a high-precision clock source, and the deviation between the actual interval of two adjacent cycles and the expected cycle is continuously calculated. Set a safety threshold. If the task execution time exceeds the worst-case execution time threshold or the deviation between the actual interval of two adjacent cycles and the expected cycle exceeds the allowable range, an alarm and safety handling procedure will be triggered immediately to achieve continuous diagnosis and protection of the real-time health status of the control system. The allowable range is exemplified by ±20% of the deviation between the actual interval and the expected interval between two adjacent cycles.
[0026] When using it, refer to the content of step S4 above: Real-time control systems based on the IEC 61131-3 standard control logic program still face technical shortcomings in hard real-time and soft real-time task scheduling, such as inaccurate task scheduling, insufficient real-time performance, task execution jitter, and poor system stability. They cannot meet the requirements of high-precision and low-latency control. In complex industrial applications, resource contention between real-time tasks and management tasks leads to excessively long system response times and even performance crashes. This step enables real-time monitoring and fault early warning of the system's health status, greatly improving the stability, real-time performance, and reliability of the control system, and meeting the needs of high-precision industrial control applications.
[0027] Reference Figure 2 As shown, a high real-time virtual PLC implementation system for wind power control includes: Data acquisition module, data binding module, time synchronization module, and data diagnostic module; The data acquisition module is used to deploy a host operating system with PREEMPT_RT real-time patching on a wind farm private cloud server, generate a Hypervisor layer with high real-time scheduling capabilities, and create a real-time virtual machine as a virtual PLC running carrier. The data binding module is electrically connected to the data acquisition module. It is used to isolate a specific CPU on the physical server and the virtual CPU of the virtual PLC instance by modifying the system boot parameters, based on the real-time virtual machine as the virtual PLC running carrier, and to allocate large page memory to the virtual PLC instance, preferably using 1GB or 2MB page specifications, and to perform memory locking operation. The time synchronization module is electrically connected to the data binding module and is used to configure the SR-IOV network card virtualization function. The generated virtual function is transmitted to the virtual PLC instance through PCIe transparent transmission, and the user-mode real-time protocol stack is deployed to achieve extremely low latency and high-precision time synchronization of network I / O. The data diagnostic module is electrically connected to the time synchronization module. It is used to compile control logic programs in accordance with the IEC 61131-3 standard into native machine code by the LLVM compiler, generating a dynamic shared library for direct loading and execution of virtual PLC real-time tasks. It sets up a dual-cycle task scheduling architecture to achieve isolated execution of hard real-time control tasks and soft real-time management tasks. It monitors task execution jitter online, captures task execution deviations in real time, triggers alarms and records them when thresholds are exceeded, and supports real-time performance self-diagnosis and operation and maintenance analysis.
[0028] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the claimed invention. The scope of protection claimed by the appended claims and their equivalents is defined.
Claims
1. A method for implementing a high real-time virtual PLC for wind power control, characterized in that, include: S1. Based on the wind farm's private cloud server, deploy a host operating system with PREEMPT_RT real-time patching, generate a Hypervisor layer with high real-time scheduling capabilities, and create a real-time virtual machine as a virtual PLC running carrier. S2. Based on a real-time virtual machine as the virtual PLC running carrier, by modifying the system boot parameters, a specific CPU on the physical server is isolated from the virtual PLC instance and the virtual CPU of the virtual PLC instance is bound to it in a one-to-one exclusive manner. Large page memory is allocated to the virtual PLC instance, with priority given to 1GB or 2MB page specifications, and memory locking operation is performed. S3. Configure the SR-IOV network card virtualization function, transmit the generated virtual functions to the virtual PLC instance through PCIe pass-through, deploy the user-mode real-time protocol stack, and achieve extremely low latency and high-precision time synchronization of network I / O. S4. The control logic program conforms to the IEC 61131-3 standard and is compiled into native machine code by the LLVM compiler to generate a dynamic shared library for direct loading and execution of virtual PLC real-time tasks. It sets up a dual-cycle task scheduling architecture to realize the isolated execution of hard real-time control tasks and soft real-time management tasks. It monitors task execution jitter online, captures task execution deviations in real time, triggers alarms and records them when the threshold is exceeded, and supports real-time performance self-diagnosis and operation and maintenance analysis.
2. The method for implementing a high real-time virtual PLC for wind power control according to claim 1, characterized in that, S1 includes: Based on the private cloud server of the wind farm, a standard Linux distribution is installed as the host operating system. The Linux distribution kernel repository is accessed to download the Linux kernel source code that matches the current host operating system kernel version. Based on the PREEMPT-RT project website, obtain the real-time patch files for the corresponding version and apply them to the kernel source code; Based on the kernel source code, the configuration is done through the `make menuconfig` command. According to the preemption model under the general settings, the default voluntary preemption or general preemption is changed to a fully preemptible kernel to ensure that the high-precision timer function is enabled. Based on the completed configuration, use the `make-jN` command to compile the kernel. After compilation, execute the module installation and kernel installation commands, update the boot configuration and restart the server. Use the `uname-a` command to confirm that the output information contains the words "PREEMPT-RT", which proves that the real-time kernel has been successfully loaded. Install QEMU-KVM and libvirt virtualization components using the system package manager; By configuring libvirt, the scheduling policy of the virtual CPU thread of the virtual machine is set to SCHED_FIFO, giving it a higher real-time priority. This ensures that the virtual CPU thread of the virtual machine can immediately preempt the ordinary thread on the host operating system, creating a real-time virtual machine as the virtual PLC running carrier. The higher real-time priority is 99 as an example.
3. The method for implementing a high real-time virtual PLC for wind power control according to claim 2, characterized in that, The real-time preemption strength expression for the virtual CPU threads of the virtual machine to immediately preempt ordinary threads on the host operating system is as follows: in, This allows virtual CPU threads in a virtual machine to immediately preempt ordinary threads on the host operating system, giving them real-time preemption strength. and As the highest real-time priority, It has the priority of a normal thread (usually 0). is the base of the natural logarithm. The actual preemption latency of the PREEMPT-RT kernel. This is the system time constant.
4. The method for implementing a high real-time virtual PLC for wind power control according to claim 3, characterized in that, S2 includes: Based on a real-time virtual machine as the virtual PLC running carrier, specific CPUs on isolated physical servers are set in the kernel boot parameters of the host operating system. Use the libvirt virtualization management tool to create real-time virtual machine instances; The cputune component binds the virtual CPUs of virtual machines to the physical CPUs, ensuring that each virtual CPU is fixedly bound to a specific CPU on an isolated physical server, thus achieving exclusive access to execution resources. Based on the host operating system, a large page memory pool is pre-allocated, and when starting a real-time virtual machine, a 1GB or 2MB page size is preferentially used as the memory backend in the configuration. By configuring the virtual machine, we ensure that a fixed amount of large page memory is reserved to reduce the number of page table traversals. We use mlockall technology to lock all memory pages and enable memory locking policies to prevent memory pages from being swapped to disk, thus ensuring real-time performance of memory access.
5. A method for implementing a high real-time virtual PLC for wind power control according to claim 4, characterized in that, The comprehensive index expression for measuring the determinism of the virtual PLC task execution environment includes: in, As a comprehensive indicator for measuring the determinism of the virtual PLC task execution environment, The types of computing resources that affect real-time performance To isolate specific CPUs on a physical server and virtual CPUs from physical CPUs through a one-to-one exclusive binding, To allocate large page memory and perform memory locking operations, Let r be the probability of unpredictable and harmful interference from resource r. The overall dependence of the task on resource r. It is a single-resource deterministic factor.
6. The method for implementing a high real-time virtual PLC for wind power control according to claim 1, characterized in that, S3 includes: Based on the host operating system, Intel VT-d technology is enabled in the BIOS / UEFI of the host operating system. By operating the sysfs interface, the SR-IOV network card virtualization function is enabled, allowing the network interface card to virtualize its physical resources into multiple virtual function VFs. Each virtual function VF has an independent PCIe configuration space and is regarded as a lightweight physical network card, realizing efficient segmentation and isolation of network resources. At the hardware level, based on multiple virtual function (VF) devices, the VFIO-PCI driver is unbound from the host operating system. In the libvirt configuration of the virtual machine, the virtual function VF is specified to pass through to the virtual machine via PCIe pass-through.
7. A method for implementing a high real-time virtual PLC for wind power control according to claim 6, characterized in that, S3 further includes: When the virtual machine starts, the Hypervisor directly maps the resource configuration of the Virtual Function (VF) into the virtual machine, so that the VF can be recognized by the operating system of the virtual PLC instance as a standard physical network card, thus simplifying the network I / O path. Based on a virtual PLC instance, the DPDK network packet processing framework is installed. The network card is directly written to the user-space pre-allocated memory pool via DMA, and network packets are directly accessed in a polling manner. This stabilizes the network I / O latency from the kernel level of several milliseconds to less than ten microseconds, achieving extremely low latency and high-precision time synchronization for network I / O.
8. A method for implementing a high real-time virtual PLC for wind power control according to claim 1, characterized in that, S4 includes: The control logic program conforms to the IEC 61131-3 standard. It is compiled by the LLVM compiler to efficiently convert the high-level control logic code into native machine code and generate a native machine code dynamic shared library. The real-time operating system based on virtual PLC adopts a dual-cycle task scheduling architecture to isolate and execute hard real-time control tasks and soft real-time management tasks. For hard real-time control tasks, they are bound to a dedicated isolated virtual CPU, and a fixed short period of 1ms is set to run using sliding window technology; It operates based on a fixed short period of 1ms, reads sensor input at the beginning of each fixed period, couples local machine code dynamic shared library, and uses control signal as output; For soft real-time management tasks, a fixed long period of 10ms is set to run, which is responsible for data collection, status monitoring and log recording background management functions.
9. A method for implementing a high real-time virtual PLC for wind power control according to claim 8, characterized in that, S4 further includes: Through the dual-cycle task scheduling architecture, the system can make reasonable scheduling according to the real-time requirements of different tasks, ensuring the priority execution of critical tasks and the normal operation of dual-cycle tasks. Based on the start and end of each cycle task, timestamps are aligned using a high-precision clock source, and the deviation between the actual interval of two adjacent cycles and the expected cycle is continuously calculated. Set a safety threshold. If the task execution time exceeds the worst-case execution time threshold or the deviation between the actual interval of two adjacent cycles and the expected cycle exceeds the allowable range, an alarm and safety handling procedure will be triggered immediately to achieve continuous diagnosis and protection of the real-time health status of the control system. The allowable range is exemplified by ±20% of the deviation between the actual interval and the expected interval between two adjacent cycles.
10. A high real-time virtual PLC implementation system for wind power control, characterized in that, To implement any one of claims 1-9, the method for implementing a high real-time virtual PLC for wind power control includes: Data acquisition module, data binding module, time synchronization module, and data diagnostic module; The data acquisition module is used to deploy a host operating system with PREEMPT_RT real-time patching on a wind farm private cloud server, generate a Hypervisor layer with high real-time scheduling capabilities, and create a real-time virtual machine as a virtual PLC running carrier. The data binding module is electrically connected to the data acquisition module. It is used to isolate a specific CPU on the physical server and the virtual CPU of the virtual PLC instance by modifying the system boot parameters, based on the real-time virtual machine as the virtual PLC running carrier, and to allocate large page memory to the virtual PLC instance, preferably using 1GB or 2MB page specifications, and to perform memory locking operation. The time synchronization module is electrically connected to the data binding module and is used to configure the SR-IOV network card virtualization function. The generated virtual function is transmitted to the virtual PLC instance through PCIe transparent transmission, and the user-mode real-time protocol stack is deployed to achieve extremely low latency and high-precision time synchronization of network I / O. The data diagnostic module is electrically connected to the time synchronization module. It is used to compile control logic programs in accordance with the IEC 61131-3 standard into native machine code by the LLVM compiler, generating a dynamic shared library for direct loading and execution of virtual PLC real-time tasks. It sets up a dual-cycle task scheduling architecture to achieve isolated execution of hard real-time control tasks and soft real-time management tasks. It monitors task execution jitter online, captures task execution deviations in real time, triggers alarms and records them when thresholds are exceeded, and supports real-time performance self-diagnosis and operation and maintenance analysis.