LLDP-based computing power and memory resource notification method and system
By collecting, encoding, and verifying device computing power and memory resource data in the LLDP protocol, the problem of the existing LLDP being unable to announce resource status in real time is solved, realizing efficient and secure transmission of resource data and accurate decision support for the scheduling system.
Patent Information
- Application Number
- CN202511504446.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-21
- Publication Date
- 2026-01-16
AI Technical Summary
The existing LLDP protocol cannot directly announce the computing power and memory status of devices. The scheduling system lacks low-level real-time information support, and the encapsulation of resource information into TLV may lead to message redundancy and increase network overhead. It does not consider the integrity and authenticity verification of the announced information, making it easy to be forged and exploited.
The sending device collects computing power and memory resource data at preset intervals, and triggers the LLDP resource announcement process by combining resource change thresholds and periodic announcement rules. Differential encoding and compression operations are performed, and resource data is encapsulated in LLDP messages. After verifying the integrity of the data, the receiving device updates the neighbor resource status table.
It enables real-time notification of key resource data such as CPU load rate, GPU computing power, remaining memory capacity, and memory read/write speed, reducing network overhead, ensuring data integrity and security, providing accurate resource status information support, and improving the decision-making rationality and efficiency of the scheduling system.
Smart Images

Figure CN121349682A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computing power and memory resource notification technology, and in particular to a computing power and memory resource notification method and a computing power and memory resource notification system based on LLDP. Background Technology
[0002] Layer Link Discovery Protocol (LLDP) is a discovery protocol that operates at the link layer and is used to exchange configuration and topology information between adjacent devices. Through the TLV field in LLDP messages, devices can advertise information such as system name, port description, VLAN configuration, etc., and support the organization of specific TLVs for extension.
[0003] In traditional network devices, LLDP is mainly used for topology discovery and basic parameter sharing, lacking descriptions of computing resources. With the development of cloud computing, edge computing, and artificial intelligence, the real-time status of CPU / GPU computing power and memory resources has become a crucial reference indicator for task scheduling and load balancing. Existing LLDP technologies cannot directly announce the computing power and memory status of devices, and scheduling systems lack low-level real-time information support. Most broadcasts are done at fixed intervals, failing to adapt to the needs of dynamically changing resources. Simply encapsulating resource information into TLVs can lead to packet redundancy and increased network overhead. Furthermore, the completeness and authenticity verification of the announced information are not considered, making it vulnerable to forgery and exploitation. Summary of the Invention
[0004] This invention provides a method and system for announcing computing power and memory resources based on LLDP, in order to overcome the deficiencies existing in the prior art.
[0005] On one hand, the present invention provides a method for announcing computing power and memory resources based on LLDP, comprising: S1. The sending device collects its own computing power and memory resource data according to a preset period. The computing power and memory resource data includes CPU load rate, GPU computing power value, remaining memory capacity and memory read and write speed.
[0006] S2. The sending device triggers the LLDP resource notification process based on the collected computing power and memory resource data, combined with the preset resource change threshold and periodic notification rules.
[0007] S3. The sending device processes the resource data that triggers the notification, including differential encoding and compression operations, and encapsulates it into an organization-specific LLDPTLV.
[0008] S4. The sending device sends the encapsulated LLDP message to the adjacent device.
[0009] S5. After receiving the LLDP message, the receiving device first verifies the integrity of the resource data. After successful verification, it parses the resource data in the TLV, updates the local neighbor resource status table, and synchronizes the updated resource table to the upper-layer resource scheduling platform.
[0010] S6. The receiving device maintains and manages the neighbor resource status table, including periodically checking the validity of records, marking invalid records, processing invalid records, and verifying data consistency.
[0011] According to the LLDP-based computing power and memory resource notification method provided by the present invention, in step S1, the process of the sending device collecting its own computing power and memory resource data at a preset period includes: For CPU load rate collection, an independent thread is created to read the system procstat file, extract user-mode and kernel-mode CPU usage time and idle time data, and calculate the average load rate using a sliding window algorithm.
[0012] For collecting GPU computing power values, if the device is equipped with a GPU based on the CUDA architecture, the CUDARuntimeAPI is called to obtain the real-time utilization rate of the GPU cores, the utilization rate of the video memory bandwidth, and the number of active stream processors. The comprehensive GPU computing power value is then calculated using a weighted summation algorithm.
[0013] When collecting the remaining memory capacity, the memory controller is accessed through the sysfs interface to read the total memory capacity, used capacity, and cache usage data, and the actual available remaining memory capacity is calculated.
[0014] When collecting memory read and write speeds, a short-term memory read and write test task is started. By recording the amount of read and write data of memory blocks per unit time, combined with the data from the system's built-in memory performance monitoring interface, the average value algorithm is used to obtain the memory read and write speed.
[0015] According to the LLDP-based computing power and memory resource notification method provided by the present invention, in step S2, the process of triggering the LLDP resource notification process includes: The sending device retrieves the resource data stored during the last notification, compares the currently collected resource data with the historical data one by one, and calculates the differences of various resource data, including the difference in CPU load rate, the difference in GPU computing power, the difference in remaining memory capacity, and the difference in memory read and write speed.
[0016] Read the preset resource change threshold. The resource change threshold can be configured remotely through the resource scheduling platform and can be set separately according to resource type.
[0017] Determine whether the difference between various types of resource data exceeds the preset threshold for the corresponding type. If the difference between any type of resource data exceeds the threshold, immediately trigger the LLDP resource notification process, and record the triggering reason and the current resource data status.
[0018] If the difference between all resource data does not exceed the preset threshold, check the current status of the periodic timer to determine whether the preset periodic notification time has been reached. If it has been reached, the LLDP resource notification process is triggered. If it has not been reached, return to the waiting state and continue to monitor resource data changes and timer status.
[0019] After the notification process is triggered, a notification trigger log is generated, which records the trigger time, trigger type, and current device basic information.
[0020] According to the LLDP-based computing power and memory resource notification method provided by the present invention, step S3, the process of processing and encapsulating resource data includes: The sending device obtains the resource data that triggered the announcement, retrieves the backup of the resource data from the last announcement, and performs differential encoding on the two types of data.
[0021] For CPU load rate and GPU computing power values, integer difference operations are used, subtracting historical data from current data to obtain the difference result. For remaining memory capacity and memory read / write speed, floating-point difference operations are used, calculating the difference between current data and historical data.
[0022] The Huffman compression algorithm is used to compress the differential data. The frequency of each value in the differential data is counted, a Huffman tree is constructed based on the frequency, and the differential data is encoded according to the Huffman coding rules to generate compressed binary data.
[0023] Create an organization-specific LLDPTLV structure, setting a resource type identifier field and a data verification field. The resource type identifier field is used to explicitly identify the type of resource data currently being transmitted. The data verification field is generated using the SHA-256 algorithm, taking the compressed resource data as input to calculate a unique checksum.
[0024] The compressed resource data, resource type identifier field, and data verification field are sequentially filled into the corresponding positions in the LLDPTLV to complete the TLV encapsulation.
[0025] According to the LLDP-based computing power and memory resource notification method provided by the present invention, in step S4, the process of the sending end device sending an LLDP message includes: The sending device obtains the encapsulated LLDPTLV, combines it with the LLDP header to form a complete LLDP message, and checks whether the message format conforms to the preset standard.
[0026] Read the device's network configuration information to determine the network interface currently used to send LLDP messages.
[0027] Check the link status of the sending interface. Use a link detection mechanism to determine if the interface is in a normal connectivity state. If the link is normal, send LLDP packets to the network at the preset sending rate. If the link is abnormal, switch to other backup interfaces.
[0028] The sending status is monitored in real time during message transmission. If the message is successfully sent, the sending time and the address information of the receiving device are recorded. If the transmission fails, the cause of the failure is analyzed. If it is due to temporary network congestion, the message is retransmitted after a preset time.
[0029] According to the LLDP-based computing power and memory resource notification method provided by the present invention, in step S5, the process of the receiving device verifying the integrity of the resource data includes: After receiving the LLDP message, the receiving device performs preliminary parsing of the message, extracts the organization-specific LLDPTLV, and separates the compressed resource data and data verification field in the TLV.
[0030] The receiving end calls the SHA-256 algorithm, taking the extracted compressed resource data as input, and recalculates the checksum.
[0031] The recalculated checksum is compared with the data checksum field extracted from the TLV to determine if they are completely consistent. If they are consistent, it means that the resource data has not been tampered with or damaged during transmission, and the integrity verification passes. If they are inconsistent, it is determined that the data is abnormal, the LLDP message is discarded, a checksum failure log is recorded, and a data anomaly alarm is sent.
[0032] Once verification is successful, a verification pass signal is sent, allowing processing of the compressed resource data.
[0033] According to the LLDP-based computing power and memory resource notification method provided by the present invention, in step S5, the process of the receiving device parsing resource data and updating the neighbor resource status table includes: After receiving the verification signal, the receiving end acquires the compressed resource data, calls the Huffman decompression algorithm to decompress it, restores the compressed binary data to the differentially encoded resource data according to the pre-stored Huffman tree structure, and checks the data integrity during the decompression process.
[0034] Retrieve the resource data from the previous period stored on the sending device in local storage, perform reverse calculations between the differentially encoded resource data and the historical data, and restore the current complete resource data, including CPU load rate, GPU computing power value, remaining memory capacity, and memory read / write speed.
[0035] The restored complete resource data is transmitted to the neighbor resource management system. The local neighbor resource status table is opened, and the record entry corresponding to the sending device is searched. If the entry exists, the original resource data in the entry is updated to the currently restored resource data, and the last update time of the record is also updated. If the entry does not exist, a new record is added to the neighbor resource status table, and the sending device identifier, current resource data, and record creation time are entered.
[0036] The updated neighbor resource status table is sorted and indexed for optimization, and indexes are created according to device identifier and resource type.
[0037] According to the LLDP-based computing power and memory resource notification method provided by the present invention, in step S5, the process of the receiving device synchronizing the updated resource table to the upper-layer resource scheduling platform includes: After the receiving end detects an update to the neighbor's resource status table, it obtains the updated record entries, including the sending end device identifier, the updated resource data, and the update time.
[0038] Establish a communication connection with the upper-level resource scheduling platform. Based on the platform's network address and port information, initiate a connection request using the TCP protocol. If the connection is established successfully, send a synchronization data packet to the platform. If the connection fails, record the connection failure in a log and re-initiate the connection request after a preset time.
[0039] During the synchronization data packet transmission process, confirmation information returned by the platform is received in real time. If a confirmation message indicating successful data reception is received from the platform, a synchronization success log is recorded, completing the synchronization operation. If a data reception failure is received or a timeout occurs without a confirmation message, the cause of the failure is analyzed. If the failure is due to a data transmission error, the synchronization data packet is resent.
[0040] After synchronization is complete, the amount of data synchronized and the synchronization time are counted, a synchronization statistics report is generated and stored in the local log system, and the synchronization success rate is monitored within a preset time. If the success rate is lower than the preset threshold, the problems in the synchronization process are analyzed and the communication parameters or data encapsulation method are optimized.
[0041] According to the LLDP-based computing power and memory resource notification method provided by the present invention, step S6 includes the process of maintaining and managing the neighbor resource status table, which includes: The receiving end initiates a scheduled maintenance task, checks all records in the neighbor resource status table according to the preset maintenance cycle, traverses each record, reads the last update time of the record, and calculates the time difference between the current time and the last update time.
[0042] The calculated time difference is compared with a preset failure time threshold. If the time difference exceeds the failure time threshold, it is determined that the neighboring device corresponding to the record has not updated the resource data in time, and the record is marked as a failure. At the same time, the cause of failure and the failure time are recorded.
[0043] Further processing is performed on records marked as invalid. If the invalidation time is short and does not exceed the preset recovery waiting time, the invalidation record is retained and the neighboring device is allowed to resend resource data. If the invalidation time exceeds the recovery waiting time, or if the record is marked as invalid multiple times consecutively, the invalidation record is deleted from the neighboring resource status table, freeing up storage space, and the deletion operation log is recorded.
[0044] During maintenance, check the data consistency in the neighbor resource status table, compare the resource data sent by the same device at different times, and if abnormal fluctuations or contradictions are found in the data, mark the data as abnormal and send alarm information, and synchronize the abnormal information to the upper-layer resource scheduling platform.
[0045] On the other hand, the present invention also provides a computing power and memory resource notification system based on LLDP, comprising: The resource acquisition module is used by the sending device to collect its own computing power and memory resource data at a preset period. The computing power and memory resource data include CPU load rate, GPU computing power value, memory remaining capacity and memory read and write speed.
[0046] The notification triggering module is used by the sending device to trigger the LLDP resource notification process based on the collected computing power and memory resource data, combined with the preset resource change threshold and periodic notification rules.
[0047] The data encapsulation module is used by the sending device to process the resource data that triggers the notification, including differential encoding and compression operations, and encapsulate it into an organization-specific LLDPTLV.
[0048] The message sending module is used by the sending device to send the encapsulated LLDP message to the adjacent device.
[0049] The data parsing module is used by the receiving device to first verify the integrity of the resource data after receiving the LLDP message. After successful verification, the resource data in the TLV is parsed, the local neighbor resource status table is updated, and the updated resource table is synchronized to the upper-layer resource scheduling platform.
[0050] The status maintenance module is used by the receiving device to maintain and manage the neighbor resource status table, including periodically checking the validity of records, marking invalid records, processing invalid records, and verifying data consistency.
[0051] This invention provides a computing power and memory resource notification method and system based on LLDP, which brings multi-dimensional benefits through systematic optimization design. In terms of expanding resource information dimensions, it breaks through the limitation of traditional LLDP, which can only transmit topology and basic configuration information, by including key computing resource data such as CPU load rate, GPU computing power, remaining memory capacity, and memory read / write speed in the notification scope. This allows adjacent devices and upper-layer scheduling platforms to directly obtain low-level real-time resource status, providing accurate data support for task scheduling and load balancing in cloud computing, edge computing, and artificial intelligence scenarios. It also solves the problem of decision lag or bias caused by the lack of underlying resource information in scheduling systems.
[0052] In terms of improving the flexibility of the notification mechanism, the traditional fixed-period broadcast mode has been abandoned, and a triggering method combining resource change thresholds and periodic notifications has been adopted. When resource data fluctuations exceed the preset threshold, a notification can be initiated immediately to ensure that dynamic changes in resources can be captured in a timely manner; when there are no significant changes, notifications are issued at a low frequency, which not only ensures the timeliness of resource information but also avoids unnecessary frequent broadcasts, adapting to the actual needs of dynamic changes in resource status and reducing invalid network transmission behavior.
[0053] In terms of network overhead control, the resource data that triggers the announcement is first differentially encoded, retaining only the differences from historical data. Then, compression is performed to further reduce the data volume before encapsulation into an organization-specific LLDPTLV. This processing method significantly reduces the redundancy of resource data during encapsulation and transmission, effectively controls the size of LLDP messages, alleviates network bandwidth pressure, avoids increased network overhead caused by resource information transmission, and ensures overall network transmission efficiency.
[0054] In terms of information security, a data verification field is added to the organization's specific LLDPTLV. The verification mechanism verifies the integrity and authenticity of resource data, which can effectively identify whether the data has been tampered with or forged during transmission, prevent false resource information from interfering with scheduling decisions, solve the security risks caused by the lack of information security verification in traditional LLDP, and improve the credibility and security of the resource announcement process.
[0055] In addition, the receiving device's maintenance and management mechanism for the neighbor resource status table ensures the timeliness and accuracy of the data in the neighbor resource status table by regularly checking the validity of records, marking and processing invalid records, and verifying data consistency. This provides a reliable resource data foundation for the upper-layer resource scheduling platform, further improving the rationality and effectiveness of scheduling decisions and helping to improve the overall efficiency of resource utilization in various computing scenarios. Attached Figure Description
[0056] To more clearly illustrate the technical solutions in this 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 some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0057] Figure 1 This is a flowchart illustrating a method for announcing computing power and memory resources based on LLDP, provided in an embodiment of the present invention. Figure 2 This is a block diagram of a resource notification system based on LLDP in an embodiment of the present invention; Figure 3 This is a flowchart of the sending end resource acquisition and LLDP message construction in an embodiment of the present invention; Figure 4 This is a flowchart of the receiving end LLDP message parsing and resource update process in an embodiment of the present invention; Figure 5 This is a schematic diagram of the structure of a computing power and memory resource notification system based on LLDP provided in an embodiment of the present invention. Detailed Implementation
[0058] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0059] The following is combined Figures 1-5 This invention describes a method and system for announcing computing power and memory resources based on LLDP.
[0060] Figure 1 This is a flowchart illustrating a method for announcing computing power and memory resources based on LLDP, provided in an embodiment of the present invention.
[0061] like Figure 1 As shown in the figure, the present invention provides a method and system for announcing computing power and memory resources based on LLDP. The executing entity can be an LLDP-based method for announcing computing power and memory resources, and the method includes: S1. The sending device collects its own computing power and memory resource data according to a preset period. The computing power and memory resource data includes CPU load rate, GPU computing power value, remaining memory capacity and memory read and write speed.
[0062] The process by which the sending device collects its own computing power and memory resource data at a preset period includes: For CPU load rate collection, an independent thread is created to read the system procstat file, extract user-mode and kernel-mode CPU usage time and idle time data, and calculate the average load rate using a sliding window algorithm.
[0063] For collecting GPU computing power values, if the device is equipped with a GPU based on the CUDA architecture, the CUDARuntimeAPI is called to obtain the real-time utilization rate of the GPU cores, the utilization rate of the video memory bandwidth, and the number of active stream processors. The comprehensive GPU computing power value is then calculated using a weighted summation algorithm.
[0064] When collecting the remaining memory capacity, the memory controller is accessed through the sysfs interface to read the total memory capacity, used capacity, and cache usage data, and the actual available remaining memory capacity is calculated.
[0065] When collecting memory read and write speeds, a short-term memory read and write test task is started. By recording the amount of read and write data of memory blocks per unit time, combined with the data from the system's built-in memory performance monitoring interface, the average value algorithm is used to obtain the memory read and write speed.
[0066] S2. The sending device, based on the collected computing power and memory resource data, and in conjunction with preset resource change thresholds and periodic notification rules, triggers the LLDP resource notification process, which includes: The sending device retrieves the resource data stored during the last notification, compares the currently collected resource data with the historical data one by one, and calculates the differences of various resource data, including the difference in CPU load rate, the difference in GPU computing power, the difference in remaining memory capacity, and the difference in memory read and write speed.
[0067] Read the preset resource change threshold. The resource change threshold can be configured remotely through the resource scheduling platform and can be set separately according to resource type. The threshold range for different resource types can be set according to the needs of the scenario.
[0068] Determine whether the difference between various types of resource data exceeds the preset threshold for the corresponding type. If the difference between any type of resource data exceeds the threshold, immediately trigger the LLDP resource notification process, and record the triggering reason and the current resource data status.
[0069] If the difference between all resource data does not exceed the preset threshold, check the current status of the periodic timer to determine whether the preset periodic notification time has been reached. If it has been reached, the LLDP resource notification process is triggered. If it has not been reached, return to the waiting state and continue to monitor resource data changes and timer status.
[0070] After the notification process is triggered, a notification trigger log is generated, which records the trigger time, trigger type, and current device basic information.
[0071] S3. The sending device processes the resource data that triggers the notification, including differential encoding and compression operations, and encapsulates it into an organization-specific LLDPTLV. The process includes: The sending device obtains the resource data that triggered the announcement, retrieves the backup of the resource data from the last announcement, and performs differential encoding on the two types of data.
[0072] For CPU load rate and GPU computing power values, integer difference operations are used, subtracting historical data from current data to obtain the difference result. For remaining memory capacity and memory read / write speed, floating-point difference operations are used, calculating the difference between current data and historical data.
[0073] The Huffman compression algorithm is used to compress the differential data. The frequency of each value in the differential data is counted, a Huffman tree is constructed based on the frequency, and the differential data is encoded according to the Huffman coding rules to generate compressed binary data.
[0074] Create an organization-specific LLDPTLV structure, setting a resource type identifier field and a data verification field. The resource type identifier field clearly identifies the type of resource data being transmitted, with different identifier values corresponding to different resource types. The data verification field is generated using the SHA-256 algorithm, taking the compressed resource data as input to calculate a unique verification value, used to ensure the integrity and security of data transmission.
[0075] The compressed resource data, resource type identifier field, and data verification field are sequentially filled into the corresponding positions in the LLDPTLV to complete the TLV encapsulation.
[0076] S4. The sending device sends the encapsulated LLDP message to the adjacent device. The process includes: The sending device obtains the encapsulated LLDPTLV and combines it with the LLDP header to form a complete LLDP message, while checking whether the message format conforms to the IEEE 802.1AB standard.
[0077] Read the device's network configuration information to determine the network interface currently used to send LLDP messages. If the device has multiple network interfaces, select the interface with the highest priority as the sending interface according to the interface priority pre-configured by the resource scheduling platform.
[0078] Check the link status of the sending interface. Use a link detection mechanism to determine if the interface is in a normal connectivity state. If the link is normal, send LLDP packets to the network at the preset sending rate. If the link is abnormal, switch to other backup interfaces.
[0079] During message transmission, the transmission status is monitored in real time. If the message is successfully transmitted, the transmission time and the address information of the receiving device are recorded. If transmission fails, the cause of failure is analyzed. If it is due to temporary network congestion, the message is retransmitted after a preset time. If it is a permanent fault, transmission is stopped and the fault information is reported.
[0080] S5. After receiving the LLDP message, the receiving device first verifies the integrity of the resource data. After successful verification, it parses the resource data in the TLV, updates the local neighbor resource status table, and synchronizes the updated resource table to the upper-layer resource scheduling platform.
[0081] The process by which the receiving device verifies the integrity of resource data includes: After receiving the LLDP message, the receiving device performs preliminary parsing of the message, extracts the organization-specific LLDPTLV, separates the compressed resource data and data verification field in the TLV, and checks whether the TLV structure is complete.
[0082] The receiving end calls the SHA-256 algorithm, takes the extracted compressed resource data as input, and recalculates the checksum. During the calculation process, it strictly follows the same algorithm parameters as the sending end.
[0083] The recalculated checksum is compared with the data checksum field extracted from the TLV to determine if they are completely consistent. If they are consistent, it means that the resource data has not been tampered with or damaged during transmission, and the integrity verification passes. If they are inconsistent, it is determined that the data is abnormal, the LLDP message is discarded, a checksum failure log is recorded, and a data anomaly alarm is sent.
[0084] Upon successful verification, a verification pass signal is sent, allowing processing of compressed resource data. If verification fails, logs and alarms are recorded, and the number of verification failures within a preset time period is counted. If the number exceeds a preset threshold, the network security check process of the receiving device is triggered.
[0085] The process by which the receiving device parses resource data and updates the neighbor resource status table includes: After receiving the verification signal, the receiving end obtains the compressed resource data, calls the Huffman decompression algorithm to decompress it, restores the compressed binary data to the differentially encoded resource data according to the pre-stored Huffman tree structure, and checks the data integrity during the decompression process. If data loss or error occurs, it re-requests the sending end device to send the message.
[0086] The system retrieves the resource data from the previous data of the sending device stored locally. It then performs a reverse operation on the differentially encoded resource data and the historical data to recover the current complete resource data, including CPU load rate, GPU computing power value, remaining memory capacity and memory read / write speed. During the recovery process, the data is checked for range to ensure that the data conforms to the actual device resource range. If the data exceeds the reasonable range, it is marked as abnormal and processed accordingly.
[0087] The restored complete resource data is transmitted to the neighbor resource management system. The local neighbor resource status table is opened, and the record entry corresponding to the sending device is searched. If the entry exists, the original resource data in the entry is updated to the currently restored resource data, and the last update time of the record is also updated. If the entry does not exist, a new record is added to the neighbor resource status table, and the sending device identifier, current resource data, and record creation time are entered.
[0088] The updated neighbor resource status table is sorted and indexed for optimization. Indexes are created based on device identifiers and resource types to facilitate quick subsequent queries. At the same time, the storage space of the neighbor resource status table is checked. If the storage space is about to run out, the oldest invalid record that has not been updated is deleted based on the last update time.
[0089] The process by which the receiving device synchronizes the updated resource table to the upper-layer resource scheduling platform includes: After the receiving end detects an update to the neighbor's resource status table, it obtains the updated record entries, including the sending end device identifier, the updated resource data, and the update time. It then performs format conversion on this data and encapsulates it into a compliant synchronization data packet according to the data format and protocol specifications stipulated by the resource scheduling platform.
[0090] Establish a communication connection with the upper-layer resource scheduling platform. Based on the platform's network address and port information, initiate a connection request using the TCP protocol. If the connection is established successfully, send a synchronization data packet to the platform. If the connection fails, record the connection failure log, wait for a preset time, and then re-initiate the connection request. Simultaneously, attempt to switch to the platform's backup communication address.
[0091] During the synchronization data packet transmission process, confirmation information returned by the platform is received in real time. If a confirmation message indicating successful data reception is received from the platform, a synchronization success log is recorded, completing the synchronization operation. If a data reception failure is received or a timeout occurs without a confirmation message, the cause of the failure is analyzed. If it is due to a data transmission error, the synchronization data packet is resent. If it is due to a platform processing error, synchronization is resumed only after the platform recovers.
[0092] After synchronization is complete, the amount of data synchronized and the synchronization time are counted, a synchronization statistics report is generated and stored in the local log system, and the synchronization success rate is monitored within a preset time. If the success rate is lower than the preset threshold, the problems in the synchronization process are analyzed and the communication parameters or data encapsulation method are optimized.
[0093] S6. The receiving device maintains and manages the neighbor resource status table, including periodically checking the validity of records, marking invalid records, processing invalid records, and verifying data consistency, to ensure the timeliness and accuracy of the data in the neighbor resource status table.
[0094] The process of maintaining and managing the neighbor resource status table includes: The receiving end initiates a scheduled maintenance task, checks all records in the neighbor resource status table according to the preset maintenance cycle, traverses each record, reads the last update time of the record, and calculates the time difference between the current time and the last update time.
[0095] The calculated time difference is compared with a preset failure time threshold. If the time difference exceeds the failure time threshold, it is determined that the neighboring device corresponding to the record has not updated the resource data in time, and the record is marked as a failure. At the same time, the cause of failure and the failure time are recorded.
[0096] Further processing is performed on records marked as invalid. If the invalidation time is short and does not exceed the preset recovery waiting time, the invalidation record is retained and the neighboring device is allowed to resend resource data. If the invalidation time exceeds the recovery waiting time, or if the record is marked as invalid multiple times consecutively, the invalidation record is deleted from the neighboring resource status table, freeing up storage space, and the deletion operation log is recorded.
[0097] During maintenance, check the data consistency in the neighbor resource status table, compare the resource data sent by the same device at different times, and if abnormal fluctuations or contradictions are found in the data, mark the data as abnormal and send alarm information, and synchronize the abnormal information to the upper-layer resource scheduling platform.
[0098] In summary, this embodiment provides a computing power and memory resource notification method based on LLDP, which brings multi-dimensional benefits through systematic optimization design. In terms of expanding the resource information dimension, it breaks through the limitation of traditional LLDP, which can only transmit topology and basic configuration information, by including key computing resource data such as CPU load rate, GPU computing power value, remaining memory capacity, and memory read / write speed in the notification scope. This allows adjacent devices and upper-layer scheduling platforms to directly obtain low-level real-time resource status, providing accurate data support for task scheduling and load balancing in cloud computing, edge computing, and artificial intelligence scenarios. It also solves the problem of decision lag or bias caused by the lack of underlying resource information in scheduling systems.
[0099] In terms of improving the flexibility of the notification mechanism, the traditional fixed-period broadcast mode has been abandoned, and a triggering method combining resource change thresholds and periodic notifications has been adopted. When resource data fluctuations exceed the preset threshold, a notification can be initiated immediately to ensure that dynamic changes in resources can be captured in a timely manner; when there are no significant changes, notifications are issued at a low frequency, which not only ensures the timeliness of resource information but also avoids unnecessary frequent broadcasts, adapting to the actual needs of dynamic changes in resource status and reducing invalid network transmission behavior.
[0100] In terms of network overhead control, the resource data that triggers the announcement is first differentially encoded, retaining only the differences from historical data. Then, compression is performed to further reduce the data volume before encapsulation into an organization-specific LLDPTLV. This processing method significantly reduces the redundancy of resource data during encapsulation and transmission, effectively controls the size of LLDP messages, alleviates network bandwidth pressure, avoids increased network overhead caused by resource information transmission, and ensures overall network transmission efficiency.
[0101] In terms of information security, a data verification field is added to the organization's specific LLDPTLV. The verification mechanism verifies the integrity and authenticity of resource data, which can effectively identify whether the data has been tampered with or forged during transmission, prevent false resource information from interfering with scheduling decisions, solve the security risks caused by the lack of information security verification in traditional LLDP, and improve the credibility and security of the resource announcement process.
[0102] In addition, the receiving device's maintenance and management mechanism for the neighbor resource status table ensures the timeliness and accuracy of the data in the neighbor resource status table by regularly checking the validity of records, marking and processing invalid records, and verifying data consistency. This provides a reliable resource data foundation for the upper-layer resource scheduling platform, further improving the rationality and effectiveness of scheduling decisions and helping to improve the overall efficiency of resource utilization in various computing scenarios.
[0103] Based on the same general inventive concept, this invention also protects an LLDP-based computing power and memory resource notification system. The following describes an LLDP-based computing power and memory resource notification system provided by this invention. The LLDP-based computing power and memory resource notification system described below and the LLDP-based computing power and memory resource notification method described above can be referred to in correspondence.
[0104] Figure 5 This is a schematic diagram of the structure of a computing power and memory resource notification system based on LLDP provided in an embodiment of the present invention.
[0105] like Figure 5As shown, a computing power and memory resource notification system based on LLDP includes a memory, a processor, and a computer program stored in the memory and capable of running on the processor. The processor includes: a resource acquisition module, a notification triggering module, a data encapsulation module, a message sending module, a data parsing module, and a status maintenance module.
[0106] The resource acquisition module is used by the sending device to collect its own computing power and memory resource data at a preset period. The computing power and memory resource data include CPU load rate, GPU computing power value, memory remaining capacity and memory read and write speed.
[0107] The notification triggering module is used by the sending device to trigger the LLDP resource notification process based on the collected computing power and memory resource data, combined with the preset resource change threshold and periodic notification rules.
[0108] The data encapsulation module is used by the sending device to process the resource data that triggers the notification, including differential encoding and compression operations, and encapsulate it into an organization-specific LLDPTLV.
[0109] The message sending module is used by the sending device to send the encapsulated LLDP message to the adjacent device.
[0110] The data parsing module is used by the receiving device to first verify the integrity of the resource data after receiving the LLDP message. After successful verification, it parses the resource data in the TLV, updates the local neighbor resource status table, and synchronizes the updated resource table to the upper-layer resource scheduling platform.
[0111] The status maintenance module is used by the receiving device to maintain and manage the neighbor resource status table, including periodically checking the validity of records, marking invalid records, processing invalid records, and verifying data consistency.
[0112] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0113] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for announcing computing power and memory resources based on LLDP, characterized in that, Comprise: S1, the sending end equipment collects its own computing power and memory resource data according to the preset period, the computing power and memory resource data includes CPU load rate, GPU computing power value, memory remaining capacity and memory read-write speed; S2, the sending end equipment triggers the LLDP resource notification process according to the collected computing power and memory resource data, combined with the preset resource change threshold and periodic notification rule; S3, the sending end equipment carries out data processing on the triggered notification resource data, including differential encoding and compression operation, and encapsulates into organization-specific LLDP TLV; S4, the sending end equipment sends the encapsulated LLDP packet to the adjacent device; S5, after the receiving end equipment receives the LLDP packet, it first verifies the integrity of the resource data, and after verification, it parses the resource data in the TLV, updates the local neighbor resource state table, and synchronizes the updated resource table to the upper layer resource scheduling platform; S6, the receiving end equipment maintains and manages the neighbor resource state table, including periodic checking of record validity, marking invalid records, processing invalid records and checking data consistency.
2. The LLDP-based computing power and memory resource announcement method according to claim 1, wherein, In step S1, the process of the sending end equipment collecting its own computing power and memory resource data according to the preset period includes: For CPU load rate collection, create an independent thread to read the system procstat file, extract user state, kernel state CPU occupation time and idle time data, and calculate the average load rate through sliding window algorithm; For GPU computing power value collection, if the device is equipped with a GPU based on CUDA architecture, call CUDARuntimeAPI to obtain GPU core real-time utilization, memory bandwidth occupancy and stream processor active number, and calculate the comprehensive GPU computing power value through weighted summation algorithm; When collecting memory remaining capacity, access the memory controller through sysfs interface to read memory total capacity, used capacity and cache occupied capacity data, and calculate the actual allocable memory remaining capacity; When collecting memory read-write speed, start a short-term memory read-write test task, record the read-write data amount of memory block per unit time, combine with the system's own memory performance monitoring interface data, and use the average value algorithm to obtain the memory read-write speed.
3. The method of claim 1, wherein the method further comprises: In step S2, the process of triggering the LLDP resource notification process includes: The sending end equipment calls the resource data stored when the last notification, compares the current collected resource data with the historical data one by one, calculates the difference value of each type of resource data, including CPU load rate difference, GPU computing power value difference, memory remaining capacity difference and memory read-write speed difference; Read the preset resource change threshold, the resource change threshold is configured remotely by the resource scheduling platform, and can be set separately according to resource type; Determine whether the difference value of each type of resource data exceeds the preset threshold of the corresponding type, if the difference value of any type of resource data exceeds the threshold, trigger the LLDP resource notification process immediately, and record the trigger reason and current resource data state; If all resource data difference values do not exceed the preset threshold, the current state of the check period timer is checked to determine whether the preset periodic announcement time is reached. If the preset periodic announcement time is reached, the LLDP resource announcement process is triggered. If the preset periodic announcement time is not reached, the waiting state is returned, and the resource data change and the timer state continue to be monitored. After the announcement process is triggered, an announcement trigger log is generated to record the trigger time, the trigger type, and the current device basic information.
4. The LLDP-based computing power and memory resource announcement method of claim 1, wherein, In step S3, the process of processing and packaging the resource data includes: The sending end device obtains the resource data triggering the announcement, calls the resource data backup at the last announcement, and performs differential encoding processing on the two types of data. For the CPU load rate and GPU computing capacity value, integer differential operation is adopted, and the difference result is obtained by subtracting the historical data from the current data. For the memory remaining capacity and memory read-write rate, floating-point differential operation is adopted, and the difference value between the current data and the historical data is calculated. Huffman compression algorithm is adopted to compress the differential data. The frequency of each value in the differential data is counted, a Huffman tree is constructed according to the frequency, the differential data is encoded according to the Huffman encoding rule, and binary compressed data is generated. An organization-specific LLDP TLV structure is created, and a resource type identification field and a data verification field are set. The resource type identification field is used to explicitly identify the type of the resource data currently transmitted. The data verification field is generated by the SHA-256 algorithm, and the compressed resource data is used as the input to calculate a unique verification value. The compressed resource data, the resource type identification field, and the data verification field are sequentially filled into the corresponding positions of the LLDP TLV to complete the TLV packaging.
5. The method of claim 1, wherein the method further comprises: In step S4, the process of sending the LLDP packet by the sending end device includes: The sending end device obtains the packaged LLDP TLV, combines it with the LLDP header to form a complete LLDP packet, and checks whether the packet format meets the preset standard. The network configuration information of the device is read to determine the network interface currently used to send the LLDP packet. The link state of the sending interface is checked to determine whether the interface is in a normal connected state through a link detection mechanism. If the link is normal, the LLDP packet is sent to the network at a preset sending rate. If the link is abnormal, the device switches to another backup interface. The sending state is monitored in real time during the packet sending process. If the packet is sent successfully, the sending time and the receiving device address information are recorded. If the sending fails, the reason for the failure is analyzed. If it is temporary network congestion, the packet is resent after a preset time.
6. The LLDP-based computing power and memory resource announcement method according to claim 1, wherein, In step S5, the process of verifying the integrity of the resource data by the receiving end device includes: After receiving the LLDP packet, the receiving end device performs preliminary analysis on the packet, extracts the organization-specific LLDP TLV therefrom, and separates the compressed resource data and the data verification field in the TLV. The receiving end calls the SHA-256 algorithm, and inputs the extracted compressed resource data to recalculate the verification value. The re-calculated check value is compared with the data check field extracted from the TLV to determine whether they are completely consistent. If they are consistent, it indicates that the resource data has not been tampered with or damaged during transmission, and the integrity verification is passed. If they are not consistent, it is determined that the data is abnormal, the LLDP packet is discarded, and a check failure log is recorded, and a data exception alarm is sent. After the verification is passed, a verification pass signal is sent to allow the compressed resource data to be processed.
7. The method of claim 1, wherein the method is based on LLDP. In step S5, the process of the receiving end device parsing the resource data and updating the neighbor resource state table includes: After receiving the verification pass signal, the receiving end obtains the compressed resource data, calls the Huffman decompression algorithm to decompress it, restores the binary data after compression to the resource data after differential encoding according to the pre-stored Huffman tree structure, and checks the data integrity during decompression; The last resource data of the sending end device stored locally is called, and the differential encoded resource data is reversely operated with the historical data to restore the current complete resource data, including CPU load rate, GPU computing capability value, memory remaining capacity and memory read / write rate; The restored complete resource data is transmitted to the neighbor resource management, the local neighbor resource state table is opened, the corresponding record entry of the sending end device is searched, if the entry exists, the original resource data in the entry is updated to the current restored resource data, and the last update time of the record is updated; if the entry does not exist, a new record is added in the neighbor resource state table, and the sending end device identifier, the current resource data and the record creation time are filled in. The updated neighbor resource state table is sorted and indexed to establish an index according to the device identifier and the resource type.
8. The method of claim 1, wherein the method is based on LLDP. In step S5, the process of the receiving end device synchronizing the updated resource table to the upper layer resource scheduling platform includes: After the neighbor resource state table is updated, the receiving end obtains the updated record entry, including the sending end device identifier, the updated resource data and the update time; A communication connection with the upper layer resource scheduling platform is established, a connection request is initiated using the TCP protocol according to the network address and port information of the platform, if the connection is successfully established, a synchronization data packet is sent to the platform; if the connection fails, a connection failure log is recorded, and the connection request is re-initiated after a preset time; During the synchronization data packet sending process, the confirmation information returned by the platform is received in real time, if the data reception success confirmation information sent by the platform is received, a synchronization success log is recorded, and the synchronization operation is completed; if the data reception fails or no confirmation information is received within a timeout, the failure reason is analyzed, and if the data transmission is incorrect, the synchronization data packet is re-sent; After synchronization is completed, the data volume and synchronization time consumption information of this synchronization are counted, a synchronization statistical report is generated, and stored in the local log system, and the synchronization success rate within a preset time is monitored, if the success rate is lower than a preset threshold, the problems in the synchronization process are analyzed, and the communication parameters or data encapsulation method are optimized.
9. The method of claim 1, wherein the method is based on LLDP. In step S6, the process of maintaining and managing the neighbor resource state table includes: The receiving end starts a timing maintenance task, checks all records in the neighbor resource state table according to a preset maintenance period, traverses each record, reads the last update time of the record, and calculates the time difference between the current time and the last update time; The calculated time difference is compared with a preset invalidation time threshold, if the time difference exceeds the invalidation time threshold, it is determined that the neighbor device corresponding to the record has not updated the resource data in time, the record is marked as invalid, and the invalidation reason and invalidation time are recorded; The invalid record is further processed, if the record invalidation time is short and does not exceed a preset recovery waiting time, the invalid record is retained and the neighbor device is waited for to resend the resource data again; if the invalidation time exceeds the recovery waiting time or is marked as invalid for a plurality of times in succession, the invalid record is deleted from the neighbor resource state table, the storage space is released, and a deletion operation log is recorded; In the maintenance process, the data consistency in the neighbor resource state table is checked, the resource data sent by the same device at different times is compared, if it is found that the data exists abnormal fluctuation or contradiction, the data is marked as abnormal and an alarm information is sent, and the abnormal information is synchronized to an upper resource scheduling platform. 10.A computing power and memory resource advertisement system based on LLDP, comprising a memory, a processor and a computer program stored in the memory and capable of running on the processor, characterized in that, The processor implements the LLDP-based computing power and memory resource advertisement method in any one of claims 1 to 9 when executing the program.