Adaptive method and device for multi-protocol printing communication interface of relay protection device

By adaptively selecting the target communication protocol, the low latency and high bandwidth requirements of relay protection devices when processing high real-time control commands or large-capacity waveform data are solved, achieving more efficient transmission and output.

CN122248081APending Publication Date: 2026-06-19GUOHUA ENERGY INVESTMENT +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUOHUA ENERGY INVESTMENT
Filing Date
2026-02-03
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

The existing relay protection device's printed communication interface cannot dynamically adjust the protocol configuration, making it difficult to simultaneously meet the requirements of low latency and high bandwidth when processing high real-time control commands or large-capacity waveform data, which can easily lead to transmission delays or data loss.

Method used

By obtaining the content type of the printing task data, a task content requirement vector is generated. The similarity of the protocol performance vector of each candidate communication protocol is calculated, and the target communication protocol is adaptively selected to ensure that the protocol performance is accurately matched with the task requirements.

Benefits of technology

It significantly improves task matching efficiency, reduces transmission latency, and enhances the real-time performance and reliability of print output.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122248081A_ABST
    Figure CN122248081A_ABST
Patent Text Reader

Abstract

This invention discloses an adaptive method and apparatus for a multi-protocol printing communication interface of a relay protection device, relating to the technical field of relay protection devices. It solves the technical problem that when processing high-real-time control commands or large-capacity waveform data, it is difficult to simultaneously meet the requirements of low latency and high bandwidth, easily leading to transmission delays or data loss. The method includes: acquiring printing task data generated by the relay protection device; generating a task content requirement vector based on the content type of the printing task data; generating a corresponding protocol performance vector based on the historical operating performance data of each candidate communication protocol; calculating the similarity between the task content requirement vector and each protocol performance vector to obtain a suitability score for each candidate communication protocol; determining the target communication protocol based on the suitability score; and transmitting and outputting the printing task data according to the target communication protocol.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of relay protection device technology, and in particular to an adaptive method and apparatus for multi-protocol printed communication interface of relay protection device. Background Technology

[0002] In recent years, relay protection devices have become core equipment for the safe operation of power systems. Their printing communication interfaces are used to transmit information such as protection action records, waveform data, and control commands to printing devices for output. As the requirements of power systems for data transmission efficiency and reliability increase, relay protection devices need to support multiple communication protocols (such as USB, RS232, and Ethernet) to adapt to different printing devices and task scenarios.

[0003] Existing relay protection devices typically use fixed protocols for their printing communication interfaces, with preset single performance parameters (such as fixed bandwidth or delay settings). This makes it impossible to dynamically adjust the protocol configuration according to the type of printing task, resulting in difficulty in simultaneously meeting the requirements of low latency and high bandwidth when processing high real-time control commands or large-capacity waveform data, which can easily lead to transmission delays or data loss. Summary of the Invention

[0004] In view of this, the present invention provides an adaptive method and apparatus for multi-protocol printed communication interface of relay protection device, which can solve the technical problem that it is difficult to meet the requirements of low latency and high bandwidth at the same time when processing high real-time control commands or large-capacity waveform data, which easily causes transmission delay or data loss.

[0005] According to one aspect of the present invention, an adaptive method for a multi-protocol printed communication interface of a relay protection device is provided, the method comprising:

[0006] Obtain the printing task data generated by the relay protection device, and determine the content type of the printing task data; Generate a task content requirement vector based on the content type; Obtain historical performance data for each candidate communication protocol, and generate a protocol performance vector for each candidate communication protocol based on the historical performance data. Calculate the similarity between the task content requirement vector and each of the protocol performance vectors to obtain the corresponding fit score for each candidate communication protocol; Based on the fit score and all the candidate communication protocols, a target communication protocol is determined to transmit and output the printing task data according to the target communication protocol.

[0007] Preferably, the content type is a control instruction type, and the step of generating a task content requirement vector based on the content type includes: Extract the target instruction priority and time constraint features from the print task data; The priority value is determined according to the target instruction priority and the first preset mapping rule, and the priority value is normalized to obtain the priority weight. The time constraint weight is determined based on the time constraint feature and the preset benchmark threshold corresponding to the time constraint feature; Based on the priority weight and the time constraint weight, a control instruction requirement vector is generated, and the control instruction requirement vector is determined as the task content requirement vector.

[0008] Preferably, the content type is a waveform data type, and the step of generating a task content requirement vector based on the content type includes: Determine whether the print task data is real-time sampled waveform data, and determine whether the print task data is historical waveform data; If the print task data is neither the real-time sampled waveform data nor the historical waveform data, then the sampling frequency and data volume characteristics in the print task data are extracted, and a waveform data demand vector is generated based on the sampling frequency and data volume characteristics. The waveform data demand vector is then determined as the task content demand vector. If the printing task data is the real-time sampled waveform data, then monitor the transmission process, calculate the frequency change rate weight and peak ratio weight, generate a dynamic demand sub-vector based on the frequency change rate weight and peak ratio weight, and generate a task content demand vector based on the dynamic demand sub-vector and the waveform data demand vector. If the print task data is historical waveform data, then extract the contextual features from the print task data, calculate the data dependency weight based on the contextual features, calculate the error recovery requirement weight, generate a contextual requirement sub-vector based on the data dependency weight and the error recovery requirement weight, and generate a task content requirement vector based on the contextual requirement sub-vector and the waveform data requirement vector.

[0009] Preferably, generating the waveform data demand vector based on the sampling frequency and the data volume characteristics includes: Calculate the frequency weight based on the sampling frequency and the preset system maximum sampling frequency; Calculate the data volume weight based on the data volume characteristics and the preset maximum data volume corresponding to the data volume characteristics; A waveform data demand vector is generated based on the frequency weight and the data volume weight.

[0010] Preferably, the calculation of the frequency change rate weight and the peak value ratio weight includes: Sort the data packets in ascending order based on the difference between their timestamps and the current time. Take the first N data packets as the first target data packets. Obtain the first data packet size, the number of sampling points within the packet, and the target timestamp for each first target data packet. Calculate the current actual sampling frequency based on the number of sampling points within the packet and the target timestamp. Calculate the frequency change rate based on the current actual sampling frequency and the sampling frequency. Calculate the frequency change rate weight based on the frequency change rate and the preset maximum allowable change rate. The data packets within the current time window are used as the second target data packets, wherein the last moment of the current time window is the current moment. The size of the second data packet for each second target data packet is obtained, the peak data volume ratio is calculated based on the size of the second data packet, and the peak ratio weight is determined based on the peak data volume ratio and the second preset mapping rule.

[0011] Preferably, the step of extracting contextual features from the printing task data and calculating data dependency weights based on the contextual features includes: Extract the expected total number of data packets from the printing task data, count the actual total number of valid data packets received, calculate the sequence continuity score based on the expected total number of data packets and the actual total number of valid data packets, and use the sequence continuity score as the data dependency weight. The calculation of error recovery requirement weights includes: Obtain the historical packet loss rate and the preset allowable packet loss threshold, and calculate the error recovery requirement weight based on the historical packet loss rate and the allowable packet loss threshold.

