A plug-in management method and system

By combining Netlink hot-swap detection mechanism and state traversal training mechanism, the computing requirements of the plug-in are dynamically updated, and the maximum continuous uninterrupted availability time of the plug-in is improved by optimizing the objective function, the problem of low-priority plug-in resources being preempted in the existing technology is solved, and the system is high stability and response speed are achieved.

CN119576438BActive Publication Date: 2025-05-09BEIJING HUAFUJUNENG SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510142677.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-10
Publication Date
2025-05-09
Estimated Expiration
2045-02-10

AI Technical Summary

Technical Problem

Priority-based scheduling schemes in the prior art may cause resources of low-priority plug-ins to be temporarily preempted when resources are insufficient, resulting in their execution being delayed or suspended, affecting the stability of the system.

Method used

By combining Netlink hot-swap detection mechanism and state traversal training mechanism, plug-in information in the slot is obtained in real time and computing requirements are updated dynamically. Then, based on the computing requirements of the plug-in and the availability of computing nodes, a computing resource allocation model is built, and with the goal of improving the maximum continuous uninterrupted availability time of the plug-in and reducing delay, an optimization objective function is set to solve the computing resource allocation plan.

Benefits of technology

Maximize the operating stability of the plug-in, avoid frequent resource interruptions and task restarts, reduce the impact of plug-in interruptions on system functions, and improve system response speed and stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119576438B_ABST
    Figure CN119576438B_ABST
Patent Text Reader

Abstract

The present invention provides a plug-in management method and system, belonging to the field of data processing technology, the method includes: combining Netlink hot plug detection mechanism and state traversal training mechanism, obtaining plug-in information in the slot; updating the computing requirements of each plug-in according to the plug-in information; obtaining the availability of each computing node in each time period from the availability schedule; constructing a computing resource allocation model based on the computing requirements of each plug-in and the availability of each computing node in each time period; setting the constraint conditions of the computing resource allocation model; setting the optimization objective function of the computing resource allocation model with the goal of improving the longest continuous uninterrupted available time of each plug-in and reducing delay; solving the computing resource allocation model according to the optimization objective function, determining the computing resource allocation plan; allocating computing resources to each plug-in according to the computing resource allocation plan. The present invention can improve the system response speed and stability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to a plug-in management method and system. Background Art

[0002] In the field of new energy (such as solar power generation, wind power generation, new energy vehicles, etc.), various devices usually need to use plug-ins to achieve electrical connection, signal transmission and function expansion. The plug-in system can provide a flexible expansion method, so that the device can dynamically add or uninstall different functional modules according to actual needs. These plug-ins can include sensor modules, controllers, communication modules, data processing units, etc. in the application. Different plug-ins provide different functions, so that the device can realize diversified applications, such as real-time monitoring, data acquisition, fault diagnosis, energy management, control strategy adjustment, etc.

[0003] However, in these systems, plug-ins often need to be frequently plugged in and out, which may be due to equipment maintenance, function updates, environmental changes, fault handling, etc. Frequent plugging and unplugging makes the operation of the system more complicated, especially in terms of resource allocation. Whenever a plug-in is inserted or removed, the system must re-evaluate the allocation of existing resources and make adjustments based on the plug-in's needs, available resources, and priorities. Therefore, how to allocate computing resources to each plug-in in a dynamically changing environment has become a major problem in system design.

[0004] Currently, the allocation of computing resources required by plug-ins mainly adopts priority-based resource scheduling schemes. Computing resources are allocated according to the priority queue of plug-ins, which can ensure the priority execution of key plug-ins and has strong adaptability. However, priority-based scheduling schemes usually allocate computing resources to high-priority plug-ins first when resources are insufficient. Low-priority plug-ins may have their resources temporarily "preempted", causing their execution to be delayed or suspended. These plug-ins may not be able to complete their tasks on time, resulting in the unavailability of certain functions of the system, affecting the continuous operation of the plug-ins and further affecting the stability of the system. Summary of the invention

[0005] The main purpose of the present invention is to provide a plug-in management method and system to solve the problem that the priority-based scheduling scheme in the prior art usually allocates computing resources to high-priority plug-ins first when resources are insufficient, while low-priority plug-ins may be temporarily "preempted" for resources, causing their execution to be delayed or suspended, and these plug-ins may not be able to complete their tasks on time, causing some functions of the system to be unavailable, affecting the continuous operation of the plug-ins, and further affecting the stability of the system.

[0006] In order to achieve the above object, according to one aspect of the present invention, a plug-in management method is provided, comprising:

[0007] S1: Combine the Netlink hot-plug detection mechanism and the state traversal polling mechanism to obtain the plug-in information in the slot;

