An IO resource virtualization dynamic allocation method, device and computer program product of a switch cabinet monitoring terminal

CN122946137APending Publication Date: 2026-10-20SHENZHEN POWER SUPPLY BUREAU
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611131820.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-29
Publication Date
2026-10-20

AI Technical Summary

Technical Problem

(1)传感器替换困难:开关柜内传感器种类繁多,涵盖热电偶、电阻温度检测器(RTD)、电流互感器/电压互感器(CT/VT)、超声波传感器、特高频传感器等不同测量原理

Benefits of technology

[0022]本发明带来的有益效果在于:本发明通过软件定义IO虚拟化架构与动态资源调度机制,相较于传统静态IO分配方案,在资源利用效率、运维便捷性、响应实时性及运行稳定性方面均带来显著的有益效果。通过将多类型物理IO资源抽象为可灵活调度的虚拟IO设备,结合复合优先级评分的动态分配机制,实现IO资源的按需共享与复用,可将IO平均利用率由传统方案的约40%提升至90%以上;搭配宏周期全局优化、微周期紧急抢占的双时间尺度调度架构,在保障系统整体资源最优配置的同时,有效降低高优先级监测业务的响应延迟。依托传感器描述符表的解耦映射与标准化信号变换链,传感器更换无需硬件改造与重新布线,仅需更新对应表项即可完成适配,将更换调试时长从小时级压缩至分钟级,大幅降低现场维护成本。此外,本发明通过非线性防饥饿补偿机制保障低优先级业务的服务公平性,避免资源饥饿;借助设备关联调度约束确保多路同步采样的时刻偏差可控,满足电力系统高精度同步采集的应用需求。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure SMS_3
    Figure SMS_3
  • Figure SMS_15
    Figure SMS_15
Patent Text Reader

Abstract

This invention discloses a method, device, and computer program product for the virtualized dynamic allocation of IO resources in a switchgear monitoring terminal. The method includes: creating virtual IO devices corresponding one-to-one with each monitoring service instance, establishing a mapping relationship between virtual IO and physical IO resources; extracting the IO demand characteristics and operating status information of the virtual IO devices, calculating scheduling priorities based on composite priority scoring, dynamically allocating physical IO resources according to priority, dynamically updating data routes using a publish-subscribe object bus exchange engine, and adopting a dual-time-scale scheduling architecture to balance global optimization and emergency response; and achieving decoupling mapping between sensors and virtual IO through a sensor descriptor table, where sensor replacement only requires updating table entries to complete the adaptation. This invention significantly improves IO resource utilization, shortens sensor maintenance cycles, reduces response latency for high-priority services, and ensures fairness in service operation and synchronous sampling accuracy, making it suitable for various online monitoring scenarios for power distribution equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power equipment monitoring technology, specifically to a method, device, and computer program product for the virtualization and dynamic allocation of I / O resources in a switchgear monitoring terminal. Background Technology

[0002] 10kV switchgear is a core node in the distribution network, integrating various sensors such as temperature, humidity, partial discharge, current, voltage, and mechanical characteristics to achieve comprehensive equipment status perception and fault early warning. With the continuous improvement of monitoring accuracy and real-time requirements in smart distribution networks, switchgear monitoring terminals need to simultaneously connect to multiple heterogeneous sensors and flexibly respond to dynamic changes in monitoring business needs. This poses a significant challenge to the unified management and dynamic scheduling of monitoring terminal I / O resources.

[0003] In traditional solutions, monitoring terminals typically employ a hard-coded method that maps fixed I / O pins to fixed sensors. This method mainly suffers from the following three technical problems: (1) Difficulty in replacing sensors: There are many types of sensors in the switch cabinet, covering thermocouples, resistance temperature detectors (RTDs), current transformers / voltage transformers (CT / VTs), ultrasonic sensors, ultra-high frequency sensors, and other sensors with different measurement principles. When a sensor needs to be replaced due to damage or technical upgrades, its output signal type, amplitude, frequency, and interface protocol may all change, making the hardware interface of the original monitoring terminal incompatible with the new sensor. Maintenance personnel have to replace the entire monitoring terminal motherboard or rewire, resulting in long power outage times and high maintenance costs.

[0004] (2) Low IO resource utilization: Monitoring terminals are typically equipped with 8 high-speed analog-to-digital converter (ADC) sampling channels, multiple general purpose input / output (GPIO) channels, and multiple serial communication interfaces (such as UART, SPI, I2C) and other IO hardware resources. In actual operation, the sampling timing and communication requirements of different monitoring services are different. Under the hard-coded method, IO resources are only used in the pre-allocated time period, with an average utilization rate of only about 40%, and a large amount of sampling and interface resources are wasted during idle time periods.

[0005] (3) Unable to dynamically adjust IO bandwidth: When a monitoring service enters an abnormal state (for example, the sampling frequency needs to be increased during a partial discharge alarm) and urgently needs more IO throughput bandwidth, the fixed IO allocation mechanism cannot dynamically transfer the IO resources occupied by the idle service to the emergency service, resulting in insufficient sampling resolution during critical events and affecting the accuracy of fault diagnosis.