[0012] Preferably, the step of calculating the similarity between the task content requirement vector and each of the protocol performance vectors to obtain the corresponding suitability score for each candidate communication protocol includes: The task content requirement vector and all the protocol performance vectors are unified into a three-dimensional vector including bandwidth, latency and fault tolerance dimensions, and the corresponding modified task content requirement vector and the protocol performance vector of each candidate communication protocol are obtained. Calculate the bandwidth dimension vector in the corrected task content requirement vector, and compare it with the bandwidth dimension vector in each of the protocol performance vectors to calculate the bandwidth dimension similarity for each candidate communication protocol. Calculate the vector of the delay dimension in the corrected task content requirement vector, and compare it with the vector of the delay dimension in each of the protocol performance vectors to calculate the similarity of the delay dimension to each candidate communication protocol. Calculate the vector of the fault tolerance dimension in the corrected task content requirement vector, and compare it with the vector of the fault tolerance dimension in each of the protocol performance vectors to calculate the similarity of the fault tolerance dimension for each candidate communication protocol. Based on the similarity of the bandwidth dimension, the similarity of the delay dimension, and the similarity of the fault tolerance dimension corresponding to the same candidate communication protocol, the similarity is calculated and used as the fit score of the candidate communication protocol. The step of determining the target communication protocol based on the fit score and all the candidate communication protocols includes: Determine whether the largest fit score among all the fit scores is greater than a first preset threshold. If so, then take the candidate communication protocol corresponding to the largest fit score as the target communication protocol. If not, then each of the fit scores is traversed in descending order, and the first candidate communication protocol that passes the preset condition is taken as the target communication protocol. The preset condition is that at least one of the bandwidth dimension similarity, the latency dimension similarity and the fault tolerance dimension similarity is greater than a second preset threshold. If the number of candidate communication protocols that meet the preset conditions is 0, then the default communication protocol in the default protocol configuration parameters will be used as the target communication protocol.

[0013] According to another aspect of the present invention, a multi-protocol printing communication interface adaptive device for relay protection devices is provided, the device comprising: The acquisition module is used to acquire printing task data generated by the relay protection device and determine the content type of the printing task data; The first generation module is used to generate a task content requirement vector based on the content type. The second generation module is used to obtain historical performance data of each candidate communication protocol and generate a protocol performance vector corresponding to each candidate communication protocol based on the historical performance data. The calculation module is used to calculate the similarity between the task content requirement vector and each of the protocol performance vectors, and to obtain the corresponding fit score for each of the candidate communication protocols. The determination module is used to determine the target communication protocol based on the fit score and all the candidate communication protocols, so as to transmit and output the printing task data according to the target communication protocol.

[0014] According to another aspect of the present invention, a storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the above-described adaptive method for multi-protocol printing communication interface of relay protection device.

[0015] According to another aspect of the present invention, a computer device is provided, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor, when executing the program, implements the above-described adaptive method for multi-protocol printing communication interface of relay protection device.

[0016] By employing the above technical solution, the present invention provides an adaptive method and apparatus for multi-protocol printing communication interfaces of relay protection devices. Through this invention, a task content requirement vector is generated based on the content type of the printing task data. A fit score is then calculated between this vector and the protocol performance vector corresponding to each candidate communication protocol. This adaptively and automatically determines the target communication protocol without manual intervention. This dynamic configuration mechanism ensures precise matching between protocol performance and task requirements. Compared to single-parameter configuration of fixed protocols, the present invention significantly improves task matching efficiency, reduces transmission delay, and enhances the real-time performance of printing output.

[0017] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description

[0018] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of this application. In the drawings: Figure 1 A flowchart illustrating an adaptive method for a multi-protocol printed communication interface of a relay protection device provided by an embodiment of the present invention is shown. Figure 2 A flowchart illustrating another adaptive method for multi-protocol printed communication interface of a relay protection device provided by an embodiment of the present invention is shown. Figure 3 This diagram illustrates the structure of an adaptive device for a multi-protocol printed communication interface of a relay protection device according to an embodiment of the present invention. Figure 4 This invention provides a schematic diagram of the structure of another relay protection device with a multi-protocol printed communication interface adaptive device. Detailed Implementation

[0019] The present invention will be described in detail below with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in the embodiments of the present invention can be combined with each other.

[0020] This embodiment provides an adaptive method for multi-protocol printed communication interfaces in relay protection devices, such as...Figure 1 As shown, the method includes: 101. Obtain the printing task data generated by the relay protection device and determine the content type of the printing task data.

[0021] During operation, the relay protection device generates printing task data. The content types of the printing task data include control instruction types (such as switch instructions, action records, etc.) and waveform data types. The reason for determining whether the content type of the printing task data is a control instruction type or a waveform data type is essentially because different content types of printing task data have different communication performance requirements. For example, control instruction types require low latency to ensure real-time output, while waveform data types require high bandwidth to support large-capacity transmission.

[0022] The need for communication performance is reflected in the printing task data. Therefore, based on the preset classification model (which is built on a neural network model and trained from printing task data samples), the printing task data is input into the classification model. The classification model outputs the probability of control command type and the probability of waveform data type. If the probability of control command type is greater than the probability of waveform data type, the content type is control command type. If the probability of waveform data type is greater than the probability of control command type, the content type is waveform data type.

[0023] Compared to manual classification, which requires human intervention, and fixed-rule matching, which is difficult to adapt to dynamically changing task scenarios and has low efficiency, a pre-defined classification algorithm can automatically process diverse printing task data, adapt to the real-time performance and reliability of relay protection devices in complex power grid environments, and significantly improve the efficiency and accuracy of protocol adaptation.

[0024] 102. Generate a task content requirement vector based on the content type.

[0025] Among them, the task content requirement vector represents the communication performance requirements of the printing task data, such as latency, bandwidth, and fault tolerance.

[0026] 103. Obtain historical performance data for each candidate communication protocol, and generate a protocol performance vector corresponding to each candidate communication protocol based on the historical performance data.

[0027] The protocol performance vector is used to characterize the performance features of candidate communication protocols, which include at least USB, RS232 and Ethernet.

[0028] Historical operational performance data for each candidate communication protocol is obtained from the communication logs of the relay protection device.

[0029] 104. Calculate the similarity between the task content requirement vector and each of the protocol performance vectors to obtain the corresponding fit score for each candidate communication protocol.

[0030] 105. Based on the fit score and all the candidate communication protocols, determine the target communication protocol to transmit and output the printing task data according to the target communication protocol.

[0031] In particular, regarding steps 104 and 105 of the embodiment, in the prior art, protocol selection usually relies on fixed parameters or manual judgment and lacks a quantitative mechanism. However, in this embodiment, the adaptation score of each candidate communication protocol is obtained through similarity calculation, and the adaptation scores are sorted to achieve automated protocol adaptation.

[0032] This invention provides an adaptive method and apparatus for multi-protocol printing communication interfaces in relay protection devices. Through this invention's technical solution, a task content requirement vector is generated based on the content type of the printing task data. A fit score is then calculated between this vector and the corresponding protocol performance vector of each candidate communication protocol. This adaptively and automatically determines the target communication protocol without manual intervention. This dynamic configuration mechanism ensures precise matching between protocol performance and task requirements. Compared to single-parameter configuration of fixed protocols, this invention significantly improves task matching efficiency, reduces transmission delay, and enhances the real-time performance of printing output.

[0033] Furthermore, as a refinement and extension of the specific implementation methods of the above embodiments, and to fully illustrate the specific implementation process in this embodiment, another adaptive method for multi-protocol printed communication interfaces of relay protection devices is provided, such as... Figure 2 As shown, the method includes: 201. Obtain the printing task data generated by the relay protection device and determine the content type of the printing task data.

[0034] The specific implementation steps in this embodiment are the same as those in step 101 of the embodiment, and will not be repeated here.

[0035] 202. Generate a task content requirement vector based on the content type.