[0008] S2: updating the computing requirements of each plug-in according to the plug-in information;

[0009] S3: Obtain the availability of each computing node in each time period from the availability plan table;

[0010] S4: Building a computing resource allocation model based on the computing requirements of each plug-in and the availability of each computing node in each time period;

[0011] S5: Setting constraints of the computing resource allocation model;

[0012] S6: setting an optimization objective function of the computing resource allocation model with the goal of increasing the longest continuous uninterrupted available time of each plug-in and reducing latency;

[0013] S7: Under the constraints of the constraints, according to the optimization objective function, solving the computing resource allocation model to determine the computing resource allocation plan;

[0014] S8: Allocate computing resources to each plug-in according to the computing resource allocation scheme.

[0015] Furthermore, the plug-in is applied to new energy scenarios, and the plug-in includes: wind speed collection plug-in, wind direction collection plug-in, temperature collection plug-in, humidity collection plug-in, air pressure collection plug-in, power generation control plug-in, load scheduling plug-in, demand response plug-in, data transmission plug-in, wind power prediction plug-in and power generation prediction plug-in.

[0016] Furthermore, the plug-ins have the same size and structure and use the same communication protocol, which is specifically: CAN bus protocol, Modbus protocol or TCP / IP protocol.

[0017] Furthermore, the S1 specifically includes:

[0018] S101: Create and monitor Netlink socket;

[0019] S102: When the Netlink socket is readable, receiving a plug-in message sent by the kernel through Netlink communication;

[0020] S103: parsing the plug-in message to extract plug-in information;

[0021] S104: perform traversal query from the / sys / bus / usb / devices directory;

[0022] S105: Check whether there is a directory corresponding to the slot in the directory; if so, proceed to the next step; otherwise, proceed to the next round of query;

[0023] S106: extracting a port directory from a directory corresponding to the slot;

[0024] S107: traverse the port directory to query whether the device node contains a plug-in device; if so, proceed to the next step; otherwise, check the next port directory;

[0025] S108: Check whether there is an identical plug-in device node in the / dev directory; if so, proceed to the next step; otherwise, check the next port directory;

[0026] S109: Check whether the port information of the plug-in device is consistent with that recorded in the system; if so, proceed to the next step; otherwise, check the next port directory;

[0027] S110: Extract plug-in information and map the device port to a standardized path.

[0028] Furthermore, the constraints include:

[0029] The computing resources of each computing node in each time period cannot exceed the maximum capacity of the computing node;

[0030] The functions in each plug-in computing requirement can only be assigned to one computing node for execution;

[0031] The functions in each plug-in computing requirement must be assigned to a computing node for execution;

[0032] The traffic on the link between the computing nodes involved in each plug-in computing requirement cannot exceed the maximum traffic of the link;

[0033] The bandwidth usage of each link between computing nodes cannot exceed the maximum capacity of the link.

[0034] Furthermore, the optimization objective function is specifically:

[0035] ;

[0036] Among them, f represents the optimization objective function, X represents the computing resource allocation scheme, min represents the minimum value, and β r represents the longest continuous uninterrupted available time for the computing demand of the rth plug-in, r represents the rth plug-in, R represents the plug-in set, l ij represents the propagation delay between the i-th computing node and the j-th computing node, (i, j) represents the link between the i-th computing node and the j-th computing node, L represents the link set, Indicates whether link (i, j) is assigned as the execution link of the kth function in the rth plug-in computing requirement in the tth time period, t represents the tth time period, T represents the time period set, k represents the kth function, and K r represents the function set in the rth plug-in computing requirement, ε1 represents the adjustment coefficient of the sum of the longest continuous uninterrupted available time of all plug-in computing requirements, and ε2 represents the adjustment coefficient of propagation delay.

[0037] Furthermore, the longest continuous uninterrupted available time required by the plug-in for computing is specifically:

[0038] ;

[0039] Among them, max means taking the maximum value, Indicates whether the distribution of the computing demand of the rth plug-in in the tth time period has changed. Indicates that the distribution of the computing demand of the rth plug-in in the tth time period has not changed, It indicates that the distribution of the computing demand of the rth plug-in in the tth time period has changed, and T represents the time period set.

[0040] Furthermore, the adjustment coefficient of the sum of the longest continuous uninterrupted available time required by all plug-in calculations is specifically:

[0041] ;

[0042] Among them, C R Indicates the total number of plugins in the plugin collection, C T Indicates the total number of time periods in the time period collection.

[0043] Furthermore, the adjustment coefficient of the propagation delay is specifically:

[0044] ;