[0006] To address the above issues, the industry has proposed several improvement solutions, but each still has significant limitations: (1) The IEC 61499 standard defines a function block model for distributed industrial process measurement and control systems, and its event-driven mechanism realizes event transmission and execution control between function blocks. However, this standard focuses on the function orchestration of the control application layer and does not involve the virtualization and dynamic allocation of underlying IO hardware resources.

[0007] (2) Single Root Input / Output Virtualization (SR-IOV) technology is mainly used for efficient sharing of PCIe bus devices in data center servers. It cannot be directly applied to fine-grained IO resources such as GPIO, ADC, and UART in embedded platforms such as microcontrollers (MCUs) or digital signal processors (DSPs).

[0008] (3) The embedded hardware abstraction layer (HAL) provides a unified hardware driver interface for upper-layer software, aiming to shield the hardware differences between different microcontrollers. However, its resource allocation is usually statically determined at compile time and does not have the ability to dynamically reallocate I / O resources at runtime according to business needs.

[0009] (4) The Linux kernel's I / O scheduler is mainly oriented towards I / O request scheduling for block devices, and optimizes disk access performance by merging and sorting requests. This mechanism lacks a unified abstraction for various heterogeneous I / O types such as ADC sampling, GPIO interrupts, and serial communication, and does not provide a scheduling mechanism to avoid I / O starvation for real-time monitoring tasks based on business priorities.

[0010] In summary, the aforementioned solutions either cater to different application scenarios or only address partial problems, failing to provide a complete method for unified virtualization abstraction of heterogeneous I / O resources in switchgear monitoring terminals and for dynamic allocation and bandwidth transfer of I / O resources based on service priorities. This severely restricts performance improvements in switchgear status monitoring systems regarding sensor plug-and-play functionality, resource utilization efficiency, and emergency event response. Summary of the Invention

[0011] The technical problem to be solved by the present invention is to provide a method, device and computer program product for the virtualization and dynamic allocation of IO resources in a switch cabinet monitoring terminal, so as to improve the utilization rate of IO resources and shorten the sensor maintenance cycle.

[0012] To address the aforementioned technical problems, this invention provides a method for dynamic allocation of I / O resource virtualization in a switchgear monitoring terminal, comprising: Step S1: Create virtual IO devices corresponding one-to-one with each monitoring service instance in the monitoring terminal, and establish an initial mapping relationship between each virtual IO device and the physical IO resources of the monitoring terminal. Step S2: Obtain the IO demand characteristics and operating status information of each virtual IO device, and calculate the IO resource scheduling priority corresponding to each virtual IO device based on the IO demand characteristics and operating status information. Step S3: Allocate physical I / O resources to each virtual I / O device according to the scheduling priority, update the mapping relationship, and route the data collected by the physical I / O resources to the corresponding virtual I / O device according to the updated mapping relationship; Step S4: Pre-build and maintain a sensor descriptor table. The sensor descriptor table stores the configurable correspondence between each virtual I / O device and the physical sensor, as well as the signal conversion parameters. When the physical sensor is replaced, the correspondence in the sensor descriptor table is updated to match the newly connected physical sensor with the existing virtual I / O device. The original signal collected by the physical sensor is converted and processed according to the signal conversion parameters in the sensor descriptor table.

[0013] Preferably, in step S3, the data collected from physical I / O resources is routed to the corresponding virtual I / O devices through an object bus exchange engine based on a publish-subscribe model; the object bus exchange engine creates or updates the publish entries for each virtual I / O device and the subscription entries for each physical I / O resource according to the updated mapping relationship, so as to establish a data transmission path.

[0014] Preferably, the method employs a dual-time-scale scheduling architecture to perform resource allocation and route updates: The first preset period is used as the macro scheduling period. In each macro scheduling period, global IO demand feature extraction, scheduling priority calculation, physical IO resource allocation and mapping relationship update are performed once. The second preset period is used as the micro-scheduling period, which is shorter than the first preset period. In each micro-scheduling period, urgent I / O requests are detected. When the scheduling priority of the detected urgent I / O request is higher than the minimum priority preset multiple of the currently allocated resources, resource preemption is triggered and the mapping relationship and data routing are updated in real time.

[0015] Preferably, in step S2, the IO resource scheduling priority of each virtual IO device is calculated by a composite priority scoring function, which includes at least an urgency attenuation factor, a resource efficiency factor, an anti-starvation compensation factor, and a device association factor. The urgency decay factor is used to characterize the urgency of the deadline for the task corresponding to the virtual I / O device; The resource efficiency factor is used to characterize the efficiency of virtual I / O devices in utilizing allocated bandwidth resources. The anti-starvation compensation factor is used to prioritize virtual I / O devices that have not received I / O services for a long time. The device association factor is used to coordinate and prioritize associated virtual I / O devices that have synchronous sampling dependencies.