[0036] In this embodiment, the content type is a control instruction type. Generating a task content requirement vector based on the content type includes: extracting the target instruction priority and time constraint features from the printing task data; determining a priority value based on the target instruction priority and a first preset mapping rule; normalizing the priority value to obtain a priority weight; determining a time constraint weight based on the time constraint features and a preset baseline threshold corresponding to the time constraint features; generating a control instruction requirement vector based on the priority weight and the time constraint weight; and determining the control instruction requirement vector as the task content requirement vector.

[0037] Specifically, for the priority value determined according to the target instruction priority and the first preset mapping rule, the priority value is normalized to obtain the priority weight. The first preset mapping rule is the value corresponding to the instruction priority. For example, instruction priorities include high priority, medium priority, and low priority. The value corresponding to high priority is 3, the value corresponding to medium priority is 2, and the value corresponding to low priority is 1. For example, if the target instruction priority is high priority, then the priority value is determined to be 3 according to the value corresponding to high priority in the first preset mapping rule. For example, the priority value is normalized to a maximum and minimum value to obtain the priority weight. The priority value is 3, and after normalization, the priority weight is 1.

[0038] Specifically, to determine the time constraint weight based on the time constraint feature and the preset benchmark threshold corresponding to the time constraint feature, the benchmark threshold is calculated and divided by the time constraint feature. The resulting value is compared with 1, and the minimum value between the two is taken as the time constraint weight. For example, the maximum allowable delay is taken as the time constraint feature, the benchmark delay threshold is taken as the benchmark threshold, the benchmark delay threshold is calculated and divided by the maximum allowable delay, the resulting value is compared with 1, and the minimum value between the two is taken as the time constraint weight.

[0039] Specifically, for generating a control instruction requirement vector based on the priority weight and the time constraint weight, and determining the control instruction requirement vector as the task content requirement vector, the product of the priority weight and the first preset coefficient corresponding to the priority weight is calculated to obtain a first result, the product of the time constraint weight and the second preset coefficient corresponding to the time constraint weight is calculated to obtain a second result, and the first result and the second result are directly concatenated into a two-dimensional vector to obtain the control instruction requirement vector, and the control instruction requirement vector is determined as the task content requirement vector.

[0040] It should be noted that, due to the characteristic that control commands need to be transmitted quickly to ensure that protection actions are recorded in a timely manner, the control command demand vector, which is a task content demand vector, is used to represent the delay dimension.

[0041] In this embodiment, the content type is waveform data. Generating a task content requirement vector based on the content type includes: determining whether the print task data is real-time sampled waveform data and whether the print task data is historical waveform data; if the print task data is neither the real-time sampled waveform data nor the historical waveform data, then extracting the sampling frequency and data volume characteristics from the print task data, generating a waveform data requirement vector based on the sampling frequency and data volume characteristics, and determining the waveform data requirement vector as the task content requirement vector; if the print task data is the real-time sampled waveform data, then monitoring the transmission... In the printing process, the frequency change rate weight and peak ratio weight are calculated. Based on the frequency change rate weight and peak ratio weight, a dynamic demand sub-vector is generated. Based on the dynamic demand sub-vector and the waveform data demand vector, a task content demand vector is generated. If the printing task data is historical waveform data, the contextual association features in the printing task data are extracted. Based on the contextual association features, the data dependency weight and error recovery demand weight are calculated. Based on the data dependency weight and the error recovery demand weight, a contextual demand sub-vector is generated. Based on the contextual demand sub-vector and the waveform data demand vector, a task content demand vector is generated.

[0042] To determine whether the print task data is real-time sampled waveform data and whether it is historical waveform data, specifically, the target type identifier is read from the metadata flag field of the print task data. The type identifier includes real-time sampled waveform data, historical waveform data, and other waveform data. The target type identifier is either real-time sampled waveform data, historical waveform data, or other waveform data. If the print task data is neither real-time sampled waveform data nor historical waveform data, specifically, it means the target type identifier is other waveform data.

[0043] For extracting the sampling frequency and data volume characteristics from the printing task data, for example, the sampling frequency is the number of sampling points per second, and the data volume characteristic is the data packet size.

[0044] In this embodiment, generating a waveform data demand vector based on the sampling frequency and the data volume characteristics includes: calculating a frequency weight based on the sampling frequency and a preset maximum system sampling frequency; calculating a data volume weight based on the data volume characteristics and a preset maximum data volume corresponding to the data volume characteristics; and generating a waveform data demand vector based on the frequency weight and the data volume weight.

[0045] The frequency weight is calculated based on the sampling frequency and the preset maximum system sampling frequency. Specifically, the sampling frequency is divided by the maximum system sampling frequency to obtain the frequency weight.

[0046] The data volume weight is calculated based on the data volume feature and the preset maximum data volume corresponding to the data volume feature. Specifically, the data volume feature is calculated by dividing the maximum data volume to obtain the data volume weight. For example, the data packet size is used as the data volume feature, the preset maximum data packet size is used as the preset maximum data volume, and the data packet size is calculated by dividing the maximum data packet size to obtain the data volume weight.

[0047] To generate a waveform data demand vector based on the frequency weight and the data volume weight, specifically, the product of the frequency weight and the third preset coefficient corresponding to the frequency weight is calculated to obtain a third result, the product of the data volume weight and the fourth preset coefficient corresponding to the data volume weight is calculated to obtain a fourth result, and the third result and the fourth result are directly concatenated into a two-dimensional vector to obtain the waveform data demand vector.

[0048] It should be noted that, since waveform data requires high bandwidth to ensure complete output, the waveform data requirement vector, which is the task content requirement vector, is used to represent the bandwidth dimension.

[0049] In this embodiment, the calculation of the frequency change rate weight and peak ratio weight includes: sorting the data packets in ascending order according to the difference between the timestamp of the data packets and the current time, taking the first N data packets as the first target data packets, obtaining the first data packet size, the number of sampling points in the packet, and the target timestamp of each first target data packet, calculating the current actual sampling frequency based on the number of sampling points in the packet and the target timestamp, calculating the frequency change rate based on the current actual sampling frequency and the sampling frequency, and calculating the frequency change rate weight based on the frequency change rate and the preset maximum allowable change rate; taking the data packets in the current time window as the second target data packets, wherein the last moment of the current time window is the current time, obtaining the second data packet size of each second target data packet, calculating the peak ratio of the data volume based on the second data packet size, and determining the peak ratio weight based on the peak ratio of the data volume and the second preset mapping rule.

[0050] For data packets sorted in ascending order based on the difference between their timestamps and the current time, the first N data packets are taken as the first target data packets. The size of each first target data packet, the number of sampling points within the packet, and the target timestamp are obtained. The current actual sampling frequency is calculated based on the number of sampling points within the packet and the target timestamp. Specifically, the difference between the timestamp of each data packet and the current time is calculated, and these differences are sorted in ascending order. The first N data packets are taken as the first target data packets, with the size of the first target data packet being the size of the first data packet and the timestamp of the first target data packet being the target timestamp. The number of sampling points within all first target data packets is added together to obtain the total number of sampling points. Then, the difference between the target timestamp of the first first target data packet and the target timestamp of the Nth first target data packet is calculated to obtain the duration. The total number of sampling points is divided by the duration to obtain the current actual sampling frequency.