[0045] Among them, C R Indicates the total number of plugins in the plugin collection, C K represents the total number of functions in the function set in the rth plug-in computing requirement, C T represents the total number of time periods in the time period set, C L Indicates the total number of time periods in the time period collection.

[0046] According to one aspect of the present invention, there is provided a plug-in management system, comprising:

[0047] processor;

[0048] The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the above-mentioned plug-in management method is implemented.

[0049] By applying the technical solution of the present invention, by combining the Netlink hot-plug detection mechanism and the state traversal polling mechanism, the system can detect the plug-in status of the plug-in in real time, and dynamically update the computing requirements of each plug-in. By optimizing the objective function to improve the longest continuous uninterrupted available time of the plug-in, the system can maximize the running stability of the plug-in, avoid frequent resource interruptions and task restarts, thereby reducing the impact of plug-in interruptions on system functions and improving system response speed and stability.

[0050] In addition to the above-described purposes, features and advantages, the present invention has other purposes, features and advantages. The present invention will be further described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] The accompanying drawings constituting a part of the present invention are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the accompanying drawings:

[0052] Figure 1 A schematic diagram of a plug-in management method provided by an embodiment of the present invention is shown;

[0053] Figure 2 A schematic diagram of the structure of a plug-in management system provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0054] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0055] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0056] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged where appropriate, so as to describe the embodiments of the present invention described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0057] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.

[0058] Reference Manual Attached Figure 1 , showing a flow chart of a plug-in management method provided by an embodiment of the present invention.

[0059] An embodiment of the present invention provides a plug-in management method, including:

[0060] S1: Combine the Netlink hot-plug detection mechanism with the state traversal polling mechanism to obtain the plug-in information in the slot.

[0061] Among them, the Netlink hot-plug detection mechanism is a Netlink socket communication mechanism based on the Linux kernel, which is used to detect the plug-in and unplug events of hardware devices in real time. This mechanism can generate notification messages when a device is plugged in or removed, and the system dynamically obtains the device's status change information by listening to these messages. When a plug-in and unplug event occurs, the Netlink mechanism can quickly transmit the device's plug-in and unplug status (such as plug-in, removal) and update the device list in the system. This mechanism has high real-time performance and can effectively ensure the system's rapid response to hardware status changes. It is especially suitable for application scenarios that require real-time monitoring of hardware plug-in and unplugging.

[0062] Among them, the state traversal polling mechanism is a way to periodically check the system status to ensure that the system can identify and respond to changes in hardware or plug-ins. In this mechanism, the system will periodically traverse the hardware interface or device directory (such as / sys or / dev) to obtain the status information of the device. Unlike the event-driven Netlink mechanism, the traversal mechanism is based on timed checks and is suitable for scenarios where the hardware status needs to be periodically confirmed. It scans the device directory and verifies the connection and status of the device, thereby supplementing or correcting device changes that are not captured by other mechanisms (such as Netlink) to ensure the integrity and accuracy of device information.

[0063] In a possible implementation, S1 specifically includes sub-steps S101 to S110:

[0064] S101: Create and monitor a Netlink socket.

[0065] It should be noted that by creating and monitoring the Netlink socket, the system can capture the plug-in messages sent by the kernel in real time. This event-driven mechanism enables the system to respond to device plug-in and unplug operations in the first place, ensuring that the status changes of the plug-in are captured in a timely manner.

[0066] S102: When the Netlink socket is readable, a plug-in message sent by the kernel through Netlink communication is received.

[0067] S103: Parse the plug-in message and extract plug-in information.

[0068] Furthermore, in actual application, abnormal situations such as Netlink socket disconnection may occur, and the system may not receive notifications of hardware plugging and unplugging or device status changes. In this case, relying solely on the Netlink mechanism will cause information loss or delay, thereby affecting the real-time performance and reliability of the system. Therefore, the present invention introduces a state traversal polling mechanism, which is used in combination with the Netlink hot plug detection mechanism.

[0069] S104: Perform a traversal query from the / sys / bus / usb / devices directory.

[0070] S105: Check whether there is a directory corresponding to the slot in the directory. If yes, proceed to the next step. Otherwise, proceed to the next round of query.

[0071] S106: Extract the port directory from the directory corresponding to the slot.

[0072] S107: traverse the port directory to check whether the device node contains a plug-in device. If so, proceed to the next step. Otherwise, check the next port directory.

[0073] S108: Check whether the same plug-in device node exists in the / dev directory. If yes, proceed to the next step. Otherwise, check the next port directory.

[0074] S109: Check whether the port information of the plug-in device is consistent with that recorded in the system. If yes, proceed to the next step. Otherwise, check the next port directory.

