Method and system for quickly forwarding instruction based on industrial protocol
By dynamically selecting and adjusting the instruction forwarding path in industrial systems, the problem of sessions being affected by single instruction blocking in the prior art is solved, precise management and fault tolerance at the instruction level are realized, and the reliability of data transmission and system stability are improved.
Patent Information
- Application Number
- CN202510193080.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-21
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2045-02-21
AI Technical Summary
The existing technology bundles the entire session and instructions, resulting in the entire session being affected when certain instructions are blocked, and lacks precise forwarding management at the instruction level and flexible fault tolerance mechanisms, and cannot cope with emergencies in complex network environments.
By obtaining the information of the session to be forwarded, the instruction table entry is generated, combined with the analysis rules of industrial protocols and network status evaluation, the instruction forwarding paths are dynamically selected and adjusted, and the instruction level is precise management and fault tolerance are achieved.
It improves the reliability of data transmission and the fault tolerance of the system, ensures smooth transmission of instructions when the network is unstable, and improves the stability of industrial control systems in complex network environments.
Smart Images

Figure CN119697099A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of communication data management, and in particular to a method and system for fast forwarding of industrial protocol instructions. Background Art
[0002] With the continuous development of industrial automation systems, communication based on industrial protocols plays a vital role in modern production processes. Industrial protocols, such as Modbus, OPC, Profibus, etc., are widely used in data transmission and control between devices. In order to ensure the real-time and stability of the production system, the transmission of instructions must be efficient and reliable. However, in traditional industrial systems, instruction transmission usually relies on static path selection and session management methods, and there is a risk that the entire session will be discarded due to the blocking or loss of a certain instruction. This not only affects the accuracy of data transmission, but may also cause failures or delays in industrial control systems.
[0003] In order to solve this problem, the existing technology has adopted the method of bundling the entire session and instructions together, which fails to achieve precise management at the instruction level. In particular, when certain instructions in the session are blocked due to network problems or other factors, the entire session will be affected. This static session management method fails to provide a flexible fault-tolerant mechanism, resulting in an inability to effectively respond to emergencies in complex network environments. How to achieve precise forwarding management at the instruction level and ensure that instructions can be smoothly transmitted when the network is unstable is a technical problem that needs to be solved urgently.
[0004] Therefore, there is an urgent need to invent a communication management system for industrial system command transmission to solve the problem that the existing technology bundles the entire session and command management, resulting in the entire session being affected when certain commands are blocked, lacks precise forwarding management at the command level and a flexible fault-tolerant mechanism, and is unable to cope with emergencies in complex network environments. Summary of the invention
[0005] In view of this, the present invention proposes a method and system for fast forwarding of industrial protocol instructions, aiming to solve the problem that the prior art bundles the entire session and instructions for management, resulting in the entire session being affected when certain instructions are blocked, lacks precise forwarding management at the instruction level and a flexible fault-tolerant mechanism, and is unable to cope with emergencies in complex network environments.
[0006] The present invention proposes a method for fast forwarding of industrial protocol instructions, comprising:
[0007] Acquire the session information to be forwarded, and generate a plurality of instruction table entries based on the session information to be forwarded;
[0008] Obtaining parsing rules for each industrial protocol, and determining each forwarding path of the instruction table item according to the instruction table item and the parsing rules;
[0009] Determine the main forwarding path of the instruction table entry according to the network status evaluation of each forwarding path, and determine each forwarding path except the main forwarding path as an alternative forwarding path;
[0010] The forwarding status of the main forwarding path for the instruction table entry is obtained, and according to the forwarding status, it is determined whether to use the alternative forwarding path to forward the instruction table entry.
[0011] Further, when a plurality of instruction table entries are generated based on the session information to be forwarded, the method includes:
[0012] Extracting instruction information from the session information to be forwarded;
[0013] Acquire context features of the to-be-forwarded session information, and modify the instruction information according to the context features;
[0014] The modified timestamps of the instruction information in the to-be-forwarded session information are obtained, a hash table of the instruction information is generated according to the timestamps, and the instruction table entry is generated based on the hash table.
[0015] Further, obtaining the parsing rules of each industrial protocol and determining each forwarding path of the instruction table item according to the instruction table item and the parsing rules includes:
[0016] Parsing the instruction table items according to the parsing rules of each of the industrial protocols;
[0017] Obtaining parsing results of each of the industrial protocols after parsing, and obtaining distance metrics between each of the parsing results;
[0018] The analysis results are clustered with K values according to the distance metric, and the forwarding path of the instruction table entry is determined according to the clustering result.
[0019] Further, according to the clustering result, determining the forwarding path of the instruction table entry includes:
[0020] Obtain the analysis result after clustering, where:
[0021] If the number of the parsing results is equal to 1, it is determined that the communication paths of the industrial protocols are all forwarding paths of the instruction table items;
[0022] If the number of analysis results is greater than 1, the number of clusters of each analysis result is obtained, and the clusters are arranged in reverse order according to the number of clusters. According to the analysis result ranked first, the communication path of the corresponding industrial protocol is the forwarding path of the instruction table item.
[0023] Furthermore, the analysis result specifically includes: the execution status, target device and execution parameters of the instruction in the instruction table entry.
[0024] Further, when determining the main forwarding path of the instruction table entry according to the network status evaluation of each forwarding path, it includes:
[0025] Obtaining the real-time delay, real-time bandwidth, packet loss rate in a preset time period, and historical transmission error rate of each forwarding path;
[0026] Determine the network status score of the forwarding path according to the real-time delay, real-time bandwidth, packet loss rate in a preset period, and historical transmission error rate:
[0027] ;
[0028] Wherein, S is the network status score of the forwarding path, n is the total number of evaluation parameters, wi is the weight coefficient of the ith evaluation parameter, ai is the exponential adjustment factor of the ith evaluation parameter, ri is the exponential adjustment factor of the ith preset evaluation parameter, β is the regularization factor, fi is the standardized and nonlinear function of the xith parameter, xi is the actual value of the ith evaluation parameter, wherein the evaluation parameter is real-time delay, real-time bandwidth, packet loss rate in a preset time period, or historical transmission error rate;
[0029] The network status scores of the forwarding paths are sorted in positive order, and the network status scores are sorted as the forwarding paths that correspond first, to determine the main forwarding path of the instruction table entry.
[0030] Further, when each forwarding path except the main forwarding path is determined as a candidate forwarding path, it includes:
[0031] Obtaining an average value of network status scores of the forwarding paths except the main forwarding path, and determining the average value as the preset network status score;
[0032] Determining whether the forwarding path is the candidate forwarding path according to the relationship between the network status score and the preset network status score:
[0033] When the network status score is greater than or equal to the preset network status score, determining the forwarding path as the candidate forwarding path;
[0034] When the network status score is less than the preset network status score, it is determined that the forwarding path is not the candidate forwarding path.
[0035] Further, determining whether to use an alternative forwarding path to forward the instruction table entry according to the forwarding state includes:
[0036] Obtaining the forwarding times of the forwarding state, and determining whether to use an alternative forwarding path to forward the instruction table entry according to the forwarding times and a pre-configured preset forwarding times:
[0037] When the forwarding number is less than or equal to the preset forwarding number, determining not to select the alternative forwarding path to forward the instruction table entry;
[0038] When the forwarding number is greater than the preset forwarding number, it is determined to select an alternative forwarding path to forward the instruction table entry.
[0039] Further, when selecting an alternative forwarding path to forward the instruction table entry, it includes:
[0040] Obtaining the real-time load of each of the candidate forwarding paths;
[0041] The real-time loads are sorted in positive order, and the instruction table entry is forwarded based on the candidate forwarding path corresponding to the first real-time load sort.
[0042] Compared with the prior art, the beneficial effect of the present invention is that by accurately managing the session information to be forwarded and the instruction table items, combined with the parsing rules of the industrial protocol and the network status evaluation, the dynamic selection and adjustment of the instruction forwarding path is realized. By separating the session information from the instruction table items, it is possible to perform detailed management at the instruction level, avoiding the situation where the entire session is lost due to the blocking of a single instruction. This precise forwarding mechanism at the instruction level greatly improves the reliability of data transmission and the fault tolerance of the system. In addition, based on the real-time network status evaluation, the main forwarding path and the alternative path can be flexibly selected. Under normal circumstances, the main forwarding path will undertake the task of forwarding instructions, but when there is a problem with the network status of the main path (such as delay, packet loss, etc.), the availability of the alternative path will be automatically evaluated and switched. This dynamic adjustment mechanism ensures the smooth transmission of instructions, reduces transmission interruptions caused by network fluctuations, and thus improves the stability of the industrial control system in a complex and dynamic network environment. Finally, by obtaining the parsing rules of each industrial protocol, instructions in different protocol formats can be accurately parsed and processed, thereby ensuring the correct forwarding of instructions. At the same time, it can also evaluate the path based on factors such as the network's real-time delay, bandwidth, packet loss rate, etc., and comprehensively consider multiple evaluation parameters to ensure the selection of the optimal forwarding path and improve overall transmission efficiency.
[0043] On the other hand, the present application also provides a system for fast forwarding of industrial protocol instructions, including:
[0044] an acquisition module, configured to acquire the session information to be forwarded, and generate a plurality of instruction table entries based on the session information to be forwarded;
[0045] a processing module, electrically connected to the acquisition module, the processing module being configured to acquire parsing rules of each industrial protocol, and determine each forwarding path of the instruction table item according to the instruction table item and the parsing rules; the processing module is further configured to determine a main forwarding path of the instruction table item according to a network status evaluation of each forwarding path, and determine each forwarding path except the main forwarding path as an alternative forwarding path;
[0046] The central control module is electrically connected to the processing module, and is configured to obtain the forwarding status of the main forwarding path to the instruction table entry, and determine whether to use the alternative forwarding path to forward the instruction table entry according to the forwarding status.
[0047] It can be understood that the method and system for fast forwarding of industrial protocol instructions in the above-mentioned embodiments of the present invention have the same beneficial effects and will not be described in detail. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0049] Figure 1 A flowchart of a method for fast forwarding of industrial protocol instructions provided by an embodiment of the present invention;
[0050] Figure 2 A functional block diagram of a system for fast forwarding of industrial protocol instructions provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0051] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art. It should be noted that, in the absence of conflict, the embodiments of the present invention and the features described in the embodiments can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0052] like Figure 1 As shown, in some embodiments of the present application, this embodiment provides a method for fast forwarding based on industrial protocol instructions, including:
[0053] Step S100: obtaining session information to be forwarded, and generating a number of instruction table entries based on the session information to be forwarded.
[0054] Specifically, when generating a plurality of instruction table entries based on the session information to be forwarded, the method includes: extracting instruction information from the session information to be forwarded, obtaining context features of the session information to be forwarded, and modifying the instruction information according to the context features, obtaining timestamps of each modified instruction information in the session information to be forwarded, generating a hash table of each instruction information according to the timestamps, and generating instruction table entries based on the hash table.
[0055] It can be understood that by obtaining the instruction information in the session to be forwarded. The session to be forwarded usually contains multiple instructions, and each instruction may have different execution parameters, status, and associated network path information. By extracting the instruction data from the session information, a corresponding table entry can be created for each instruction separately, so as to facilitate subsequent accurate management and forwarding. Secondly, on the basis of extracting the instruction information, the context characteristics of the session information to be forwarded also need to be considered. The context characteristics refer to dynamic information related to the session, such as time, environmental status, protocol type and other factors. According to these context characteristics, the extracted instruction information can be corrected. For example, some instructions may be affected by network delay or bandwidth limitation, and the parameters or execution order of these instructions can be adjusted according to the context to ensure the correctness and efficient execution of the instructions. Next, each corrected instruction information is identified by a timestamp. As part of the instruction information, the timestamp can be used to mark the generation or reception time of the instruction and provide a time sequence reference in the subsequent instruction forwarding process. Through the timestamp, the relationship between different instructions can be managed and synchronized to ensure that the order of instructions is not affected by network or system delays, and the instructions are transmitted in the correct timing. Then, based on the timestamp, a hash table of instruction information is generated. As an efficient data structure, the hash table can quickly store and retrieve instruction information based on the unique identifier of the instruction information (such as timestamp). By mapping the corrected instruction information into the hash table, it can ensure that each instruction table entry has a unique identifier, thereby avoiding the risk of instruction conflict or information loss. The structure of the hash table makes the search and update of instructions more efficient, improving the speed and reliability of the system processing instructions. Finally, based on the hash table, the instruction table entry is generated. The instruction table entry not only contains the basic information of the instruction (such as identifier, execution status, parameters, etc.), but is also closely related to the session information and its contextual characteristics. Through the instruction table entry, the forwarding path, execution status and processing order of each instruction can be accurately controlled.
[0056] It can be seen that by extracting instruction information, each instruction can be managed independently to ensure accurate tracking and processing of each instruction. In this way, each instruction can be scheduled and managed independently, which improves the flexibility and controllability of instruction transmission and avoids the complexity and potential risks brought by bundling multiple instructions together. Secondly, the context characteristics of the session information to be forwarded are also considered, and the instruction information is modified according to these characteristics. The context characteristics include dynamic information such as time, network status, and protocol type, which may affect the execution mode or priority of the instruction. By modifying the instruction according to the context characteristics, it is possible to adapt to different environmental conditions more flexibly and ensure the correctness and efficient execution of the instruction. This dynamic adjustment can reduce instruction errors or delays caused by external factors. In addition, the modified instruction information is managed in combination with the timestamp. As an important time identifier, the timestamp can accurately track the generation and transmission timing of each instruction. Through the timestamp, it can ensure that the instructions are processed in the correct order to avoid execution errors or conflicts caused by the disorder of instruction transmission order. The application of timestamps further improves the accuracy and timeliness of instruction management, especially when processing multiple concurrent instructions, it can effectively coordinate the execution order between instructions. Next, a hash table of instruction information is generated based on the timestamp. A hash table is an efficient data structure that can quickly store and search based on the unique identifier of the instruction (such as a timestamp). The application of hash tables ensures that instruction information can be quickly accessed and processed, reducing the search complexity and response time of the system. Through hash tables, a large number of instructions can be efficiently managed, and the independence and accuracy of each instruction can be ensured. Finally, by generating instruction table entries based on hash tables, information such as the status, execution parameters, and associated network paths of each instruction can be accurately managed. The generation of instruction table entries makes the instruction forwarding process more controllable and flexible, and the system can select the most appropriate forwarding path based on the characteristics of the instruction and the network conditions.
[0057] Step S200: Obtain the parsing rules of each industrial protocol, and determine each forwarding path of the instruction table entry according to the instruction table entry and the parsing rules.
[0058] Specifically, obtaining the parsing rules of each industrial protocol and determining each forwarding path of the instruction table item according to the instruction table item and the parsing rules includes: parsing the instruction table item according to the parsing rules of each industrial protocol. Obtaining the parsing results of each industrial protocol after parsing, and obtaining the distance measurement between each parsing result. K-value clustering is performed on each parsing result according to the distance measurement, and the forwarding path of the instruction table item is determined according to the clustering result.
[0059] Specifically, when determining the forwarding path of the instruction table item according to the clustering result, it includes: obtaining the parsing result after clustering, wherein: if the number of parsing results is equal to 1, it is determined that the communication path of each industrial protocol is the forwarding path of the instruction table item. If the number of parsing results is greater than 1, the number of clusters when each parsing result is clustered is obtained, and according to the number of clusters, they are arranged in reverse order, and according to the parsing result ranked first, the communication path of the corresponding industrial protocol is the forwarding path of the instruction table item.
[0060] Specifically, the parsing result includes: the execution status, target device and execution parameters of the instruction in the instruction table entry.
[0061] It can be understood that the instruction table items are parsed by obtaining the parsing rules of each industrial protocol. The parsing rules define how to extract and understand instruction information according to different industrial protocols, helping the system understand key information such as the content, status and target device of the instruction. This process ensures that multiple industrial protocols can be processed and adapted to complex protocol environments, thereby ensuring that the instruction can be transmitted correctly. Next, the parsed instruction table items generate parsing results and calculate the distance metric between each parsing result. The distance metric is to judge the similarity between each parsing result by a certain metric standard (such as Euclidean distance, Manhattan distance, etc.). According to the distance metric, the system can evaluate the similarity of different parsing results, thereby providing a basis for subsequent clustering processing. This measurement method effectively improves the processing efficiency of instructions and ensures that the classification and analysis of instructions are more accurate. After obtaining the distance metric of the parsing results, these parsing results are grouped by the K value clustering algorithm. The K value clustering algorithm is a commonly used unsupervised learning method that divides the parsing results into different clusters according to their similarity. Each cluster represents a group of similar parsing results, which can effectively find the most suitable forwarding path when processing the same type of instructions. The application of clustering method can handle various complex instruction patterns and network situations. Based on the clustering results, the forwarding path of the instruction is determined according to the size and order of each cluster. If the number of parsing results is equal to 1, the forwarding path of the instruction table item will be the communication path corresponding to the unique parsing result. If the number of parsing results is greater than 1, they will be sorted according to the size of the clusters, and the largest cluster will be selected as the forwarding path of the instruction. This method of sorting in reverse order by the number of clusters ensures that the most appropriate path is selected first, improving the efficiency and reliability of instruction forwarding. Finally, the parsing results in the instruction table item include information such as the execution status, target device, and execution parameters of the instruction. The execution status reflects the current progress of the instruction or whether it has been completed, the target device indicates the final execution location of the instruction, and the execution parameters describe in detail the specific requirements for the execution of the instruction.
[0062] It can be seen that by parsing the instruction table items according to the parsing rules, the data of different protocols can be processed uniformly, which makes it compatible with multiple industrial protocols and ensures the correct parsing and efficient transmission of instructions. Secondly, based on the distance measurement between the parsing results, the similarity between different instructions can be evaluated, and the instructions with similar properties can be grouped together through K value clustering. Through this clustering process, the relationship between instructions can be better understood, so that when determining the forwarding path, the most appropriate path can be given priority, which improves the efficiency and reliability of forwarding. In addition, clustering avoids the situation where instructions are inefficient due to overly detailed path selection. Third, when the number of parsing results is 1, the communication path of all protocols can be automatically determined as the forwarding path of the instruction, which provides a quick path selection method for processing instruction forwarding in simple scenarios. In this case, unnecessary path evaluation is avoided, computing resources are saved, response speed is improved, and everything is ensured to proceed smoothly according to the predetermined rules in simple cases. When the number of parsing results is greater than 1, they are arranged in reverse order according to the number of clusters to ensure that the optimal parsing result is given priority as the forwarding path. This method helps to optimize the forwarding path selection of instructions through sorting, and gives priority to the path with the best network status in the case of multiple options, ensuring efficient and accurate transmission of instructions. This dynamic adjustment mechanism significantly improves the flexibility of the system in dealing with instruction forwarding in complex network environments. Finally, through detailed analysis results, such as the extraction of instruction execution status, target device and execution parameters, we can fully understand the execution background and requirements of each instruction and ensure the correct forwarding of instructions. In this way, not only the accuracy of the forwarding path is improved, but also errors or delays caused by unclear execution information can be avoided during the execution of instructions, making the overall system more intelligent and capable of dealing with various complex situations.
[0063] Step S300: Determine a primary forwarding path of the instruction table entry according to the network status evaluation of each forwarding path, and determine each forwarding path except the primary forwarding path as an alternative forwarding path.
[0064] Specifically, when determining the main forwarding path of the instruction table entry based on the network status evaluation of each forwarding path, it includes: obtaining the real-time delay, real-time bandwidth, packet loss rate in a preset period, and historical transmission error rate of each forwarding path. Based on the real-time delay, real-time bandwidth, packet loss rate in a preset period, and historical transmission error rate, the network status score of the forwarding path is determined:
[0065] .
[0066] Among them, S is the network status score of the forwarding path, n is the total number of evaluation parameters, wi is the weight coefficient of the i-th evaluation parameter, ai is the exponential adjustment factor of the i-th evaluation parameter, ri is the exponential adjustment factor of the i-th preset evaluation parameter, β is the regularization factor, fi is the standardized and nonlinear function of the xi-th parameter, xi is the actual value of the i-th evaluation parameter, and the evaluation parameter is the real-time delay, real-time bandwidth, the packet loss rate of the preset time period, or the historical transmission error rate. Sort the network status scores of each forwarding path in positive order, and sort the network status scores into the first corresponding forwarding path to determine the main forwarding path of the instruction table entry.
[0067] Specifically, when determining that each forwarding path other than the main forwarding path is an alternative forwarding path, it includes: obtaining the average of the network status scores of each forwarding path other than the main forwarding path, and determining it as a preset network status score. According to the relationship between the network status score and the preset network status score, determining whether the forwarding path is an alternative forwarding path: when the network status score is greater than or equal to the preset network status score, determining that the forwarding path is an alternative forwarding path. When the network status score is less than the preset network status score, determining that the forwarding path is not an alternative forwarding path.
[0068] It is understandable that by comprehensively evaluating the network status of the forwarding path, each forwarding path is scored using multiple indicators such as real-time delay, real-time bandwidth, packet loss rate and historical transmission error rate. These evaluation parameters can reflect the stability, reliability and transmission efficiency of the path, thereby providing a quantitative basis for subsequent path selection. By using multiple parameters for weighting and adjustment, the path can be dynamically evaluated according to the characteristics of different paths, making the scoring system more accurate and comprehensive. Secondly, exponential adjustment factors and weight coefficients are introduced in the evaluation process. These factors assign and adjust weights to different evaluation parameters, thereby taking into account the relative importance of each parameter to the path status. For example, real-time delay and bandwidth may be more critical than historical transmission error rate, so these parameters can be given higher weight coefficients. At the same time, the application of exponential adjustment factors can adjust the parameters nonlinearly, further improve the accuracy of the scoring system, avoid over-reliance on a single parameter, and thus ensure the comprehensiveness of path selection. Third, by sorting the scores of multiple forwarding paths, the path with the best status can be quickly identified as the main forwarding path. The mechanism of network status score sorting ensures that the selection of the main forwarding path has the greatest possible stability and reliability. This dynamic sorting method not only reduces human intervention in the selection process, but also can flexibly adjust the forwarding path according to the real-time changes in the network status, thereby improving the response speed and adaptability of forwarding. For the selection of alternative forwarding paths, the average of the network status scores of other paths except the main path is calculated and used as the preset network status score. This average calculation method ensures that the selection of alternative paths can follow certain standards and does not blindly select paths with lower scores. At the same time, only when the score of the alternative path reaches or exceeds the preset standard will it be identified as an available path. This setting ensures the effectiveness and reliability of the alternative path and avoids the selection of unstable or poor paths. Finally, through the above-mentioned scoring and comparison mechanism, it is possible to flexibly respond to changes in network status and dynamically determine the main forwarding path and alternative paths. This path selection method based on the scoring system not only improves the efficiency and accuracy of path selection, but also ensures that instructions can quickly and reliably complete forwarding tasks in complex network environments.
[0069] It can be seen that through multi-dimensional network status evaluation, a comprehensive score is assigned to each forwarding path, making the path selection more systematic and scientific. Using indicators such as real-time delay, real-time bandwidth, packet loss rate and historical transmission error rate to calculate the network status score of the path can fully reflect the network performance and avoid the excessive influence of a single factor on path selection. This multi-dimensional evaluation method can consider the stability, reliability and transmission efficiency of the path from multiple angles, so as to more accurately select the optimal forwarding path. Secondly, by introducing adjustment methods such as weight coefficients, exponential adjustment factors and standardized nonlinear functions, the score can flexibly adapt each evaluation parameter according to different network environments and requirements. These technical measures effectively avoid the deviation or over-reliance on a single parameter, and can dynamically adjust the scoring criteria according to actual network conditions, thereby improving the adaptability and flexibility to different network environments. For example, for some specific scenarios or applications, latency may be more critical, while in other scenarios, bandwidth may dominate and can be automatically optimized according to these changes. Further, by sorting the network status scores of the forwarding paths and selecting the path with the highest score as the main forwarding path, it can be ensured that the transmission of data instructions can be carried out preferentially through the best path. The automation of this process reduces the need for manual intervention and improves decision-making efficiency and accuracy. More importantly, this mechanism not only ensures the optimization of the primary path, but also provides a data support for path selection based on objective evaluation, rather than relying solely on experience or static rules. Finally, when determining the alternative forwarding path, the path selection criteria are further refined by calculating the average network status score of each path and comparing it with the preset network status score. This dynamic adjustment method enables the selection of alternative paths based on the real-time network status to ensure the stability and reliability of the alternative paths. When the network status fluctuates, the alternative path can be used as a fast alternative to ensure that data transmission is not disturbed, improving the system's fault tolerance and redundant design.
[0070] Step S400: Obtain the forwarding status of the main forwarding path for the instruction table entry, and determine whether to use the alternative forwarding path to forward the instruction table entry according to the forwarding status.
[0071] Specifically, when determining whether to use an alternative forwarding path to forward the instruction table entry according to the forwarding state, it includes: obtaining the forwarding times of the forwarding state, and determining whether to use an alternative forwarding path to forward the instruction table entry according to the forwarding times and the pre-configured preset forwarding times: when the forwarding times are less than or equal to the preset forwarding times, it is determined that the alternative forwarding path is not used to forward the instruction table entry. When the forwarding times are greater than the preset forwarding times, it is determined that the alternative forwarding path is used to forward the instruction table entry.
[0072] Specifically, when selecting an alternative forwarding path to forward the instruction table entry, it includes: obtaining the real-time load of each alternative forwarding path, sorting each real-time load in positive order, and forwarding the instruction table entry based on the alternative forwarding path corresponding to the first ranked real-time load.
[0073] It is understandable that by comparing the forwarding times with the preset forwarding times, it is possible to flexibly determine whether an alternative forwarding path needs to be enabled. When the network state is unstable or there are problems such as delays, the main forwarding path may not be able to successfully complete the instruction transmission. By setting the preset forwarding times, when the forwarding times of a certain forwarding path exceed the preset value, it will automatically switch to the alternative path for forwarding, thereby ensuring the reliable transmission of instructions. This not only improves the reliability of instruction transmission, but also reduces failed retransmissions caused by network fluctuations. Secondly, by introducing a real-time load evaluation mechanism, the path with the lightest current load can be selected for instruction forwarding according to the load of each alternative path. This approach effectively avoids excessive use of paths with heavy loads, thereby reducing network congestion and delays. Through this real-time load optimization, a more accurate selection is made among multiple alternative paths, so that instructions can be transmitted through the path with the best network conditions, thereby improving the overall network resource utilization efficiency. Further, the mechanism of real-time load sorting and selecting the optimal alternative path ensures that instruction transmission can still maintain the best transmission performance even when multiple alternative paths exist. This refined path selection strategy significantly improves the speed of instruction forwarding and avoids additional delays or failures on alternative paths. By monitoring the load of each path in real time, it can make timely adjustments when network congestion or insufficient resources occur, reducing the risk of instruction transmission interruption. In addition, by dynamically adjusting the use of alternative paths, this method enhances the resilience and fault tolerance of the network system. Even if unforeseen problems or performance degradation occur on the main forwarding path, it can quickly switch to the most appropriate alternative path to ensure that instructions can continue to be transmitted. This reduces the impact of network failures on the business.
[0074] In the above embodiment, by accurately managing the session information to be forwarded and the instruction table items, combined with the parsing rules of the industrial protocol and the network status evaluation, the dynamic selection and adjustment of the instruction forwarding path is realized. By separating the session information from the instruction table items, it is possible to perform detailed management at the instruction level, avoiding the situation where the entire session is lost due to the blocking of a single instruction. This precise forwarding mechanism at the instruction level greatly improves the reliability of data transmission and the fault tolerance of the system. In addition, based on the real-time network status evaluation, the main forwarding path and the alternative path can be flexibly selected. Under normal circumstances, the main forwarding path will undertake the task of forwarding instructions, but when there is a problem with the network status of the main path (such as delay, packet loss, etc.), the availability of the alternative path will be automatically evaluated and switched. This dynamic adjustment mechanism ensures the smooth transmission of instructions, reduces transmission interruptions caused by network fluctuations, and thus improves the stability of the industrial control system in a complex and dynamic network environment. Finally, by obtaining the parsing rules of each industrial protocol, instructions in different protocol formats can be accurately parsed and processed, thereby ensuring the correct forwarding of instructions. At the same time, it can also evaluate the path based on factors such as the network's real-time delay, bandwidth, packet loss rate, etc., and comprehensively consider multiple evaluation parameters to ensure the selection of the optimal forwarding path and improve overall transmission efficiency.
[0075] In another preferred embodiment based on the above embodiment, Figure 2 As shown, this embodiment provides a system based on fast forwarding of industrial protocol instructions, including: an acquisition module, a processing module and a central control module.
[0076] Specifically, the acquisition module is configured to acquire the session information to be forwarded, and to generate a number of instruction table entries based on the session information to be forwarded. The processing module is electrically connected to the acquisition module, and the processing module is configured to acquire the parsing rules of each industrial protocol, and to determine each forwarding path of the instruction table entry according to the instruction table entry and the parsing rules. The processing module is also configured to determine the main forwarding path of the instruction table entry based on the network status evaluation of each forwarding path, and to determine each forwarding path except the main forwarding path as an alternative forwarding path. The central control module is electrically connected to the processing module, and the central control module is configured to acquire the forwarding status of the main forwarding path for the instruction table entry, and to determine whether to use the alternative forwarding path to forward the instruction table entry according to the forwarding status.
[0077] It can be understood that the method and system for fast forwarding of industrial protocol instructions in the above-mentioned embodiments of the present invention have the same beneficial effects and will not be described in detail.
[0078] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0079] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0080] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0081] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0082] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A method for fast forwarding of industrial protocol instructions, characterized in that: include: Acquire the session information to be forwarded, and generate a plurality of instruction table entries based on the session information to be forwarded; Obtaining parsing rules for each industrial protocol, and determining each forwarding path of the instruction table item according to the instruction table item and the parsing rules; Determine the main forwarding path of the instruction table entry according to the network status evaluation of each forwarding path, and determine each forwarding path except the main forwarding path as an alternative forwarding path; The forwarding status of the main forwarding path for the instruction table entry is obtained, and according to the forwarding status, it is determined whether to use the alternative forwarding path to forward the instruction table entry.
2. The method for fast forwarding based on industrial protocol instructions according to claim 1, characterized in that: When a plurality of instruction table entries are generated based on the session information to be forwarded, the method includes: Extracting instruction information from the session information to be forwarded; Acquire context features of the to-be-forwarded session information, and modify the instruction information according to the context features; The modified timestamps of the instruction information in the to-be-forwarded session information are obtained, a hash table of the instruction information is generated according to the timestamps, and the instruction table entry is generated based on the hash table.
3. The method for fast forwarding based on industrial protocol instructions according to claim 1, characterized in that: Acquiring the parsing rules of each industrial protocol and determining each forwarding path of the instruction table item according to the instruction table item and the parsing rules includes: Parsing the instruction table items according to the parsing rules of each of the industrial protocols; Obtaining parsing results of each of the industrial protocols after parsing, and obtaining distance metrics between each of the parsing results; The analysis results are clustered with K values according to the distance metric, and the forwarding path of the instruction table entry is determined according to the clustering result.
4. The method for fast forwarding based on industrial protocol instructions as claimed in claim 3, characterized in that: Determining the forwarding path of the instruction table entry according to the clustering result includes: Obtain the analysis result after clustering, where: If the number of the parsing results is equal to 1, it is determined that the communication paths of the industrial protocols are all forwarding paths of the instruction table items; If the number of analysis results is greater than 1, the number of clusters of each analysis result is obtained, and the clusters are arranged in reverse order according to the number of clusters. According to the analysis result ranked first, the communication path of the corresponding industrial protocol is the forwarding path of the instruction table item.
5. The method for fast forwarding based on industrial protocol instructions as claimed in claim 4, characterized in that: The analysis result specifically includes: the execution status, target device and execution parameters of the instruction in the instruction table entry.
6. The method for fast forwarding based on industrial protocol instructions according to claim 1, characterized in that: Determining the main forwarding path of the instruction table entry according to the network status evaluation of each forwarding path includes: Obtaining the real-time delay, real-time bandwidth, packet loss rate in a preset time period, and historical transmission error rate of each forwarding path; Determine the network status score of the forwarding path according to the real-time delay, real-time bandwidth, packet loss rate in a preset period, and historical transmission error rate: ; Wherein, S is the network status score of the forwarding path, n is the total number of evaluation parameters, wi is the weight coefficient of the ith evaluation parameter, ai is the exponential adjustment factor of the ith evaluation parameter, ri is the exponential adjustment factor of the ith preset evaluation parameter, β is the regularization factor, fi is the standardized and nonlinear function of the xith parameter, xi is the actual value of the ith evaluation parameter, wherein the evaluation parameter is real-time delay, real-time bandwidth, packet loss rate in a preset time period, or historical transmission error rate; The network status scores of the forwarding paths are sorted in positive order, and the network status scores are sorted as the forwarding paths that correspond first, to determine the main forwarding path of the instruction table entry.
7. The method for fast forwarding based on industrial protocol instructions as claimed in claim 6, characterized in that: When each forwarding path except the main forwarding path is determined as a candidate forwarding path, it includes: Obtaining an average value of network status scores of the forwarding paths except the main forwarding path, and determining the average value as a preset network status score; Determining whether the forwarding path is the candidate forwarding path according to the relationship between the network status score and the preset network status score: When the network status score is greater than or equal to the preset network status score, determining the forwarding path as the candidate forwarding path; When the network status score is less than the preset network status score, it is determined that the forwarding path is not the candidate forwarding path.
8. The method for fast forwarding based on industrial protocol instructions as claimed in claim 1, characterized in that: Determining whether to use an alternative forwarding path to forward the instruction entry according to the forwarding state includes: Obtaining the forwarding times of the forwarding state, and determining whether to use an alternative forwarding path to forward the instruction table entry according to the forwarding times and a pre-configured preset forwarding times: When the forwarding number is less than or equal to the preset forwarding number, determining not to select the alternative forwarding path to forward the instruction table entry; When the forwarding number is greater than the preset forwarding number, it is determined to select an alternative forwarding path to forward the instruction table entry.
9. The method for fast forwarding based on industrial protocol instructions as claimed in claim 8, characterized in that: When selecting an alternative forwarding path to forward the instruction table entry, it includes: Obtaining the real-time load of each of the candidate forwarding paths; The real-time loads are sorted in positive order, and the instruction table entry is forwarded based on the candidate forwarding path corresponding to the first real-time load sort.
10. A system based on fast forwarding of industrial protocol instructions, adopting a method based on fast forwarding of industrial protocol instructions as described in any one of claims 1 to 9, characterized in that: include: an acquisition module, configured to acquire the session information to be forwarded, and generate a plurality of instruction table entries based on the session information to be forwarded; a processing module, electrically connected to the acquisition module, the processing module being configured to acquire parsing rules of each industrial protocol, and determine each forwarding path of the instruction table item according to the instruction table item and the parsing rules; the processing module is further configured to determine a main forwarding path of the instruction table item according to a network status evaluation of each forwarding path, and determine each forwarding path except the main forwarding path as an alternative forwarding path; The central control module is electrically connected to the processing module, and is configured to obtain the forwarding status of the main forwarding path to the instruction table entry, and determine whether to use the alternative forwarding path to forward the instruction table entry according to the forwarding status.
Citation Information
Patent Citations
Control method and device for forwarding paths and control equipment
CN108075980A
Additable and separable database session
CN116157788A
Network load balancing method and device based on link and equipment states
CN116232977A
Load sharing method and device based on RoCE session
CN116319934A
Cross-network-element deterministic forwarding method and device, network element and storage medium
CN117354233A