[0051] The frequency change rate is calculated based on the current actual sampling frequency and the sampling frequency. The frequency change rate weight is calculated based on the frequency change rate and the preset maximum allowable change rate. Specifically, the sampling frequency is the nominal value in the metadata of the print task data, which is directly obtained and used. The current actual sampling frequency is calculated by dividing it by the sampling frequency to obtain the frequency change rate. The frequency change rate is then calculated by dividing it by the preset maximum allowable change rate to obtain the frequency change rate weight.

[0052] For data packets within the current time window used as the second target data packets, where the last moment of the current time window is the current moment, the size of the second data packet for each second target data packet is obtained, and the peak data volume ratio is calculated based on the second data packet size. Specifically, the length of the time window is... The current time window is greater than or equal to and less than or equal to The last moment of the current time window, which is the current moment, is the time when... The size of the second target data packet is the size of the second data packet. The maximum value among all the second data packet sizes is obtained by comparing them. The average value of all the second data packet sizes is calculated, that is, the sum of all the second data packet sizes is divided by the number of all the second target data packets. The maximum value is then divided by the average value to obtain the peak data volume ratio.

[0053] The peak ratio weight is determined based on the peak ratio of the data volume and the second preset mapping rule. Specifically, the second preset mapping rule is the correspondence between the peak ratio range and the preset peak ratio weight. The peak ratio range corresponding to the peak ratio of the data volume is taken as the target peak ratio range, and the preset peak ratio weight corresponding to the target peak ratio range is taken as the peak ratio weight. For example, the second preset mapping rule is as follows: if the peak ratio range is greater than or equal to 1 and less than 1.5, the corresponding preset peak ratio weight is 0.1; if the peak ratio range is greater than or equal to 1.5 and less than 2, the corresponding preset peak ratio weight is 0.3; if the peak ratio range is greater than or equal to 2 and less than 3, the corresponding preset peak ratio weight is 0.6; if the peak ratio range is greater than or equal to 3 and less than 5, the corresponding preset peak ratio weight is 0.8; and if the peak ratio range is greater than or equal to 5, the corresponding preset peak ratio weight is 1. If the peak ratio of the data volume is 1.8, then the target peak ratio range is greater than or equal to 1.5 and less than 2, and the peak ratio weight is 0.3.

[0054] To generate a dynamic demand sub-vector based on the frequency change rate weight and the peak ratio weight, and to generate a task content demand vector based on the dynamic demand sub-vector and the waveform data demand vector, specifically, the product of the frequency change rate weight and its corresponding fifth preset coefficient is calculated to obtain a fifth result; the product of the peak ratio weight and its corresponding sixth preset coefficient is calculated to obtain a sixth result; the fifth and sixth results are directly concatenated into a two-dimensional vector to obtain the dynamic demand sub-vector; and the dynamic demand sub-vector is added to the waveform data demand vector to obtain a two-dimensional vector, which is the task content demand vector. Specifically, during the addition, the fifth result corresponding to the frequency change rate weight is added to the third result corresponding to the frequency weight to obtain a seventh result; and the sixth result corresponding to the peak ratio weight is added to the fourth result corresponding to the data volume weight to obtain an eighth result.

[0055] It should be noted that real-time sampled data needs to respond quickly to instantaneous fluctuations to capture dynamic bandwidth requirements, ensuring that the protocol selection adapts to real-time changes and avoids transmission interruptions. Therefore, the dynamic demand sub-vector is used to characterize the real-time bandwidth adjustment requirements of the printing task data. The two-dimensional vector obtained by adding the dynamic demand sub-vector to the waveform data demand vector is the comprehensive bandwidth requirement. Specifically, the seventh result is the comprehensive bandwidth requirement of the data generation rate, and the eighth result is the comprehensive bandwidth requirement of the transmission load.

[0056] In this embodiment, the step of extracting contextual features from the print task data and calculating data dependency weights based on the contextual features includes: extracting the total number of expected data packets from the print task data, counting the total number of actually received valid data packets, calculating a sequence continuity score based on the total number of expected data packets and the total number of valid data packets, and using the sequence continuity score as the data dependency weight; the step of calculating error recovery requirement weights includes: obtaining the historical packet loss rate and a preset allowable packet loss threshold, and calculating the error recovery requirement weights based on the historical packet loss rate and the allowable packet loss threshold.

[0057] For the expected total number of data packets extracted from the print task data, the total number of actually received valid data packets is counted. Based on the expected total number of data packets and the total number of valid data packets, the sequence continuity score is calculated. Specifically, the expected total number of data packets divided by the total number of valid data packets equals the sequence continuity score.

[0058] To obtain the historical packet loss rate and the preset allowable packet loss threshold, the error recovery requirement weight is calculated based on the historical packet loss rate and the allowable packet loss threshold. Specifically, the historical packet loss rate is divided by the allowable packet loss threshold to obtain the error recovery requirement weight.

[0059] To generate a context requirement sub-vector based on the data dependency weight and the error recovery requirement weight, and to generate a task content requirement vector based on the context requirement sub-vector and the waveform data requirement vector, specifically, the product of the data dependency weight and the ninth preset coefficient corresponding to the data dependency weight is calculated to obtain the ninth result; the product of the error recovery requirement weight and the tenth preset coefficient corresponding to the error recovery requirement weight is calculated to obtain the tenth result; the ninth result and the tenth result are directly concatenated into a two-dimensional vector to obtain the context requirement sub-vector; and the context requirement sub-vector is directly concatenated with the waveform data requirement vector to obtain a four-dimensional vector, which is the task content requirement vector.

[0060] It should be noted that historical data must be highly reliable to support fault analysis. It can enhance the characterization of fault tolerance requirements and ensure that the protocol selection supports error recovery. Therefore, the context requirement sub-vector is used to characterize the fault tolerance requirements of the printing task data. After directly concatenating the context requirement sub-vector with the waveform data requirement vector, the resulting task content requirement vector includes bandwidth and fault tolerance dimensions, which are used to reflect the bandwidth and fault tolerance requirements of the printing task data.

[0061] By fusing dynamic demand sub-vectors and context demand sub-vectors with waveform data demand vectors respectively, the task demand representation is refined. This multi-dimensional vector generation mechanism can capture the complex performance requirements of the task, thereby selecting a more suitable target communication protocol and significantly enhancing the transmission reliability in complex scenarios.

[0062] 203. Obtain historical performance data for each candidate communication protocol, and generate a protocol performance vector for each candidate communication protocol based on the historical performance data.

[0063] For this embodiment, historical performance data includes: average transmission delay, actual bandwidth utilization, and error retransmission rate.

[0064] For each candidate communication protocol, the latency performance index is obtained by dividing the preset protocol baseline latency threshold by the average transmission latency. The bandwidth performance index is obtained by dividing the actual bandwidth utilization by the preset maximum system bandwidth. The fault tolerance performance index is obtained by subtracting the error retransmission rate from 1.

[0065] For each candidate communication protocol, determine whether the latency performance index value is less than or equal to the preset minimum required latency. If yes, the latency weight is 1; otherwise, the latency weight is the minimum required latency divided by the latency performance index value. Calculate the bandwidth performance index value divided by the preset system baseline bandwidth, compare the resulting value with 1, and use the minimum of the two as the bandwidth weight. Calculate 1 minus the preset minimum allowable error retransmission rate to obtain the optimal fault tolerance feature value. Calculate the fault tolerance performance index value divided by this optimal fault tolerance feature value to obtain the fault tolerance weight. Concatenate the latency weight, bandwidth weight, and fault tolerance weight directly into a three-dimensional vector to obtain the protocol performance vector. Following the order of bandwidth dimension, latency dimension, and fault tolerance dimension, we get: Protocol performance vector = [bandwidth weight, latency weight, fault tolerance weight].