[0075] S110: Extract plug-in information and map the device port to a standardized path.

[0076] In the present invention, by adopting both the Netlink event-driven mechanism and the polling query mechanism, the method provides redundancy protection. Even if an abnormal situation such as a Netlink socket disconnection occurs, the traversal query can ensure the update and synchronization of device information. This redundant design can enhance the fault tolerance of the system and avoid system failure due to the failure of a certain mechanism.

[0077] S2: Update the computing requirements of each plug-in according to the plug-in information.

[0078] Specifically, each plug-in may have different computing requirements (such as CPU, memory, bandwidth, etc.) when running. By parsing the plug-in information, the system can extract the computing requirements of each plug-in (such as CPU requirements, memory requirements, bandwidth requirements, etc.). At the same time, based on the type and function of the plug-in (such as wind speed collection plug-in, power control plug-in, etc.), the system can infer the computing requirements of the plug-in. For example, the wind speed collection plug-in may only require low computing resources, while the power generation power control plug-in may require more computing resources and real-time data processing capabilities.

[0079] It should be noted that the plug-in is used in new energy scenarios.

[0080] Optionally, the plug-ins include: wind speed collection plug-in, wind direction collection plug-in, temperature collection plug-in, humidity collection plug-in, air pressure collection plug-in, power generation control plug-in, load scheduling plug-in, demand response plug-in, data transmission plug-in, wind power prediction plug-in and power generation prediction plug-in.

[0081] Optionally, the plug-ins have the same size and structure and use the same communication protocol, which is specifically: CAN bus protocol, Modbus protocol or TCP / IP protocol.

[0082] In the present invention, the uniform size and protocol ensure that different plug-ins can be plugged in and out of the same slot, and can communicate and exchange data seamlessly, thereby reducing the need for hardware and software customization. The system is more convenient when expanding, upgrading or replacing plug-ins, and can improve the reliability, stability and maintainability of the overall system.

[0083] S3: Obtain the availability of each computing node in each time period from the availability plan table.

[0084] Among them, the availability schedule is a table or data structure that records the availability status of computing nodes in different time periods, and is usually used for dynamic scheduling and resource allocation. It lists in detail the availability of each computing node in the system in a specific time period, helping the system to reasonably allocate computing resources based on the actual available time of each node.

[0085] Optionally, the availability schedule usually contains the following key fields: (1) Computing node ID: a unique identifier that identifies each computing node. (2) Time period: represents the available time period of the node (for example, hours, minutes, or other time units). (3) Node status: the status of the node in each time period (for example, "available", "unavailable", "under maintenance"). (4) Load status: records the load status of the node in different time periods (such as CPU usage, memory usage, etc.), which helps the system to make more accurate resource allocation.

[0086] Furthermore, the availability schedule provides the system with the available status and time information of each computing node, helping to achieve accurate resource scheduling and load balancing. By using the availability schedule, the system can flexibly allocate computing resources according to the actual availability of the nodes, ensure efficient operation of the system, improve fault tolerance, and avoid service interruptions due to node unavailability.

[0087] S4: Based on the computing requirements of each plug-in and the availability of each computing node in each time period, a computing resource allocation model is constructed.

[0088] S5: Set constraints for the computing resource allocation model.

[0089] Optionally, constraints include:

[0090] The computing resources of each computing node in each time period cannot exceed the maximum capacity of the computing node.

[0091] It should be noted that the computing resources of each computing node in each time period cannot exceed the maximum capacity of the computing node, ensuring that the computing resource allocation of each computing node will not exceed its physical capacity, avoiding overload of node resources. By limiting the resource usage of each node, the system can ensure the stable operation of the node, avoid system crashes or performance degradation due to insufficient resources, and ensure the reliability and efficiency of the system.

[0092] The functions in each plug-in computing requirement can only be assigned to one computing node for execution.

[0093] It should be noted that the functions in each plug-in computing requirement can only be assigned to one computing node for execution, ensuring that the computing function of each plug-in is only assigned to one computing node in the system for execution, avoiding redundancy and conflict in resource allocation. This helps to simplify resource scheduling and management, reduce repeated calculations, improve system resource utilization efficiency, and avoid resource competition and computing conflicts between multiple nodes.

[0094] The functions in each plug-in computing requirement must be assigned to a computing node for execution.

[0095] It should be noted that the functions in each plug-in computing requirement must be assigned to a computing node for execution, ensuring that all computing functions of each plug-in can be executed in the system and that the plug-in functions can be fully realized. By ensuring that each function has a computing node to execute, plug-in functions with unallocated resources are avoided, ensuring that there will be no missing functions or execution failures during system operation.