[0016] Preferably, step S2 specifically includes: Extract multi-dimensional IO demand feature vectors for each virtual IO device. The IO demand feature vectors include at least five dimensions: bandwidth demand, latency sensitivity, jitter tolerance, sampling periodicity, and burstiness. Calculate the degree of demand conflict between any two virtual I / O devices in each dimension, and dynamically calculate the weight coefficient of each dimension based on the overall demand difference ratio of each dimension; Based on the aforementioned dimension weight coefficients, and combined with the urgency decay factor, resource efficiency factor, anti-starvation compensation factor, and device association factor, a composite priority score for each virtual I / O device is calculated.

[0017] Preferably, in step S1, the initial mapping relationship is a bidirectional hash mapping structure, including a first mapping table and a second mapping table: The first mapping table is used to map the unique identifier of a virtual I / O device to the corresponding list of available physical I / O modules; The second mapping table is used to map the unique identifier of the physical I / O module to the identifier of the currently bound virtual I / O device; The monitoring terminal also maintains a device status table, which records the current mapping relationship, IO bandwidth quota, and resource utilization statistics of each virtual IO device.

[0018] Preferably, in step S3, when the original routing table entry is replaced due to resource allocation update, an atomic switching operation is used to update the routing rules: within the clock cycle of the same object bus switching engine, the backup of the old routing table entry, the writing of the new routing table entry, and the switching of the routing table pointer are completed synchronously to ensure that there is no data loss or routing glitches during the routing switching process.

[0019] Preferably, step S4, which involves converting the raw signal acquired by the physical sensor, specifically includes: Based on the proportional coefficient and offset stored in the sensor descriptor table, the original acquired signal is linearly range-transformed to obtain the engineering value of the corresponding physical quantity. After normalizing the engineering values ​​to a preset numerical range, they are output to the corresponding monitoring service instance.

[0020] The present invention also provides a device for dynamic allocation of I / O resource virtualization for a switch cabinet monitoring terminal, comprising: One or more processors; Memory; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more applications are configured to execute the I / O resource virtualization dynamic allocation method of the switch cabinet monitoring terminal.

[0021] The present invention also provides a computer program product, including computer instructions, which instruct a computer device to perform operations corresponding to the I / O resource virtualization dynamic allocation method of the switch cabinet monitoring terminal.

[0022] The beneficial effects of this invention are as follows: By employing a software-defined I / O virtualization architecture and a dynamic resource scheduling mechanism, this invention offers significant advantages over traditional static I / O allocation schemes in terms of resource utilization efficiency, ease of operation and maintenance, real-time response, and operational stability. By abstracting various types of physical I / O resources into flexibly schedulable virtual I / O devices, combined with a dynamic allocation mechanism based on composite priority scoring, on-demand sharing and reuse of I / O resources are achieved, increasing the average I / O utilization rate from approximately 40% in traditional schemes to over 90%. Furthermore, the dual-timescale scheduling architecture, featuring macro-cycle global optimization and micro-cycle emergency preemption, effectively reduces the response latency of high-priority monitoring services while ensuring optimal overall system resource allocation. Relying on the decoupled mapping of sensor descriptor tables and standardized signal transformation chains, sensor replacement requires no hardware modification or rewiring; only updating the corresponding table entries is needed for adaptation, reducing replacement and debugging time from hours to minutes, significantly lowering on-site maintenance costs. Furthermore, this invention ensures the service fairness of low-priority services through a nonlinear anti-starvation compensation mechanism, avoiding resource starvation; and ensures that the time deviation of multi-channel synchronous sampling is controllable by using equipment-related scheduling constraints, meeting the application requirements of high-precision synchronous data acquisition in power systems. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0024] Figure 1 This is a flowchart illustrating a method for dynamically allocating virtualized IO resources in a switch cabinet monitoring terminal according to an embodiment of the present invention. Detailed Implementation

[0025] The following description of the embodiments is taken with reference to the accompanying drawings, which illustrate specific embodiments in which the invention can be implemented.

[0026] Please refer to Figure 1As shown, Embodiment 1 of the present invention provides a method for dynamic allocation of I / O resource virtualization in a switch cabinet monitoring terminal, comprising: Step S1: Create virtual IO devices corresponding one-to-one with each monitoring service instance in the monitoring terminal, and establish an initial mapping relationship between each virtual IO device and the physical IO resources of the monitoring terminal. Step S2: Obtain the IO demand characteristics and operating status information of each virtual IO device, and calculate the IO resource scheduling priority corresponding to each virtual IO device based on the IO demand characteristics and operating status information. Step S3: Allocate physical I / O resources to each virtual I / O device according to the scheduling priority, update the mapping relationship, and route the data collected by the physical I / O resources to the corresponding virtual I / O device according to the updated mapping relationship; Step S4: Pre-build and maintain a sensor descriptor table. The sensor descriptor table stores the configurable correspondence between each virtual I / O device and the physical sensor, as well as the signal conversion parameters. When the physical sensor is replaced, the correspondence in the sensor descriptor table is updated to match the newly connected physical sensor with the existing virtual I / O device. The original signal collected by the physical sensor is converted and processed according to the signal conversion parameters in the sensor descriptor table.