[0066] In the prior art, the selection of communication protocols usually relies on preset parameters or human experience. However, the present invention provides a quantitative basis for adaptive protocol selection by generating protocol performance vectors, and provides accurate protocol performance characterization. The operation of generating protocol performance vectors stems from the differences in the performance of different candidate communication protocols in actual operation.

[0067] 204. Calculate the similarity between the task content requirement vector and each of the protocol performance vectors to obtain the corresponding fit score for each candidate communication protocol.

[0068] In this embodiment, calculating the similarity between the task content requirement vector and each protocol performance vector to obtain the corresponding fit score for each candidate communication protocol includes: unifying the task content requirement vector and all protocol performance vectors into three-dimensional vectors including bandwidth, latency, and fault tolerance dimensions, thus obtaining the corrected task content requirement vector and the corresponding protocol performance vector for each candidate communication protocol; calculating the bandwidth dimension similarity between the bandwidth dimension vector in the corrected task content requirement vector and the bandwidth dimension vector in each protocol performance vector, and calculating the bandwidth dimension similarity for each candidate communication protocol; calculating the... The latency dimension vector in the corrected task content requirement vector is compared with the latency dimension vector in each of the protocol performance vectors to calculate the latency dimension similarity for each candidate communication protocol. The fault tolerance dimension vector in the corrected task content requirement vector is compared with the fault tolerance dimension vector in each of the protocol performance vectors to calculate the fault tolerance dimension similarity for each candidate communication protocol. Based on the bandwidth dimension similarity, latency dimension similarity, and fault tolerance dimension similarity for the same candidate communication protocol, the similarity for that candidate communication protocol is calculated, and the similarity is used as the fit score for that candidate communication protocol.

[0069] For content types that are control instructions, the two-dimensional task content requirement vector, the control instruction requirement vector, is used to represent the latency dimension. The first and second results of the control instruction requirement vector are added to obtain the latency dimension vector. For the bandwidth and fault tolerance dimension vectors, they are both pre-set as follows: the corresponding first preset bandwidth vector and first preset fault tolerance vector are extended to three dimensions in the order of bandwidth, latency, and fault tolerance. Specifically: The revised task content requirement vector = [first preset bandwidth vector, first result + second result, first preset fault tolerance vector].

[0070] For content types that are waveform data types, specifically: (1) If the printed task data is not real-time sampled waveform data and is not historical waveform data, the two-dimensional task content requirement vector of the waveform data requirement vector is used to represent the bandwidth dimension. The third and fourth results of the waveform data requirement vector are added to obtain the bandwidth dimension vector. As for the delay dimension vector and the fault tolerance dimension vector, they are both pre-set to the corresponding first preset delay vector and second preset fault tolerance vector. The task content requirement vector is extended to three dimensions in the order of bandwidth dimension, delay dimension, and fault tolerance dimension. Specifically: The revised task content requirement vector = [third result + fourth result, first preset delay vector, second preset fault tolerance vector].

[0071] (2) If the printing task data is real-time sampled waveform data, then the task content requirement vector is a two-dimensional vector. The two-dimensional task content requirement vector obtained by adding the dynamic requirement sub-vector and the waveform data requirement vector represents the comprehensive bandwidth requirement. Adding the seventh and eighth results yields a vector representing the bandwidth dimension. For the delay dimension vector and the fault tolerance dimension vector, both are pre-set as follows: the corresponding second preset delay vector and third preset fault tolerance vector are extended to three dimensions in the order of bandwidth dimension, delay dimension, and fault tolerance dimension. Specifically: The revised task content requirement vector = [seventh result + eighth result, second preset delay vector, third preset fault tolerance vector].

[0072] (3) If the printing task data is historical waveform data, then the context requirement sub-vector and the waveform data requirement vector are directly concatenated to obtain a four-dimensional task content requirement vector. The average of the ninth and tenth results is calculated to obtain the fault tolerance dimension vector. The third and fourth results of the waveform data requirement vector are added to obtain the bandwidth dimension vector. As for the delay dimension vector, it is reduced to three dimensions according to the first preset delay vector, in the order of bandwidth dimension, delay dimension, and fault tolerance dimension. Specifically: The revised task content requirement vector = [the third result + the fourth result, the first preset delay vector, and the average of the ninth and tenth results].

[0073] It should be noted that different dimensions (latency, bandwidth, fault tolerance) have different levels of importance for protocol adaptation, so the degree of matching needs to be quantified separately, and a similarity of each dimension needs to be calculated.

[0074] The similarity of a candidate communication protocol is calculated based on the similarity of its bandwidth dimension, latency dimension, and fault tolerance dimension. This similarity is then used as the fit score for the candidate communication protocol. Specifically, the similarity of the bandwidth dimension, latency dimension, and fault tolerance dimension corresponding to the same candidate communication protocol is weighted and fused to obtain the similarity of the candidate communication protocol.

[0075] Similarity = Bandwidth dimension similarity × weight corresponding to bandwidth dimension similarity + latency dimension similarity × weight corresponding to latency dimension similarity + fault tolerance dimension similarity × weight corresponding to fault tolerance dimension similarity, and the weight corresponding to bandwidth dimension similarity + the weight corresponding to latency dimension similarity + the weight corresponding to fault tolerance dimension similarity = 1.

[0076] Through weighted fusion, weights can be automatically adjusted according to task type to adapt to the real-time and reliability requirements of the power grid.

[0077] In this embodiment, the intelligent selection of communication protocols and the multi-level adaptation mechanism significantly improve the system's compatibility with various communication protocols and device environments. Through automated analysis of content type and protocol performance, as well as a similarity-based scoring and selection mechanism, the optimal target communication protocol can be selected without manual intervention. The vector generation and similarity matching mechanism of this invention is universal and can be extended to other multi-protocol communication scenarios, such as data transmission in industrial automation and IoT devices.

[0078] 205. Determine whether the largest fit score among all the fit scores is greater than the first preset threshold. If so, take the candidate communication protocol corresponding to the largest fit score as the target communication protocol.

[0079] Specifically, it is determined whether the largest fit score among all the fit scores is greater than a first preset threshold. If the largest fit score is greater than the first preset threshold, it means that the candidate communication protocol can effectively meet the latency, bandwidth or fault tolerance requirements of the task, and is directly determined as the target communication protocol.

[0080] 206. If not, then each of the fit scores is traversed sequentially in descending order, and the first candidate communication protocol that passes the preset condition is taken as the target communication protocol. The preset condition is that at least one of the bandwidth dimension similarity, the latency dimension similarity, and the fault tolerance dimension similarity is greater than a second preset threshold. If the number of candidate communication protocols that pass the preset condition is 0, then the default communication protocol in the default protocol configuration parameters is taken as the target communication protocol, so as to transmit and output the printing task data according to the target communication protocol.

[0081] For this embodiment, as another implementation method: An initial analysis model is constructed using regression analysis or machine learning algorithms (such as decision trees and neural networks). The initial analysis model is then input with historical performance data samples of candidate communication protocols and task content requirement vector samples. The actual protocol configuration parameters are used as labels to obtain the trained analysis model.

[0082] Based on the statistical correlation between the historical values ​​of configuration parameters and the corresponding historical protocol performance vectors, a corresponding mapping model is obtained.