[0096] The traffic on the link between the computing nodes involved in each plug-in computing requirement cannot exceed the maximum traffic of the link.

[0097] It should be noted that the traffic on the link between the computing nodes involved in each plug-in computing requirement cannot exceed the maximum traffic of the link, preventing the data traffic between the computing nodes from exceeding the maximum bandwidth of the link and avoiding transmission delays or data loss caused by network congestion. By controlling data traffic, the use of network resources can be optimized, ensuring efficient data transmission of the system, and improving the communication stability and response speed of the system.

[0098] The bandwidth usage of each link between computing nodes cannot exceed the maximum capacity of the link.

[0099] It should be noted that the bandwidth usage of the link between each computing node cannot exceed the maximum capacity of the link, ensuring that the bandwidth usage of the link between each computing node does not exceed its maximum capacity, thereby avoiding bandwidth overload. By limiting bandwidth usage, network congestion and transmission bottlenecks are avoided, ensuring that the system can still maintain stable communication performance under high load conditions, and improving the reliability and efficiency of data transmission.

[0100] S6: With the goal of increasing the longest continuous uninterrupted available time of each plug-in and reducing latency, an optimization objective function of the computing resource allocation model is set.

[0101] Optionally, the optimization objective function is specifically:

[0102] ;

[0103] Among them, f represents the optimization objective function, X represents the computing resource allocation scheme, min represents the minimum value, and βr represents the longest continuous uninterrupted available time for the computing demand of the rth plug-in, r represents the rth plug-in, R represents the plug-in set, l ij represents the propagation delay between the i-th computing node and the j-th computing node, (i, j) represents the link between the i-th computing node and the j-th computing node, L represents the link set, Indicates whether link (i, j) is assigned as the execution link of the kth function in the rth plug-in computing requirement in the tth time period, t represents the tth time period, T represents the time period set, k represents the kth function, and K r represents the function set in the rth plug-in computing requirement, ε1 represents the adjustment coefficient of the sum of the longest continuous uninterrupted available time of all plug-in computing requirements, and ε2 represents the adjustment coefficient of propagation delay.

[0104] In the present invention, by setting an optimization objective function, in the process of dynamic computing resource allocation, the maximum continuous uninterrupted available time (SCAT) of the plug-in is improved to ensure the stability and high availability of the plug-in, and the propagation delay is reduced to optimize the system performance.

[0105] Furthermore, by setting two adjustment coefficients, a trade-off can be made between balancing the plug-in execution time and network latency, making resource allocation more efficient and flexible. This can improve the overall stability and response speed of the system, ensure that the plug-in can obtain high-priority resources in a changing operating environment, reduce interruptions, improve computing resource utilization, and ensure efficient and stable operation of the system.

[0106] Optionally, the maximum continuous uninterrupted available time required by the plug-in computing is specifically:

[0107] ;

[0108] Among them, max means taking the maximum value, Indicates whether the distribution of the computing demand of the rth plug-in in the tth time period has changed. Indicates that the distribution of the computing demand of the rth plug-in in the tth time period has not changed, It indicates that the distribution of the computing demand of the rth plug-in in the tth time period has changed, and T represents the time period set.

[0109] Optionally, the adjustment coefficient of the sum of the longest continuous uninterrupted available time required by all plug-in calculations is specifically:

[0110] ;

[0111] Among them, C R Indicates the total number of plugins in the plugin collection, C TIndicates the total number of time periods in the time period collection.

[0112] In the present invention, the adjustment coefficient can ensure that the sum of the longest continuous uninterrupted available time in the optimization objective function is reasonably weighed in the overall resource allocation. The adjustment coefficient gradually decreases as the number of plug-ins and the number of time periods increase, thereby avoiding over-reliance on the sum of the longest continuous uninterrupted available time and ensuring that the system can maintain balanced resource allocation when facing a large number of plug-ins and long-term operation.

[0113] Optionally, the adjustment coefficient of the propagation delay is specifically:

[0114] ;

[0115] Among them, C R Indicates the total number of plugins in the plugin collection, C K represents the total number of functions in the function set in the rth plug-in computing requirement, C T represents the total number of time periods in the time period set, C L Indicates the total number of time periods in the time period collection.

[0116] In the present invention, the appropriate weight of propagation delay in the objective function during the optimization process can be ensured by adjusting the coefficient. As the system scale (such as the number of plug-ins, the number of functions, the number of time periods, and the number of links) increases, the adjustment coefficient will gradually decrease, thereby preventing propagation delay from excessively affecting resource scheduling decisions.