[0027] This embodiment applies to an online monitoring terminal for a 10kV switchgear. The monitoring terminal has multiple built-in physical I / O resources, including but not limited to an analog-to-digital converter (ADC), a general-purpose input / output (GPIO) module, an I2C interface module, and a UART interface module, for connecting various status monitoring sensors within the switchgear. The processor of the monitoring terminal runs a virtual machine monitoring program and multiple switchgear status monitoring service instances, such as busbar temperature monitoring, partial discharge monitoring, switch mechanical characteristic monitoring, and cable joint temperature monitoring. The specific execution process is described below.

[0028] Step S1 is used for virtualization environment initialization and virtual I / O device creation.

[0029] Specifically, after the monitoring terminal powers on, it runs a Virtual Machine Monitor (VMM) and reads a pre-stored configuration file, which defines a list of all monitoring services currently loaded by the terminal. Based on this list, the VMM creates a corresponding virtual I / O device instance for each monitoring service instance. The virtual I / O device includes one or more of virtual ADC, virtual GPIO, virtual I2C, and virtual UART to match the interface requirements of the corresponding monitoring service.

[0030] In this embodiment, a globally unique Virtual Device Identifier (VID) is assigned to each virtual I / O device, and a device status table is maintained within the virtual machine monitoring program. This device status table records the current mapping relationship, I / O bandwidth quota, utilization statistics, and other status information for each virtual I / O device. Simultaneously, the table pool and memory pool of the publish-subscribe-based Object Bus Switch (OBS) engine are initialized, and a bidirectional hash mapping table is constructed. V2P_Map: Maps the virtual I / O device identifier (VID) to a list of physical I / O module identifiers that it can call; P2V_Map: Maps each physical I / O module identifier (MID) to the currently bound virtual I / O device identifier (VID).

[0031] The initial mapping relationship between each virtual I / O device and physical I / O resources is established through the bidirectional mapping table described above.

[0032] Step S2 is used for extracting virtual I / O device demand characteristics and calculating scheduling priority.

[0033] Specifically, within each global scheduling cycle, the hypervisor obtains the IO demand characteristics and running status information of each virtual IO device, and calculates the IO resource scheduling priority of each virtual IO device.

[0034] In this embodiment, for each virtual I / O device At any moment Extracting the five-dimensional I / O requirement feature vector:

[0035] in, This represents the I / O bandwidth requirement component, in Mbps. This is the delay sensitivity component, in units of ; This is the jitter tolerance component, in units of ; For sampling periodic components, the unit is ; For bursty components, the unit is Mbps.

[0036] Based on the aforementioned feature vectors, an IO demand conflict tensor is constructed to quantify any two virtual IO devices. and In dimensions Degree of conflict of needs:

[0037] in, Use extremely small positive numbers to prevent the denominator from being zero; For equipment In dimensions The eigencomponent values ​​on; The maximum value for all devices in this dimension; conflict tensor The value range is [0,1]. The closer it is to 0, the closer the two devices are to each other in terms of their required characteristics in the corresponding dimension.

[0038] The weight of each dimension is dynamically calculated based on the proportion of the total difference in demand for all devices across all dimensions to the total difference in demand across all dimensions:

[0039] in, The total number of virtual I / O devices. For dimension The weight.

[0040] In this embodiment, the four weight coefficients in the composite priority scoring function , , , These correspond to the urgency attenuation factor, resource efficiency factor, starvation prevention compensation factor, and equipment correlation factor, respectively, and satisfy the following conditions: This embodiment takes , , , .

[0041] This embodiment uses a composite priority scoring function. Calculate the scheduling priority of each virtual I / O device; the higher the score, the higher the priority of the corresponding virtual I / O device. At any moment The higher the priority of receiving IO services, the better.

[0042] in, For bandwidth normalization mapping function, ∈(0,1] is the mapping exponent. In this embodiment, , Mbps, when When the speeds are 2.0Mbps, 0.5Mbps, and 0.1Mbps respectively, the corresponding speeds are... The values ​​are 1.0, 0.8, and 0.5 respectively.

[0043] The scoring factors are defined as follows: (1) Urgency attenuation factor Reflects virtual I / O devices At any moment The urgency of a task increases as it approaches the deadline, and is calculated as follows:

[0044] in, The attenuation coefficient is... The deadline for the task. This represents the time the task has been executed.

[0045] (2) Resource efficiency factor The following method measures the actual efficiency of virtual I / O devices in utilizing allocated bandwidth:

[0046] in, For virtual I / O devices At any moment The actual bandwidth used. For virtual I / O devices At any moment The allocated bandwidth, ∈(0,1] is the efficiency index.

[0047] (3) Anti-hunger compensation factor : By using the hunger depth, non-linear compensation is applied to devices that have not received I / O services for a long time to avoid resource starvation.

[0048] First, calculate the hunger depth:

[0049] in, For the depth of hunger, For equipment The last time I / O service was received, .

[0050] The method for calculating the anti-hunger compensation factor is as follows:

[0051] in, Compensation coefficient The hunger threshold is used; a cubic nonlinear function is employed to ensure that when the hunger depth far exceeds the threshold ( When this happens, the level of compensation increases rapidly.

[0052] (4) Equipment correlation factor This ensures that associated devices with synchronous sampling dependencies receive coordinated allocation, applicable to scenarios such as three-phase voltage / current synchronous sampling. The calculation method is as follows:

[0053] in, To be compatible with equipment The number of devices with synchronous sampling dependencies. This represents the total number of virtual I / O devices.

[0054] Step S3 is used for dynamic allocation of physical I / O resources and data routing updates.

[0055] Specifically, the hypervisor scores all virtual I / O devices according to composite priority. The virtual I / O devices are sorted from highest to lowest resource density, and the physical I / O module's channel and bandwidth resources are allocated sequentially, generating the resource allocation decision table AllocTable={(VID, MID, channel_mask, alloc_bw)} for this cycle. This allocation decision table contains fields such as virtual device identifier (VID), physical I / O module identifier (MID), channel mask (channel_mask), and allocated bandwidth (alloc_bw), updating the mapping relationship between virtual I / O devices and physical I / O resources.

[0056] Based on the updated mapping relationship, the data collected from physical I / O resources is routed to the corresponding virtual I / O devices through the publish-subscribe mechanism of the OBS switching engine. The routing table update process specifically includes: Create / Update Pub Table: Creates or updates a Pub Table entry for each Virtual I / O Device VID. The entry contains fields such as entry identifier, data type, QoS level, and destination mask, enabling the data corresponding to the Virtual I / O Device to be published to the OBS switching network. Subscription table update (Create / Update Sub Table): Creates or updates a subscription table (Sub Table) entry for each physical IO module MID. The table entry contains fields such as subscription entry identifier, publisher VID, action type, and priority, enabling the physical IO module to subscribe to the data stream corresponding to the virtual IO device assigned to it; Atomic handover: For routing table entries that are replaced due to resource scheduling, Match-Action atomic handover operations are used to update forwarding rules. That is, within the same OBS clock cycle, the backup of the old entry, the writing of the new entry, and the switching of the routing table pointer are completed atomically, ensuring that no data is lost during the handover process and no routing glitches are generated.

[0057] This embodiment employs a dual-time-scale scheduling architecture to execute the above allocation and routing update process: Macro scheduling cycle ms: Perform a global optimization calculation once in each macro cycle, including IO demand feature extraction, composite priority scoring, allocation decision generation and full update of OBS routing table; within a single macro cycle, the bandwidth allocation of all virtual IO devices remains stable; Micro-schedule cycle ms: In each micro-cycle, detect urgent I / O requests (EIR). When a high-priority urgent I / O request is detected, perform a preemption judgment: if the composite priority score of the new request is more than 1.5 times that of the current lowest priority allocator, resource preemption is triggered, the resource allocation decision is updated immediately, and an OBS atomic switch is performed to ensure low-latency response for high-priority services.

[0058] Step S4 is used for sensor decoupling mapping and signal conversion processing. Specifically, a Sensor Descriptor Table (SDT) is pre-built and maintained to decouple the hardware and software of virtual I / O devices from physical sensors. Each record in the SDT contains fields such as Virtual Device Identifier (VID), Sensor Type (Sensor_Type), Signal Type (Signal_Type), Scale Factor (Scale_Factor), Offset, and Unit, storing the configurable correspondence between each virtual I / O device and physical sensor, as well as signal conversion parameters.

[0059] When a physical sensor is replaced, there is no need to modify the hardware wiring or the upper-layer monitoring business code. Only the corresponding virtual device entry in the sensor descriptor table needs to be updated, and parameters such as sensor type, proportional coefficient, and offset need to be modified. This will enable the newly connected physical sensor to be matched with the existing virtual IO device, shortening the sensor replacement and debugging time.

[0060] In this embodiment, the conversion of the original sensor signal to a standardized signal is completed through a signal transformation chain, specifically including: Range linear transformation: Converts the raw voltage value acquired by the ADC into the corresponding engineering value. The calculation method is as follows:

[0061] in, The proportional coefficient recorded in the SDT table entry. The raw voltage value collected by the physical I / O module. The offset recorded in the SDT table entry.

[0062] Normalization: The project values ​​are normalized to the [0,1] range and output to the corresponding monitoring business instance for unified processing. The calculation method is as follows:

[0063] in, The engineering value after linear transformation. and These are the lower and upper bounds of the range of this type of physical quantity, respectively.

[0064] The invention will now be described in further detail with reference to specific examples.

[0065] Example 1: Dynamic allocation of IO resources for multiple services on a single terminal.

[0066] This example uses a typical 10kV switchgear monitoring terminal as an example. The hardware adopts an ARM Cortex-A7 processor with a main frequency of 480MHz, and is configured with 8 12-bit ADC sampling channels, multiple GPIOs, 2 UARTs, 1 I2C, 2MB of internal Flash, and 1MB of SRAM.

[0067] The monitoring terminal runs the following monitoring services (APP): b1 – Insulation monitoring (insulation resistance, dielectric loss angle, requiring simultaneous sampling by 2 ADCs); b2 – Temperature monitoring (contact temperature, ambient temperature, requiring polling sampling by 4 ADCs); b3 – Mechanical characteristic monitoring (closing and opening speed, switching angle, requiring 2 ADCs + GPIO interrupts); b4 – Partial discharge monitoring (TEV, ultrasonic, requiring high-speed sampling by 2 ADCs); b5 – CT current monitoring (three-phase current, requiring simultaneous sampling by 3 ADCs); b6 – Environmental control (humidity, water immersion, requiring 2 ADCs + 1 I2C). These 6 monitoring services require a total of 15 ADC channels, but the hardware only provides 8 ADC channels, resulting in a resource contention ratio of 15:8 = 1.875. Under traditional hard-coding schemes, only some services can be abandoned or the sampling frequency reduced, making it impossible to achieve simultaneous operation of all services.

[0068] After the terminal powers on, the VMM starts and creates virtual I / O device instances for six monitoring services: b1 corresponds to vADC_1 and vADC_2; b2 corresponds to vADC_3, vADC_4, vADC_5, and vADC_6; b3 corresponds to vADC_7, vADC_8, vGPIO_1, and vGPIO_2; b4 corresponds to vADC_9 and vADC_10; b5 corresponds to vADC_11, vADC_12, and vADC_13; and b6 corresponds to vADC_14, vADC_15, and vI2C_1. A total of 15 virtual ADCs, 3 virtual GPIOs, and 1 virtual I2C are created, totaling 19 virtual I / O device instances. Simultaneously, the OBS switching engine's Table Pool and Memory Pool are initialized. The V2P_Map and P2V_Map bidirectional hash mapping tables are constructed. For example, the V2P_Map mapping of vADC_1 is: VID=0x1001-MID=0x01, channels=[0,1,2,3,4,5,6,7], which means that vADC_1 can use any channel of the physical ADC module MID=0x01.

[0069] Within a certain macro-scheduling cycle, extract the five-dimensional IO demand feature vectors of all 15 virtual ADC devices. Taking the three most representative groups as examples: vADC_1 (insulation monitoring): F=[B=0.5Mbps, L=100us, J=50us, P=200ms, U=0.1Mbps]; vADC_4 (temperature monitoring): F=[B=0.1Mbps, L=1000us, J=200us, P=1000ms, U=0.05Mbps]; vADC_9 (partial discharge monitoring, under alarm state): F=[B=2.0Mbps, L=10us, J=5us, P=10ms, U=1.5Mbps]. Calculate the weights of each dimension: After calculation, , , , , Calculate the conflict tensor matrix, for example... (Medium-level conflict) (High conflict).

[0070] Assuming the parameter is set to , , , , , , , Taking three typical devices as an example for calculation: vADC_9 (Partial Discharge Alarm Status): Suppose the current ms, ,but ; ; Suppose you have just received the service. ; .

[0071] calculate:

[0072] .

[0073] vADC_1 (Insulation Monitoring): , 71, 0.5, , calculate: .

[0074] vADC_4 (Temperature Monitoring): , , , , calculate: .

[0075] After sorting, vADC_9 receives the highest priority and is allocated physical ADC channels 0 and 1 first. An AllocTable is generated after the sequential allocation is complete.

[0076] The AllocTable is converted into an OBS routing table update. For example, to allocate physical ADC channel 0 (MID=0x01, channel_mask=0x01) to vADC_9 (VID=0x1009), a Pub entry is created: Entry_ID=0x1009, Data_Type=ADC_SAMPLE, QoS_Level=PRIORITY_HIGH, Dest_Mask=0x0001. A Sub entry is created: Sub_Entry_ID=0x2001, Pub_VID=0x1009, Action_Type=ADC_READ_CH0, Priority=10. If this allocation needs to preempt channel 0 originally occupied by vADC_4, then in the Match-Action atomic switch operation: back up the old entry (0x2001) -> write the new entry (0x2001) -> switch the routing table pointer. The entire process is completed within a single OBS clock cycle (10us).

[0077] Construct an SDT record for vADC_1 (insulation resistance measurement): VID=0x1001, Sensor_Type=RTD, Signal_Type=ANALOG_0_5V, , Unit .

[0078] Scale Transform: .

[0079] Normalization Mapping will Map [0,5] to the normalized interval [0,1]. Macro scheduling cycle Within milliseconds, global I / O resource optimization calculations and OBS routing table updates are performed. (Micro-scheduling cycle) Within ms, when a change in the partial discharge alarm status of b4 is detected, the priority of vADC_9 jumps from 0.3 to 0.745, which is 1.47 times that of the current lowest priority allocator (vADC_4, P=0.505), and close to the 1.5 times preemption threshold. If the P value of vADC_4 further decreases in subsequent microcycles, preemption will be triggered.

[0080] This invention can be widely applied in the fields of power distribution monitoring and industrial Internet of Things, and is especially suitable for edge monitoring and data acquisition scenarios where multiple heterogeneous sensors are accessed and multiple services have different real-time requirements.

[0081] In online monitoring scenarios for 10kV / 35kV distribution switchgear, intelligent monitoring terminals need to simultaneously connect to various heterogeneous sensors, such as those for temperature, humidity, partial discharge, current, voltage, and mechanical characteristics. The sampling frequency and real-time requirements of different monitoring services vary significantly. This invention utilizes a software-defined I / O virtualization architecture to abstract physical I / O resources such as ADC, GPIO, UART, and I2C into virtual I / O devices. Based on a composite priority scoring mechanism, it achieves dynamic allocation and preemption of I / O resources, supporting the simultaneous operation of multiple monitoring services such as insulation monitoring, partial discharge monitoring, temperature monitoring, and current monitoring on a single terminal, effectively improving the overall utilization rate of physical I / O resources.

[0082] In intelligent monitoring terminals for various power distribution equipment such as ring main units, distribution cabinets, and prefabricated substations, the types and quantities of sensors often vary significantly depending on the equipment model and configuration. This leads to frequent maintenance needs for sensor replacement and model upgrades due to damage. This invention achieves decoupling mapping between virtual I / O devices and physical sensors through a sensor descriptor table. When a sensor is damaged, replaced, or upgraded, only the corresponding entry in the sensor descriptor table needs to be updated to complete the adaptation, without replacing the terminal hardware motherboard or readjusting the wiring. This significantly shortens the sensor replacement and debugging cycle.

[0083] In centralized monitoring systems for substation auxiliary equipment, multiple monitoring terminals often need to synchronously sample multiple physical quantities of the same electrical equipment, such as synchronous measurement of three-phase voltage and three-phase current. This invention, through a priority scheduling mechanism based on device association factors, ensures that virtual I / O devices with synchronous sampling dependencies receive coordinated resource allocation. Simultaneously, relying on the data routing capabilities of the object bus switching engine, it enables cross-terminal I / O resource sharing and load balancing, meeting the coordinated sampling requirements of substation-level centralized monitoring.

[0084] In multi-sensor fusion platforms such as industrial IoT gateways and edge computing nodes, it is necessary to interface with various heterogeneous field devices such as sensors, PLCs, and actuators. The real-time and bandwidth requirements of different business data streams vary significantly. The object-level data routing mechanism of this invention can support cross-protocol data exchange and dynamic scheduling. Combined with a dual-time-scale scheduling architecture, it can ensure real-time response to urgent business while optimizing global resources, adapting to the diverse data acquisition and transmission needs in industrial IoT scenarios.

[0085] Corresponding to the method for dynamic allocation of I / O resources virtualization in a switchgear monitoring terminal in Embodiment 1 of the present invention, Embodiment 2 of the present invention also provides a device for dynamic allocation of I / O resources virtualization in a switchgear monitoring terminal, comprising: One or more processors; Memory; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more applications are configured to execute the I / O resource virtualization dynamic allocation method of the switch cabinet monitoring terminal.

[0086] Corresponding to the method for dynamic allocation of I / O resources virtualization in a switchgear monitoring terminal in Embodiment 1 of the present invention, Embodiment 3 of the present invention also provides a computer program product, including computer instructions, which instruct a computer device to perform the operation corresponding to the method for dynamic allocation of I / O resources virtualization in the switchgear monitoring terminal.

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

[0088] The memory mainly includes a program storage area and a data storage area. The program storage area can store the operating system, applications required for at least one function, etc., while the data storage area can store related data, etc. Furthermore, the memory can be a high-speed random access memory, or a non-volatile memory, such as a plug-in hard drive, a SmartMedia Card (SMC), a Secure Digital (SD) card, and a Flash Card, or other volatile solid-state storage devices.

[0089] It should be noted that the above-mentioned devices may include, but are not limited to, processors and memory, as will be understood by those skilled in the art.

[0090] For the working principle and process of the above embodiments, please refer to the description of Embodiment 1 of the present invention, which will not be repeated here.

[0091] Compared with existing technologies, this invention has the following significant advantages: Through a software-defined I / O virtualization architecture and dynamic resource scheduling mechanism, this invention offers significant benefits in terms of resource utilization efficiency, ease of operation and maintenance, real-time response, and operational stability compared to traditional static I / O allocation schemes. By abstracting various types of physical I / O resources into flexibly schedulable virtual I / O devices, combined with a dynamic allocation mechanism based on composite priority scoring, on-demand sharing and reuse of I / O resources are achieved, increasing the average I / O utilization rate from approximately 40% in traditional schemes to over 90%. Coupled with a dual-timescale scheduling architecture of macro-cycle global optimization and micro-cycle emergency preemption, it effectively reduces the response latency of high-priority monitoring services while ensuring optimal overall system resource allocation. Relying on the decoupled mapping of sensor descriptor tables and standardized signal transformation chains, sensor replacement requires no hardware modification or rewiring; only updating the corresponding table entries is needed for adaptation, reducing replacement and debugging time from hours to minutes, significantly lowering on-site maintenance costs. Furthermore, this invention ensures the service fairness of low-priority services through a nonlinear anti-starvation compensation mechanism, avoiding resource starvation; and ensures that the time deviation of multi-channel synchronous sampling is controllable by using equipment-related scheduling constraints, meeting the application requirements of high-precision synchronous data acquisition in power systems.

[0092] The above description is merely a preferred embodiment of the present invention and should not be construed as limiting the scope of the invention. Therefore, any equivalent variations made in accordance with the claims of the present invention are still within the scope of the present invention.

Claims

1. A method for dynamic allocation of I / O resource virtualization in a switchgear monitoring terminal, characterized in that, include: Step S1: Create virtual IO devices corresponding one-to-one with each monitoring service instance in the monitoring terminal, and establish an initial mapping relationship between each virtual IO device and the physical IO resources of the monitoring terminal. Step S2: Obtain the IO demand characteristics and operating status information of each virtual IO device, and calculate the IO resource scheduling priority corresponding to each virtual IO device based on the IO demand characteristics and operating status information. Step S3: Allocate physical I / O resources to each virtual I / O device according to the scheduling priority, update the mapping relationship, and route the data collected by the physical I / O resources to the corresponding virtual I / O device according to the updated mapping relationship; Step S4: Pre-build and maintain a sensor descriptor table. The sensor descriptor table stores the configurable correspondence between each virtual I / O device and the physical sensor, as well as the signal conversion parameters. When the physical sensor is replaced, the correspondence in the sensor descriptor table is updated to match the newly connected physical sensor with the existing virtual I / O device. The original signal collected by the physical sensor is converted and processed according to the signal conversion parameters in the sensor descriptor table.

2. The method according to claim 1, characterized in that, In step S3, the data collected from physical I / O resources is routed to the corresponding virtual I / O devices through an object bus exchange engine based on a publish-subscribe model. The object bus exchange engine creates or updates the publish entries for each virtual I / O device and the subscription entries for each physical I / O resource according to the updated mapping relationship, so as to establish a data transmission path.

3. The method according to claim 1, characterized in that, The method employs a dual-time-scale scheduling architecture to perform resource allocation and route updates. The first preset period is used as the macro scheduling period. In each macro scheduling period, global IO demand feature extraction, scheduling priority calculation, physical IO resource allocation and mapping relationship update are performed once. The second preset period is used as the micro-scheduling period, which is shorter than the first preset period. In each micro-scheduling period, urgent I / O requests are detected. When the scheduling priority of the detected urgent I / O request is higher than the minimum priority preset multiple of the currently allocated resources, resource preemption is triggered and the mapping relationship and data routing are updated in real time.

4. The method according to claim 1, characterized in that, In step S2, the IO resource scheduling priority of each virtual IO device is calculated by a composite priority scoring function, which includes at least an urgency attenuation factor, a resource efficiency factor, an anti-starvation compensation factor, and a device association factor. The urgency decay factor is used to characterize the urgency of the deadline for the task corresponding to the virtual I / O device; The resource efficiency factor is used to characterize the efficiency of virtual I / O devices in utilizing allocated bandwidth resources. The anti-starvation compensation factor is used to prioritize virtual I / O devices that have not received I / O services for a long time. The device association factor is used to coordinate and prioritize associated virtual I / O devices that have synchronous sampling dependencies.

5. The method according to claim 4, characterized in that, Step S2 specifically includes: Extract multi-dimensional IO demand feature vectors for each virtual IO device. The IO demand feature vectors include at least five dimensions: bandwidth demand, latency sensitivity, jitter tolerance, sampling periodicity, and burstiness. Calculate the degree of demand conflict between any two virtual I / O devices in each dimension, and dynamically calculate the weight coefficient of each dimension based on the overall demand difference ratio of each dimension; Based on the aforementioned dimension weight coefficients, and combined with the urgency decay factor, resource efficiency factor, anti-starvation compensation factor, and device association factor, a composite priority score for each virtual I / O device is calculated.

6. The method according to claim 1, characterized in that, In step S1, the initial mapping relationship is a bidirectional hash mapping structure, including a first mapping table and a second mapping table: The first mapping table is used to map the unique identifier of a virtual I / O device to the corresponding list of available physical I / O modules; The second mapping table is used to map the unique identifier of the physical I / O module to the identifier of the currently bound virtual I / O device; The monitoring terminal also maintains a device status table, which records the current mapping relationship, IO bandwidth quota, and resource utilization statistics of each virtual IO device.

7. The method according to claim 2, characterized in that, In step S3, when the original routing table entry is replaced due to resource allocation update, an atomic switching operation is used to update the routing rules: within the clock cycle of the same object bus switching engine, the backup of the old routing table entry, the writing of the new routing table entry, and the switching of the routing table pointer are completed synchronously to ensure that there is no data loss or routing glitches during the routing switching process.

8. The method according to claim 1, characterized in that, In step S4, the conversion processing of the raw signals collected by the physical sensors specifically includes: Based on the proportional coefficient and offset stored in the sensor descriptor table, the original acquired signal is linearly range-transformed to obtain the engineering value of the corresponding physical quantity. After normalizing the engineering values ​​to a preset numerical range, they are output to the corresponding monitoring service instance.

9. A device for dynamically allocating virtualized IO resources in a switchgear monitoring terminal, characterized in that, include: One or more processors; Memory; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more applications are configured to perform the I / O resource virtualization dynamic allocation method for the switch cabinet monitoring terminal as described in any one of claims 1 to 8.

10. A computer program product, characterized in that, The system includes computer instructions that instruct a computer device to perform operations corresponding to the I / O resource virtualization dynamic allocation method of the switch cabinet monitoring terminal as described in any one of claims 1 to 8.