[0083] The fit score is iterated sequentially from largest to smallest, and all candidate communication protocols that pass the preset conditions are selected as candidate communication protocols to be optimized. For each candidate communication protocol to be optimized, the trained analysis model is used as input, along with the task content requirement vector and the historical performance data of the candidate communication protocol. The updated protocol configuration parameters (e.g., updated values ​​for packet size, transmission rate, and retransmission mechanism) are output for that candidate communication protocol. Each candidate communication protocol to be optimized has a baseline performance based on its vendor default configuration parameters (e.g., vendor default values ​​for packet size, transmission rate, and retransmission mechanism). The historical performance data obtained in step 203 of the embodiment is a specific manifestation of the baseline performance of the candidate communication protocol based on its corresponding vendor default configuration parameters.

[0084] Based on this mapping model, the update protocol configuration parameters corresponding to the candidate communication protocol to be optimized are input, and the update protocol performance vector corresponding to the candidate communication protocol to be optimized is output.

[0085] Then, based on the update protocol performance vector corresponding to each candidate communication protocol to be optimized, calculate the update fit score corresponding to each update protocol performance vector. Select the candidate communication protocol with the highest update fit score as the target communication protocol. When using the target communication protocol, use the optimized configuration parameters corresponding to the target communication protocol instead of the manufacturer's default configuration parameters corresponding to the target communication protocol for the transmission and output of printing task data.

[0086] The default protocol configuration parameters are those associated with the printing task data. In scenarios where none of the candidate communication protocols can directly meet the task requirements, the default protocol configuration parameters are used to ensure basic transmission functionality. Specifically, the default protocol configuration parameters are selected from a preset parameter library based on the content type of the printing task data. For example, a general bandwidth and delay configuration for the RS232 protocol might be selected. The parameter library is generated through long-term operational data statistics and covers configuration schemes for typical task scenarios. The advantage of this operation is that it provides a fallback mechanism, ensuring that transmission can still be completed in low-matching scenarios, avoiding task failure. Alternative methods such as randomly selecting a protocol or pausing transmission may lead to data loss or interruption. This invention chooses the default parameter mechanism because it can automatically and quickly respond, ensuring the continuity of power grid tasks. The default protocol configuration parameters are stored in a parameter library, which is generated through statistical analysis of long-term operational data of relay protection devices and covers general configuration schemes for typical task scenarios (such as control commands and waveform data). For example, for historical data, the parameter library may provide configuration of fixed bandwidth and retransmission mechanism for the RS232 protocol. The parameter library is built based on the performance statistics of historical transmission tasks and classified and stored according to the type of task content (such as low latency or high fault tolerance requirements) to ensure that the default parameters are applicable to a variety of scenarios.

[0087] The first and second preset thresholds are determined based on statistical analysis of the transmission performance of relay protection devices under various power grid environments. Specifically, the first preset threshold is selected to ensure a high transmission success rate by analyzing the correlation between historical adaptability scores and transmission success rates, combined with the confidence interval of protocol performance. The second preset threshold is selected to cover most typical task scenarios based on the statistical distribution of sub-item similarity and single-dimensional performance matching. Furthermore, the thresholds can be optimized through continuous monitoring of transmission results and feedback, or by training a better combination of thresholds based on historical data using machine learning methods; no specific limitations are imposed here.

[0088] By dynamically adjusting protocol configuration parameters, the deficiencies in adaptability scoring are compensated for, ensuring transmission efficiency and reliability. Alternative methods, such as manual parameter adjustment, require specialized knowledge, are time-consuming, and prone to errors. This invention selects an analytical model because it can automatically generate adaptability parameters, making it suitable for complex power grid transmission scenarios.

[0089] In step 206 of the embodiment, by quantizing and sorting, and filtering using a first preset threshold and a second preset threshold, the optimal candidate communication protocol is automatically selected to improve transmission efficiency and reliability, and to meet the needs of complex power grid transmission scenarios. In the prior art, protocol selection usually relies on fixed configuration or manual judgment, lacks a quantifying and sorting mechanism, and the selection of non-optimal candidate communication protocols cannot guarantee matching accuracy, which can easily lead to transmission delays or data loss.

[0090] Traditional relay protection devices lack quantitative scoring and automated screening mechanisms for protocol selection, making it difficult to adapt to dynamic task requirements. This invention establishes a multi-level protocol selection system that comprehensively considers compatibility scores and similarity across various dimensions to adaptively select the target communication protocol. This dynamic adaptation mechanism ensures precise matching between protocol performance and task requirements. Compared to the single-parameter configuration of fixed protocols, this invention significantly improves task matching efficiency, reduces transmission latency, and enhances the real-time performance of printed output. This mechanism overcomes the traditional single-adaptation mode of fixed protocols, significantly improving the flexibility and reliability of protocol selection, reducing transmission failures due to insufficient compatibility, and avoiding the complexity and error risks of manual configuration, thus optimizing the printing communication efficiency of relay protection devices.

[0091] Specifically, the transmission and output of the printing task data according to the target communication protocol involves transmitting the printing task data to the printing device and completing the output based on the target communication protocol.

[0092] This invention provides an adaptive method and apparatus for multi-protocol printing communication interfaces in relay protection devices. Through this invention's technical solution, a task content requirement vector is generated based on the content type of the printing task data. A fit score is then calculated between this vector and the corresponding protocol performance vector of each candidate communication protocol. This adaptively and automatically determines the target communication protocol without manual intervention. This dynamic configuration mechanism ensures precise matching between protocol performance and task requirements. Compared to single-parameter configuration of fixed protocols, this invention significantly improves task matching efficiency, reduces transmission delay, and enhances the real-time performance of printing output.

[0093] Furthermore, as Figure 1 and Figure 2 The specific implementation of the method shown in this invention provides an adaptive device for a multi-protocol printed communication interface of a relay protection device, such as... Figure 3 As shown, the device includes: an acquisition module 31, a first generation module 32, a second generation module 33, a calculation module 34, and a determination module 35; The acquisition module 31 is used to acquire printing task data generated by the relay protection device and determine the content type of the printing task data; The first generation module 32 is used to generate a task content requirement vector according to the content type; The second generation module 33 is used to obtain historical performance data of each candidate communication protocol and generate a protocol performance vector corresponding to each candidate communication protocol based on the historical performance data. The calculation module 34 is used to calculate the similarity between the task content requirement vector and each of the protocol performance vectors, and to obtain the corresponding adaptation score for each of the candidate communication protocols. The determination module 35 is used to determine the target communication protocol based on the fit score and all the candidate communication protocols, so as to transmit and output the printing task data according to the target communication protocol.

[0094] Accordingly, the content type is a control instruction type. In order to generate a task content requirement vector based on the content type, the first generation module 32 is specifically used to extract the target instruction priority and time constraint features from the printing task data; determine the priority value according to the target instruction priority and a first preset mapping rule; normalize the priority value to obtain the priority weight; determine the time constraint weight according to the time constraint feature and the preset benchmark threshold corresponding to the time constraint feature; generate a control instruction requirement vector according to the priority weight and the time constraint weight, and determine the control instruction requirement vector as the task content requirement vector.

[0095] Accordingly, the content type is waveform data. To generate a task content requirement vector based on the content type, the first generation module 32 is specifically used to determine whether the print task data is real-time sampled waveform data and whether the print task data is historical waveform data. If the print task data is neither the real-time sampled waveform data nor the historical waveform data, then the sampling frequency and data volume characteristics in the print task data are extracted. Based on the sampling frequency and data volume characteristics, a waveform data requirement vector is generated, and this waveform data requirement vector is determined as the task content requirement vector. If the print task data is the real-time sampled waveform data... The process involves monitoring the transmission process, calculating the frequency change rate weight and peak ratio weight, generating a dynamic demand sub-vector based on these weights, and then generating a task content demand vector based on the dynamic demand sub-vector and the waveform data demand vector. If the printing task data is historical waveform data, the contextual features in the printing task data are extracted, data dependency weights and error recovery demand weights are calculated based on these contextual features, and a contextual demand sub-vector is generated based on these weights. Finally, a task content demand vector is generated based on the contextual demand sub-vector and the waveform data demand vector.