[0117] S7: Under the constraints of the constraints, according to the optimization objective function, the computing resource allocation model is solved to determine the computing resource allocation plan.

[0118] Specifically, the bat optimization algorithm can be used to solve the computing resource allocation model.

[0119] Initialize bat individuals, each bat individual represents a feasible computing resource allocation scheme.

[0120] In the global search phase, update the flight speed and position of individual bats:

[0121] ;

[0122] Among them, f i represents the pulse emission frequency of the i-th bat individual, f min Indicates the minimum pulse transmission frequency, f max Indicates the maximum pulse emission frequency, β t represents the nonlinear arccosine acceleration factor at the tth iteration, represents the speed of the i-th bat individual at the t+1th iteration, r1 and r2 represent random numbers between 0 and 1, ω t represents the inertia weight factor at the tth iteration, represents the speed of the i-th bat individual at the t-th iteration, represents the individual optimal solution, c i represents the learning factor, x * represents the global optimal solution, represents the position of the i-th bat individual at the t-th iteration, represents the position of the i-th bat individual at the t+1th iteration, and Levy represents the Levy flight step.

[0123] In the present invention, by updating the speed and position, the bat can explore a wider solution space, and can also perform fine local search near the potential optimal solution found, thereby improving the search efficiency of the algorithm in complex problems.

[0124] Optionally, the inertia weight factor is specifically:

[0125] ;

[0126] Among them, ω t represents the inertia weight factor at the tth iteration, ω min represents the minimum inertia weight factor, ω max represents the maximum inertia weight factor, t represents the current number of iterations, T m Indicates the maximum number of iterations.

[0127] In the present invention, in the early stage of the algorithm, a larger inertia weight promotes a wider search and avoids premature convergence. In the later stage of iteration, a smaller inertia weight enhances the local search capability, making the search process more refined and helping to find a better solution.

[0128] Optionally, the nonlinear arccosine acceleration factor is specifically:

[0129] ;

[0130] Among them, arccos represents the arccosine function, t represents the current number of iterations, and T represents the maximum number of iterations.

[0131] In the present invention, in the early stage of the algorithm, a larger acceleration factor encourages extensive exploration of the solution space, enhances global search capabilities, and avoids falling into local optimality. As the iteration deepens, the reduced acceleration factor forces the search to focus more on the vicinity of the current optimal solution, improves local search capabilities, and thus optimizes the final solution.

[0132] Optionally, the learning factor is specifically:

[0133] ;

[0134] Among them, c i represents the learning factor of the i-th bat individual, c max represents the maximum learning factor, c min Represents the minimum learning factor.

[0135] In the present invention, the learning factor gradually decreases with the increase of the number of iterations. The larger learning factor in the early stage encourages individual bats to focus more on exploring the global optimal solution, thereby enhancing the diversity of the search. As the iterations proceed, the smaller learning factor encourages individual bats to focus on the current optimal solution, improving the accuracy of local search.

[0136] Optionally, the Levy flight step length is specifically:

[0137] ;

[0138] Where Γ represents the standard Gamma function, λ represents the exponential parameter, and s represents the size parameter.

[0139] A random number r3 between 0 and 1 is randomly generated, and it is determined whether the random number r3 is greater than the pulse rate. If so, the local search phase is entered. Otherwise, the pulse rate and the average loudness of the pulse are updated.

[0140] In the present invention, the position of individual bats is updated by using Levy flight steps. This method imitates the jumping search behavior of bats and other animals in nature, allowing bats to jump over a larger range in the solution space and enhance their exploration capabilities.

[0141] In the local search phase, a solution is selected from the optimal solution set to generate a new local solution:

[0142] ;

[0143] in, represents the average loudness of the pulse emitted by the i-th bat individual at the tth iteration, ε represents a random number between 0 and 1, represents the average loudness of the pulses emitted by the i-th bat individual at the tth iteration.

[0144] Calculate the fitness value of the new local solution, generate a random number r4 between 0 and 1, and determine whether it satisfies and If yes, accept the new local solution. Otherwise, do not accept the new local solution.

[0145] Update the pulse rate and average loudness of the pulses:

[0146] ;

[0147] in, represents the pulse rate emitted by the i-th bat individual at the t+1th iteration, represents the initial pulse rate emitted by the i-th bat individual, e represents the natural constant, γ represents the pulse rate enhancement coefficient, represents the average loudness of the pulse emitted by the i-th bat individual at the tth iteration, and α represents the pulse loudness attenuation coefficient.

[0148] In the present invention, in the local search stage, by selecting a solution from the optimal solution set and generating a new local solution, the bat optimization algorithm can deeply explore the neighborhood of the current optimal solution and further optimize the quality of the solution.