[0096] Accordingly, in order to generate a waveform data demand vector based on the sampling frequency and the data volume characteristics, the first generation module 32 is specifically used to calculate the frequency weight based on the sampling frequency and the preset maximum system sampling frequency; calculate the data volume weight based on the data volume characteristics and the preset maximum data volume corresponding to the data volume characteristics; and generate the waveform data demand vector based on the frequency weight and the data volume weight.

[0097] Accordingly, in order to calculate the frequency change rate weight and peak ratio weight, the first generation module 32 is specifically used to sort the data packets in ascending order according to the difference between the timestamp of the data packets and the current time, take the first N data packets as the first target data packets, obtain the first data packet size, the number of sampling points in the packet and the target timestamp of each first target data packet, calculate the current actual sampling frequency according to the number of sampling points in the packet and the target timestamp, calculate the frequency change rate according to the current actual sampling frequency and the sampling frequency, calculate the frequency change rate weight according to the frequency change rate and the preset maximum allowable change rate; take the data packets in the current time window as the second target data packets, wherein the last moment of the current time window is the current time, obtain the second data packet size of each second target data packet, calculate the peak ratio of the data volume according to the second data packet size, and determine the peak ratio weight according to the peak ratio of the data volume and the second preset mapping rule.

[0098] Accordingly, in order to extract contextual features from the print task data and calculate data dependency weights based on these features, the first generation module 32 is specifically used to extract the expected total number of data packets from the print task data, count the actual total number of valid data packets received, calculate a sequence continuity score based on the expected total number of data packets and the actual total number of valid data packets, and use the sequence continuity score as the data dependency weight. In order to calculate the error recovery requirement weight, the first generation module 32 is specifically used to obtain the historical packet loss rate and a preset allowable packet loss threshold, and calculate the error recovery requirement weight based on the historical packet loss rate and the allowable packet loss threshold.

[0099] Accordingly, in order to calculate the similarity between the task content requirement vector and each of the protocol performance vectors, and to obtain the corresponding fit score for each candidate communication protocol, the calculation module 34 is specifically used to unify the task content requirement vector and all the protocol performance vectors into three-dimensional vectors including bandwidth, latency, and fault tolerance dimensions, thereby obtaining the corrected task content requirement vector and the protocol performance vector corresponding to each candidate communication protocol; calculate the similarity between the bandwidth dimension vector in the corrected task content requirement vector and the bandwidth dimension vector in each of the protocol performance vectors, and calculate the bandwidth dimension similarity for each candidate communication protocol; The vector representing the latency dimension in the corrected task content requirement vector is compared with the vector representing the latency dimension in each of the protocol performance vectors to calculate the latency dimension similarity for each candidate communication protocol. The vector representing the fault tolerance dimension in the corrected task content requirement vector is also compared with the vector representing the fault tolerance dimension in each of the protocol performance vectors to calculate the fault tolerance dimension similarity for each candidate communication protocol. Based on the bandwidth dimension similarity, latency dimension similarity, and fault tolerance dimension similarity for the same candidate communication protocol, the similarity score is calculated for that candidate communication protocol, and this similarity score is used as the fit score for that candidate communication protocol.

[0100] Accordingly, in order to determine the target communication protocol based on the fit score and all the candidate communication protocols, the determination module 35 specifically includes: a judgment unit 351 and a traversal unit 352. The judgment unit 351 is specifically used to determine whether the largest fit score among all the fit scores is greater than a first preset threshold. If so, the candidate communication protocol corresponding to the largest fit score is taken as the target communication protocol.

[0101] The traversal unit 352 is specifically used to, if not, traverse each of the fit scores in descending order, and take the first candidate communication protocol that passes the preset conditions as the target communication protocol, wherein the preset conditions are that at least one of the bandwidth dimension similarity, the latency dimension similarity and the fault tolerance dimension similarity is greater than a second preset threshold; if the number of candidate communication protocols that pass the preset conditions is 0, then the default communication protocol in the default protocol configuration parameters is taken as the target communication protocol.

[0102] It should be noted that for other corresponding descriptions of the functional units involved in the multi-protocol printing communication interface adaptive device for relay protection provided in this embodiment, please refer to... Figures 1 to 2 The corresponding description will not be repeated here.

[0103] Based on the above, Figures 1 to 2 Accordingly, this embodiment also provides a storage medium, which may be volatile or non-volatile, storing a computer program that, when executed by a processor, implements the above-described method. Figures 1 to 2 The method for adaptive multi-protocol printed communication interface of the relay protection device is shown.

[0104] Based on this understanding, the technical solution of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, portable hard drive, etc.) and includes several instructions to cause a computer device (such as a personal computer, server, or network device, etc.) to execute the methods of various implementation scenarios of the present invention.

[0105] Based on the above, Figures 1 to 2 The method shown and Figure 3 , Figure 4 To achieve the above objectives, the present application also provides a computer device, specifically a personal computer, server, network device, etc., as shown in the illustrated embodiment. This computer device includes a storage medium and a processor; the storage medium stores a computer program; the processor executes the computer program to achieve the above-described objectives. Figure 1 and Figure 2 The method for adaptive multi-protocol printed communication interface of the relay protection device is shown.

[0106] Optionally, the computer device may also include a user interface, a network interface, a camera, radio frequency (RF) circuitry, sensors, audio circuitry, a Wi-Fi module, etc. The user interface may include a display screen, input units such as a keyboard, etc., and optional user interfaces may also include USB interfaces, card reader interfaces, etc. The network interface may optionally include standard wired interfaces, wireless interfaces (such as Wi-Fi interfaces), etc.

[0107] Those skilled in the art will understand that the computer device structure provided in this embodiment does not constitute a limitation on the physical device, and may include more or fewer components, or combine certain components, or have different component arrangements.

[0108] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the hardware and software resources of the aforementioned computer device, supporting the operation of information processing programs and other software and / or programs. The network communication module is used to enable communication between the various components within the non-volatile storage medium, as well as communication with other hardware and software in the information processing entity device.

[0109] Through the above description of the embodiments, those skilled in the art can clearly understand that the present invention can be implemented by means of software plus necessary general-purpose hardware platform, or it can be implemented by hardware.

[0110] This invention provides an adaptive method and apparatus for multi-protocol printing communication interfaces in relay protection devices. Through this invention's technical solution, a task content requirement vector is generated based on the content type of the printing task data. A fit score is then calculated between this vector and the corresponding protocol performance vector of each candidate communication protocol. This adaptively and automatically determines the target communication protocol without manual intervention. This dynamic configuration mechanism ensures precise matching between protocol performance and task requirements. Compared to single-parameter configuration of fixed protocols, this invention significantly improves task matching efficiency, reduces transmission delay, and enhances the real-time performance of printing output.

[0111] Those skilled in the art will understand that the accompanying drawings are merely schematic diagrams of a preferred embodiment, and the modules or processes shown in the drawings are not necessarily essential for implementing the present invention. Those skilled in the art will understand that the modules in the apparatus of the embodiment can be distributed within the apparatus of the embodiment as described, or they can be located in one or more apparatuses different from this embodiment, with corresponding changes. The modules of the above-described embodiment can be combined into one module, or further divided into multiple sub-modules.