[0149] Determine whether the current number of iterations has reached the maximum number of iterations. If so, output the computing resource allocation plan for the bat individual representative with the highest current fitness. Otherwise, return to continue iterating.

[0150] In the present invention, the advantage of using the bat optimization algorithm to solve the computing resource allocation model lies in its powerful global search and local search capabilities. The bat optimization algorithm simulates the natural flight behavior of bats, conducts extensive exploration in the solution space, and through nonlinear adjustment of the pulse emission frequency, flight speed and position update strategy, the algorithm can find the global optimal solution in complex resource allocation problems.

[0151] S8: Allocate computing resources to each plug-in according to the computing resource allocation plan.

[0152] From the above description, it can be seen that the plug-in management method provided by the present invention combines the Netlink hot-plug detection mechanism and the state traversal polling mechanism, so that the system can detect the plug-in status of the plug-in in real time, and dynamically update the computing requirements of each plug-in. By optimizing the objective function to improve the longest continuous uninterrupted available time of the plug-in, the system can maximize the running stability of the plug-in, avoid frequent resource interruptions and task restarts, thereby reducing the impact of plug-in interruptions on system functions and improving system response speed and stability.

[0153] Reference Manual Attached Figure 2 , showing a schematic diagram of the structure of a plug-in management system provided by an embodiment of the present invention.

[0154] The embodiment of the present invention provides a plug-in management system 20, including:

[0155] Processor 201;

[0156] The memory 202 stores computer-readable instructions, and when the computer-readable instructions are executed by the processor 201, the above-mentioned plug-in management method is implemented.

[0157] From the above description, it can be seen that the plug-in management method provided by the present invention combines the Netlink hot-plug detection mechanism and the state traversal polling mechanism, so that the system can detect the plug-in status of the plug-in in real time, and dynamically update the computing requirements of each plug-in. By optimizing the objective function to improve the longest continuous uninterrupted available time of the plug-in, the system can maximize the running stability of the plug-in, avoid frequent resource interruptions and task restarts, thereby reducing the impact of plug-in interruptions on system functions and improving system response speed and stability.

[0158] Unless otherwise specifically stated, the relative arrangement of the parts and steps described in these embodiments, numerical expressions and numerical values ​​do not limit the scope of the present invention. At the same time, it should be understood that, for ease of description, the sizes of the various parts shown in the accompanying drawings are not drawn according to the actual proportional relationship. The technology, method and equipment known to ordinary technicians in the relevant field may not be discussed in detail, but in appropriate cases, the technology, method and equipment should be regarded as a part of the authorization specification. In all examples shown and discussed here, any specific value should be interpreted as being merely exemplary, rather than as a limitation. Therefore, other examples of exemplary embodiments may have different values. It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once a certain item is defined in an accompanying drawing, it does not need to be further discussed in subsequent drawings.

[0159] For ease of description, spatially relative terms such as "above", "above", "on the upper surface of", "above", etc. may be used here to describe the spatial positional relationship between a device or feature and other devices or features as shown in the figure. It should be understood that spatially relative terms are intended to include different orientations of the device in use or operation in addition to the orientation described in the figure. For example, if the device in the accompanying drawings is inverted, the device described as "above other devices or structures" or "above other devices or structures" will be positioned as "below other devices or structures" or "below other devices or structures". Thus, the exemplary term "above" can include both "above" and "below". The device can also be positioned in other different ways (rotated 90 degrees or in other orientations), and the spatially relative descriptions used here are interpreted accordingly.

[0160] In the description of the present invention, it is necessary to understand that the directions or positional relationships indicated by directional words such as "front, back, up, down, left, right", "lateral, vertical, perpendicular, horizontal" and "top, bottom" are usually based on the directions or positional relationships shown in the drawings. They are only for the convenience of describing the present invention and simplifying the description. Unless otherwise specified, these directional words do not indicate or imply that the devices or elements referred to must have a specific direction or be constructed and operated in a specific direction. Therefore, they cannot be understood as limiting the scope of protection of the present invention. The directional words "inside and outside" refer to the inside and outside relative to the contours of each component itself.

[0161] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A plug-in management method, characterized in that: include: S1: Combine the Netlink hot-plug detection mechanism and the state traversal polling mechanism to obtain the plug-in information in the slot; S2: updating the computing requirements of each plug-in according to the plug-in information; S3: Obtain the availability of each computing node in each time period from the availability plan table; S4: Building a computing resource allocation model based on the computing requirements of each plug-in and the availability of each computing node in each time period; S5: Setting constraints of the computing resource allocation model; S6: setting an optimization objective function of the computing resource allocation model with the goal of increasing the longest continuous uninterrupted available time of each plug-in and reducing latency; S7: Under the constraints of the constraints, according to the optimization objective function, solving the computing resource allocation model to determine the computing resource allocation plan; S8: Allocate computing resources to each plug-in according to the computing resource allocation scheme; The optimization objective function is specifically: ; in, f represents the optimization objective function, X Indicates the computing resource allocation scheme, min indicates the minimum value, β r Indicates r The longest continuous uninterrupted available time required by the plugin calculation, r Indicates r plugins, R Represents a collection of plugins. l ij Indicates i The computing nodes and j The propagation delay between computing nodes, ( i , j ) indicates the i The computing nodes and j The links between the computing nodes are L represents a set of links, Indicates link ( i , j ) is assigned as r of the plugin calculation requirements k The function is in t The execution link of each time period, t Indicates t time period, T Represents a set of time periods. k Indicates k functions, K r Indicates r The set of functions in the plug-in calculation requirements, ε 1 represents the adjustment factor of the sum of the longest continuous uninterrupted available time required by all plug-in calculations. ε 2 represents the adjustment factor of propagation delay; The maximum continuous uninterrupted available time required by the plug-in calculation is specifically: ; Among them, max means taking the maximum value, Indicates r The plugin calculation requirements are in t Whether the allocation in the time period changes, Indicates r The plugin calculation requirements are in t The allocation in the time period has not changed. Indicates r The plugin calculation requirements are in t The allocation in the time period changes. T Represents a time period collection.

2. The plug-in management method according to claim 1, characterized in that: The plug-in is applied to new energy scenarios, and the plug-in includes: a wind speed collection plug-in, a wind direction collection plug-in, a temperature collection plug-in, a humidity collection plug-in, an air pressure collection plug-in, a power generation control plug-in, a load scheduling plug-in, a demand response plug-in, a data transmission plug-in, a wind power prediction plug-in and a power generation prediction plug-in.

3. The plug-in management method according to claim 2, characterized in that: The plug-ins have the same size and structure and use the same communication protocol, which is specifically: CAN bus protocol, Modbus protocol or TCP / IP protocol.

4. The plug-in management method according to claim 1, characterized in that: The S1 specifically includes: S101: Create and monitor Netlink socket; S102: When the Netlink socket is readable, receiving a plug-in message sent by the kernel through Netlink communication; S103: parsing the plug-in message to extract plug-in information; S104: perform traversal query from the / sys / bus / usb / devices directory; S105: Check whether there is a directory corresponding to the slot in the directory; if so, proceed to the next step; otherwise, proceed to the next round of query; S106: extracting a port directory from a directory corresponding to the slot; S107: traverse the port directory to query whether the device node contains a plug-in device; if so, proceed to the next step; otherwise, check the next port directory; S108: Check whether there is an identical plug-in device node in the / dev directory; if so, proceed to the next step; otherwise, check the next port directory; S109: Check whether the port information of the plug-in device is consistent with that recorded in the system; if so, proceed to the next step; otherwise, check the next port directory; S110: Extract plug-in information and map the device port to a standardized path.

5. The plug-in management method according to claim 1, characterized in that: The constraints include: The computing resources of each computing node in each time period cannot exceed the maximum capacity of the computing node; The functions in each plug-in computing requirement can only be assigned to one computing node for execution; The functions in each plug-in computing requirement must be assigned to a computing node for execution; The traffic on the link between the computing nodes involved in each plug-in computing requirement cannot exceed the maximum traffic of the link; The bandwidth usage of each link between computing nodes cannot exceed the maximum capacity of the link.

6. The plug-in management method according to claim 1, characterized in that: The adjustment coefficient of the sum of the longest continuous uninterrupted available time required by all plug-in calculations is specifically: ; in, C R Indicates the total number of plugins in the plugin collection. C T Indicates the total number of time periods in the time period collection.

7. The plug-in management method according to claim 1, characterized in that: The adjustment coefficient of the propagation delay is specifically: ; in, C R Indicates the total number of plugins in the plugin collection. C K Indicates r The plugin calculates the total number of features in the feature set in the requirement. C T Indicates the total number of time periods in the time period set. C L Indicates the total number of time periods in the time period collection.

8. A plug-in management system, characterized in that: include: processor; A memory having computer-readable instructions stored thereon, wherein when the computer-readable instructions are executed by the processor, the plug-in management method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Joint allocation method for communication resources of space-air-ground integrated internet of things

    CN115483964A

  • Fog computing resource allocation method based on deep reinforcement learning strategy

    CN117255418A