[0112] The serial numbers used above are for descriptive purposes only and do not represent the superiority or inferiority of the implementation scenarios. The above disclosures are merely a few specific implementation scenarios of the present invention; however, the present invention is not limited thereto, and any variations conceived by those skilled in the art should fall within the protection scope of the present invention.

Claims

1. An adaptive method for a multi-protocol printed communication interface of a relay protection device, characterized in that, The method includes: Obtain the printing task data generated by the relay protection device, and determine the content type of the printing task data; Generate a task content requirement vector based on the content type; Obtain historical performance data for each candidate communication protocol, and generate a protocol performance vector for each candidate communication protocol based on the historical performance data. Calculate the similarity between the task content requirement vector and each of the protocol performance vectors to obtain the corresponding fit score for each candidate communication protocol; Based on the fit score and all the candidate communication protocols, a target communication protocol is determined to transmit and output the printing task data according to the target communication protocol.

2. The method according to claim 1, characterized in that, The content type is a control instruction type, and the step of generating a task content requirement vector based on the content type includes: Extract the target instruction priority and time constraint features from the print task data; The priority value is determined according to the target instruction priority and the first preset mapping rule, and the priority value is normalized to obtain the priority weight. The time constraint weight is determined based on the time constraint feature and the preset benchmark threshold corresponding to the time constraint feature; Based on the priority weight and the time constraint weight, a control instruction requirement vector is generated, and the control instruction requirement vector is determined as the task content requirement vector.

3. The method according to claim 1, characterized in that, The content type is a waveform data type, and the step of generating a task content requirement vector based on the content type includes: Determine whether the print task data is real-time sampled waveform data, and determine whether the print task data is historical waveform data; If the print task data is neither the real-time sampled waveform data nor the historical waveform data, then the sampling frequency and data volume characteristics in the print task data are extracted, and a waveform data demand vector is generated based on the sampling frequency and data volume characteristics. The waveform data demand vector is then determined as the task content demand vector. If the printing task data is the real-time sampled waveform data, then monitor the transmission process, calculate the frequency change rate weight and peak ratio weight, generate a dynamic demand sub-vector based on the frequency change rate weight and peak ratio weight, and generate a task content demand vector based on the dynamic demand sub-vector and the waveform data demand vector. If the print task data is historical waveform data, then extract the contextual features from the print task data, calculate the data dependency weight based on the contextual features, calculate the error recovery requirement weight, generate a contextual requirement sub-vector based on the data dependency weight and the error recovery requirement weight, and generate a task content requirement vector based on the contextual requirement sub-vector and the waveform data requirement vector.

4. The method according to claim 3, characterized in that, The step of generating a waveform data demand vector based on the sampling frequency and the data volume characteristics includes: Calculate the frequency weight based on the sampling frequency and the preset system maximum sampling frequency; Calculate the data volume weight based on the data volume characteristics and the preset maximum data volume corresponding to the data volume characteristics; A waveform data demand vector is generated based on the frequency weight and the data volume weight.

5. The method according to claim 3, characterized in that, The calculation of the frequency change rate weight and the peak ratio weight includes: Sort the data packets in ascending order based on the difference between their timestamps and the current time. Take the first N data packets as the first target data packets. Obtain the first data packet size, the number of sampling points within the packet, and the target timestamp for each first target data packet. Calculate the current actual sampling frequency based on the number of sampling points within the packet and the target timestamp. Calculate the frequency change rate based on the current actual sampling frequency and the sampling frequency. Calculate the frequency change rate weight based on the frequency change rate and the preset maximum allowable change rate. The data packets within the current time window are used as the second target data packets, wherein the last moment of the current time window is the current moment. The size of the second data packet for each second target data packet is obtained, the peak data volume ratio is calculated based on the size of the second data packet, and the peak ratio weight is determined based on the peak data volume ratio and the second preset mapping rule.

6. The method according to claim 3, characterized in that, The step of extracting contextual features from the printing task data and calculating data dependency weights based on the contextual features includes: Extract the expected total number of data packets from the printing task data, count the actual total number of valid data packets received, calculate the sequence continuity score based on the expected total number of data packets and the actual total number of valid data packets, and use the sequence continuity score as the data dependency weight. The calculation of error recovery requirement weights includes: Obtain the historical packet loss rate and the preset allowable packet loss threshold, and calculate the error recovery requirement weight based on the historical packet loss rate and the allowable packet loss threshold.

7. The method according to claim 1, characterized in that, The calculation of the similarity between the task content requirement vector and each of the protocol performance vectors to obtain the corresponding fit score for each candidate communication protocol includes: The task content requirement vector and all the protocol performance vectors are unified into a three-dimensional vector including bandwidth, latency and fault tolerance dimensions, and the corresponding modified task content requirement vector and the protocol performance vector of each candidate communication protocol are obtained. Calculate the bandwidth dimension vector in the corrected task content requirement vector, and compare it with the bandwidth dimension vector in each of the protocol performance vectors to calculate the bandwidth dimension similarity for each candidate communication protocol. Calculate the vector of the delay dimension in the corrected task content requirement vector, and compare it with the vector of the delay dimension in each of the protocol performance vectors to calculate the similarity of the delay dimension to each candidate communication protocol. Calculate the vector of the fault tolerance dimension in the corrected task content requirement vector, and compare it with the vector of the fault tolerance dimension in each of the protocol performance vectors to calculate the similarity of the fault tolerance dimension for each candidate communication protocol. Based on the similarity of the bandwidth dimension, the similarity of the delay dimension, and the similarity of the fault tolerance dimension corresponding to the same candidate communication protocol, the similarity is calculated and used as the fit score of the candidate communication protocol. The step of determining the target communication protocol based on the fit score and all the candidate communication protocols includes: Determine whether the largest fit score among all the fit scores is greater than a first preset threshold. If so, then take the candidate communication protocol corresponding to the largest fit score as the target communication protocol. If not, then each of the fit scores is traversed in descending order, and the first candidate communication protocol that passes the preset condition is taken as the target communication protocol. The preset condition is that at least one of the bandwidth dimension similarity, the latency dimension similarity and the fault tolerance dimension similarity is greater than a second preset threshold. If the number of candidate communication protocols that meet the preset conditions is 0, then the default communication protocol in the default protocol configuration parameters will be used as the target communication protocol.

8. A multi-protocol printing communication interface adaptive device for relay protection devices, characterized in that, The device includes: The acquisition module is used to acquire printing task data generated by the relay protection device and determine the content type of the printing task data; The first generation module is used to generate a task content requirement vector based on the content type. The second generation module is used to obtain historical performance data of each candidate communication protocol and generate a protocol performance vector corresponding to each candidate communication protocol based on the historical performance data. The calculation module is used to calculate the similarity between the task content requirement vector and each of the protocol performance vectors, and to obtain the corresponding fit score for each of the candidate communication protocols. The determination module is used to determine the target communication protocol based on the fit score and all the candidate communication protocols, so as to transmit and output the printing task data according to the target communication protocol.

9. A storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the adaptive method for multi-protocol printing communication interface of relay protection device as described in any one of claims 1 to 7.

10. A computer device comprising a memory, a processor, and a computer program stored on a storage medium and executable on the processor, characterized in that, When the processor executes the program, it implements the adaptive method for multi-protocol printed communication interface of relay protection device as described in any one of claims 1 to 7.