Updating method of FC switch monitoring lookup table based on LFU

By employing the LFU strategy and a combination of hash tables, dictionaries, and doubly linked lists in the airborne avionics system, the monitoring query table of the FC switch is dynamically updated, solving the problem of low monitoring efficiency in existing technologies and achieving efficient key data capture and system performance improvement.

CN121907802APending Publication Date: 2026-04-21XIAN AVIATION COMPUTING TECH RES INST OF AVIATION IND CORP OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
XIAN AVIATION COMPUTING TECH RES INST OF AVIATION IND CORP OF CHINA
Filing Date
2025-12-26
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

In the existing technology, the method for updating the monitoring query table of the FC network switch of the airborne avionics system relies on manual static configuration or simple scripts, which may result in critical data not being monitored and reduce monitoring efficiency.

Method used

We adopt an LFU (Least Frequently Used)-based query table update method, combining hash tables, dictionaries, and doubly linked lists. Through frequency management and eviction policies, we dynamically update the monitoring query table to optimize query performance and resource management.

Benefits of technology

It improves the hit rate of the FC switch monitoring port lookup table and system performance, and is suitable for high-concurrency or large-scale FC network communication scenarios, ensuring that critical data is accurately captured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121907802A_ABST
    Figure CN121907802A_ABST
Patent Text Reader

Abstract

According to the updating method of the FC switch monitoring lookup table based on the LFU, the storage of the monitoring port lookup table is realized by adopting the idea of Robin Hood Hashing, and according to the strategy, a key with a longer detection distance hijacks the position of a key with a shorter detection distance when a Hash conflict occurs during insertion, so that the query performance is optimized, and the updating method is suitable for a high-performance network scene; secondly, modular design is adopted, message IDs existing in a monitoring port lookup table are stored in a grouped mode according to the access frequency through a dictionary and a double-linked list structure, and global sorting is avoided; thirdly, when the message ID stored in the monitoring port query table is full and updated, a double-layer elimination strategy is adopted, the message ID which is least recently used can be efficiently positioned, all frequencies do not need to be traversed, rapid updating is achieved, the method is suitable for a high-concurrency or large-scale FC network communication scene, and therefore the judgment efficiency of the target motion state is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the technical field of airborne networks in avionics systems, and particularly relates to a method for updating the monitoring query table of an FC switch based on LFU. Background Technology

[0002] In airborne avionics systems, real-time monitoring and analysis of FC network traffic is crucial for ensuring service performance and quickly locating faults. FC network switches typically provide dedicated monitoring ports for assigning and outputting data traffic values ​​to external analysis devices. These monitoring ports, as special communication ports, are responsible for identifying the data streams that need to be monitored. In message monitoring mode, each monitoring port maintains an independent lookup table (CAM table). For FC-ASM frames coming from the input module, the monitoring port checks the message ID field in the frame header according to the contents of the CAM table. It is required that only FC-ASM messages whose message IDs successfully match any entry in the lookup table will be copied and forwarded through the monitoring port. In the actual data transmission process of the FC network, the type and content of FC-ASM messages will change dynamically with the network status. The monitoring lookup table must be able to be updated dynamically to ensure that it always reflects the current monitoring needs and captures the most relevant and critical network management information.

[0003] Due to hardware resource limitations, each monitoring port can only support a limited number of ASM messages. The current method of querying table updates relies on manual static configuration or simple scripts, which may result in critical data not being monitored, thereby reducing monitoring efficiency. Summary of the Invention

[0004] The LFU-based FC switch monitoring query table update method provided by this invention can improve monitoring efficiency when performing real-time monitoring of FC network traffic. The technical solution of this invention has many beneficial effects, as described below: A method for updating a monitoring query table of an FC switch based on LFU (Low-Full Functionality), used to update the monitoring query table of an FC switch in an airborne avionics system, the method comprising: Step 1: Initialize the current monitoring query table. Set the minimum frequency MinFreq to 0 after initialization. Set the FC switch's monitoring port query table CAM, access frequency dictionary FreqDict, and multiple message ID doubly linked lists MsgidList to empty. The capacity of the monitoring port query table CAM is the maximum number of queries M supported by the FC switch's monitoring port table. Step 2: When the monitoring data buffer of the FC switch receives the ASM data frame sent by the avionics system, it extracts the message ID field from the ASM data frame and outputs the message ID field to the query interface of the ID configuration buffer of the FC switch. Step 3: Perform a query operation on the CAM table through the query interface. If the current message ID does not exist in the CAM table, proceed to step 4; if the current message ID exists in the CAM table, proceed to step 6. Step 4: Determine if the storage capacity of the CAM table has reached the maximum supported query quantity M. If the CAM table is full, find the lowest frequency message ID doubly linked list MsgidList in the access frequency dictionary FreqDict using the minimum frequency value MinFreq, delete the tail message ID node of the lowest frequency message ID doubly linked list MsgidList, and delete the relevant information of the message ID in the CAM table; if the CAM table is not full, proceed directly to step 5. Step 5: Initialize the frequency freq of the current message ID to 1, and set the minimum frequency MinFreq to 1; insert the node of the current message ID into the CAM table, and insert the node of the current message ID into the head of the doubly linked list MsgidList of message IDs with a frequency freq of 1 in the access frequency dictionary FreqDict, and then execute step 8. Step 6: Obtain the frequency freq of the current message ID in the CAM table, find the doubly linked list MsgidList of message IDs corresponding to the frequency freq of the current message ID in the access frequency dictionary FreqDict, and update the frequency freq of the current message ID to the frequency freq+1; move the current message ID from the doubly linked list MsgidList of message IDs corresponding to the frequency freq to the head of the doubly linked list MsgidList of message IDs corresponding to the frequency freq+1; Step 7: After removing the node of the current message ID from the access frequency dictionary FreqDict, if the doubly linked list MsgidList of message IDs corresponding to the current frequency fred is empty, and the minimum frequency MinFreq is the frequency freq, update the minimum frequency MinFreq to the frequency freq+1, and execute step 8. Step 8: The FC switch writes the current message to the monitoring buffer and sends it to the FC switch's monitoring port FCMAC client.

[0005] Compared with the prior art, the technical solution provided by the present invention has the following beneficial effects: To enable the switch to adapt to network changes, accurately filter and capture high-value FC-ASM messages, and minimize the swapping of entries in and out of the monitoring port lookup table, a "Least Frequently Used" (LFU) replacement strategy is employed. This involves combining hash tables, dictionaries, and doubly linked lists to convert frequency updates and eviction operations in the monitoring port lookup table into pointer operations. This LFU-based update method for the FC switch monitoring port lookup table improves the hit rate and system performance. Details are as follows: First, the "Robin Hood Hashing" approach is used to store the monitoring port query table. This strategy optimizes query performance by allowing keys with longer probe distances to "hijack" the positions of keys with shorter probe distances when a hash collision occurs during insertion. This is suitable for high-performance network scenarios. Second, the modular design uses a dictionary and doubly linked list structure to group and store message IDs in the monitoring port query table according to access frequency, avoiding global sorting, making it easy to understand and maintain, and effectively managing switch query table resources to improve data access performance. Third, when the message IDs stored in the monitoring port lookup table are full, a two-layer eviction strategy is adopted to update them. This strategy can efficiently locate the "least recently used" message ID without traversing all frequencies, thus achieving rapid updates. Given that the time consumption of other operations is relatively fixed and the embedded system's memory capacity is limited, this strategy plays a crucial role in increasing the hit rate of the FC switch monitoring port lookup table and improving system performance. It is suitable for high-concurrency or large-scale FC network communication scenarios. Attached Figure Description

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

[0007] Figure 1 This is a schematic diagram of the process of the present invention; Figure 2 A state diagram for monitoring port lookup table CAM, access frequency dictionary FreqDict, message ID doubly linked list MsgidList, and minimum frequency value MinFreq; Figure 3 A schematic diagram of the first state of CAM, FreqDict, MsgidList, and MinFreq; Figure 4A schematic diagram of the second state of CAM, FreqDict, MsgidList, and MinFreq; Figure 5 A schematic diagram of the third state of CAM, FreqDict, MsgidList, and MinFreq; Figure 6 A schematic diagram of the fourth state of CAM, FreqDict, MsgidList, and MinFreq; Figure 7 A schematic diagram of the fifth state for CAM, FreqDict, MsgidList, and MinFreq; Figure 8 A schematic diagram of the sixth state for CAM, FreqDict, MsgidList, and MinFreq; Figure 9 A schematic diagram of the seventh state for CAM, FreqDict, MsgidList, and MinFreq; Figure 10 A schematic diagram of the eighth state for CAM, FreqDict, MsgidList, and MinFreq; Figure 11 This is a schematic diagram of the ninth state for CAM, FreqDict, MsgidList, and MinFreq. Detailed Implementation

[0008] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, in the absence of conflict, the following embodiments and features in the embodiments can be combined with each other. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0009] It should be noted that various aspects of embodiments within the scope of the appended claims are described below. It will be apparent that the aspects described herein can be embodied in a wide variety of forms, and any particular structure and / or function described herein is merely illustrative. Based on this invention, those skilled in the art will understand that one aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects set forth herein can be used to implement the device and / or practice the method. Additionally, this device and / or method can be implemented using structures and / or functionalities other than one or more of the aspects set forth herein.

[0010] It should also be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. The drawings only show the components related to the present invention and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.

[0011] Furthermore, specific details are provided in the following description to facilitate a thorough understanding of the examples. However, those skilled in the art will understand that aspects can be practiced without these specific details. To enable those skilled in the art to better understand the invention, the invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, features defined as "first" and "second" may explicitly or implicitly include one or more of that feature. In the description of the invention, unless otherwise stated, "a plurality of" means two or more.

[0012] like Figures 1 to 11 The LFU-based update method for the FC switch monitoring query table, as shown, is used to update the monitoring query table of the FC switch in an airborne avionics system. Aiming to minimize the number of entries swapped in and out of the monitoring port query table, it utilizes a "Least Frequently Used" (LFU) replacement strategy. Through a combination of hash tables, dictionaries, and doubly linked lists, the frequency update and eviction operations in the monitoring port query table are converted into pointer operations, improving the hit rate of the FC switch monitoring port query table and system performance. This method is suitable for high-concurrency or large-scale FC network communication scenarios. The update method includes... Step 1: Initialize the current monitoring query table. Set the minimum frequency MinFreq to 0 after initialization. Set the FC switch's monitoring port query table CAM, access frequency dictionary FreqDict, and multiple message ID doubly linked lists MsgidList to empty. The capacity of the monitoring port query table CAM is the maximum number of queries M supported by the FC switch's monitoring port table. Step 2: When the monitoring data buffer of the FC switch receives the ASM data frame sent by the avionics system, it extracts the message ID field from the ASM data frame and outputs the message ID field to the query interface of the ID configuration buffer of the FC switch. Step 3: Perform a query operation on the CAM table through the query interface. If the current message ID does not exist in the CAM table, proceed to step 4; if the current message ID exists in the CAM table, proceed to step 6. Step 4: Determine if the storage capacity of the CAM table has reached the maximum number of queries supported, M. If the CAM table is full, find the lowest frequency message ID doubly linked list MsgidList in the access frequency dictionary FreqDict using the minimum frequency value MinFreq, and remove or delete the tail message ID node of the lowest frequency message ID doubly linked list MsgidList, and delete the relevant information of that message ID in the CAM table; if the CAM table is not full, proceed directly to step 5. Step 5: Initialize the frequency freq of the current message ID to 1, and set the minimum frequency MinFreq to 1; insert the node of the current message ID into the CAM table, and insert the node of the current message ID into the head of the doubly linked list MsgidList of message IDs with a frequency freq of 1 in the access frequency dictionary FreqDict, and then execute step 8. Step 6: Obtain the frequency freq of the current message ID in the CAM table, find the doubly linked list MsgidList of message IDs corresponding to the frequency freq of the current message ID in the access frequency dictionary FreqDict, and update the frequency freq of the current message ID to the frequency freq+1; move the current message ID from the doubly linked list MsgidList of message IDs corresponding to the frequency freq to the head of the doubly linked list MsgidList of message IDs corresponding to the frequency freq+1; Step 7: After removing the node of the current message ID from the access frequency dictionary FreqDict, if the doubly linked list MsgidList of message IDs corresponding to the current frequency fred is empty, and the minimum frequency MinFreq is the frequency freq, update the minimum frequency MinFreq to the frequency freq+1, and execute step 8. Step 8: The FC switch writes the current message to the monitoring buffer and sends it to the FC switch's monitoring port FCMAC client.

[0013] In one embodiment, step 1 uses a hash table to store the monitoring port query table CAM. The structure of the monitoring port query table CAM is defined as follows: key is the query key, msgid is the message ID, freq is the frequency, and distance is the offset. Considering that the message ID may have the following values... However, in actual FC network communication, the number of message IDs defined by ICD is far less than that of other methods. To optimize memory and reduce query time during hash collisions, this invention employs the "Robin Hood Hashing" algorithm to resolve hash collisions during element insertion. "Robin Hood Hashing" is an open-address-based hash algorithm that operates on the principle of "robbing the rich to help the poor." It records the offset of each element and compares the distance between the current key-value pair and the key-value pair in the occupied position. The key-value pair with the smaller distance is inserted into the current position, while the key-value pair with the larger distance is moved backward. This "robbing the rich to help the poor" key-value swapping mechanism balances element distribution, significantly reducing query time while maintaining high space utilization.

[0014] Furthermore, the access frequency dictionary FreqDict in step 1 is indexed by access frequency and mapped to the corresponding doubly linked list MsgidList of message IDs. Each frequency corresponds to a doubly linked list MsgidList of message IDs. The nodes in the doubly linked list of message IDs are sorted by insertion time, with the head of the list being the most recently accessed node and the tail being the least recently accessed node. The message ID doubly linked list MsgidList is defined as follows: MLNode *head is the head node, and MLNode *tail is the tail node. The data structure of the MLNode in the message ID doubly linked list MsgidList is defined as follows: msgid is the message ID, MLNode *prev is the pointer to the previous node, and MLNode *next is the pointer to the next node.

[0015] In one embodiment, the step of looking up message ID X in the CAM table in step 3 is as follows: Step (1): Calculate the initial position i of the current message ID based on the current message ID and the maximum number of queries supported M; Step (2): Set the probe distance curD of the current message ID node to 0; Step (3): If position i in the CAM table is empty, it means "not found" and the search ends; if position i in the CAM table is not empty, then proceed to step (4). Step (4): If the message ID Y at position i in the CAM table is the same as the current message ID X, then return the corresponding value of i; If the message ID Y at position i in the CAM table is different from the current message ID X, compare the distance of message ID Y with the curD of the current message ID X. If the distance of message ID Y is less than the curD of the current message ID X, it means that the message ID X was not found and the search ends. If the distance of message ID Y is greater than or equal to the curD of the current message ID X, increment the curD of the current message ID X by 1, move to the next search position in the CAM table, and repeat step (3) until the position of the current message ID X is found. Then return the corresponding position i value. Alternatively, if it is determined that the current message ID X does not exist in the CAM table, it means that the message ID X was not found and the search ends.

[0016] In one embodiment, the deletion step of message ID X in the CAM table in step 4 is as follows: Step (1): Find the position of message ID X in the CAM table using the lookup method. The offset is i. ; Step (2): Clear the information of position i in the CAM table and organize other elements in the CAM table backwards. The scan starts from the next position after position i, and the movement distance is 1. When a non-empty position is encountered, check the offset of the message IDY at that position. ,like >= Move message ID Y to position i in the CAM table and update = -curD; Step (3): If an empty space is generated, repeat step (2) until an unoccupied empty space or an element with an offset of 0 is encountered, thereby completing the deletion operation.

[0017] In one embodiment, step 5, the insertion step of message ID X into the CAM table, is as follows: Step (1): Calculate the initial position i of the current message ID based on the current message ID and the maximum number of queries supported M, and set the detection distance curD of the current node to 0; Step (2): If position i in the CAM table is empty, insert message ID X directly, and the offset distance of message ID X is 0, and the insertion is completed; Step (3): If the position i in the CAM table is not empty, then compare the offset of the message ID Y at position i with the current offset curD of the current message ID X. When distance(Y) < curD, swap the current message ID X and the message ID Y, insert the current message ID X into the position i of the message ID Y, and perform the insertion operation of the message ID Y. Update curD to the current detection distance of Y, curD = distance(Y) + 1; If the position i in the CAM table is empty, then curD is still identified as the current detection distance of the current message ID X, search for the next position in the CAM table, and curD = curD + 1; Step (4): Repeat step (3) until an empty position is found to complete the insertion.

[0018] Example: Assume that the maximum supported query quantity of an FC switch monitoring port query table is 4, and the FC-ASM messages are in the transmission order of the message IDs: 7, 5, 7, 3, 4, 2, 4, 2, 3, 7, 6. See the following introduction: Step 1, initialize the minimum frequency MinFreq = 0, the monitoring port query table CAM, the access frequency dictionary FreqDict, and the message ID doubly linked list MsgidList are all empty. Among them, the capacity of the CAM table is the same as the maximum supported query quantity 4 of the FC switch monitoring port query table.

[0019] Step 2, the communication port monitoring data buffer receives a data frame with the message ID 7, extracts the message ID field in the data frame, and outputs it to the message ID query control module...

[0020] Step 3, the message ID query control module outputs the extracted message ID to the query interface of the message ID configuration buffer for query operation on the CAM table. The message ID is 7, calculate hash(7) = 7 % 4 = 3, CAM[3] is empty, execute step 4.

[0021] Step 4, initialize the frequency of message 7 to 1, set MinFreq to 1, store 7 in the position of CAM[3], find the head of the MsgidList linked list with a frequency of 1 in FreqDict and insert 7 into the head of the linked list. At this time, the states of the monitoring port query table CAM, the access frequency dictionary FreqDict, the message ID doubly linked list MsgidList, and the minimum frequency MinFreq are as Figure 2 shown.

[0022] Step 5: The monitoring data buffer write control module writes the frame with message ID 7 into the monitoring buffer corresponding to the communication port. After the data writing is complete, it sends a monitoring buffer data validity flag signal to the monitoring data scheduling module. The monitoring data sending control module reads the frame from the monitoring buffer according to the scheduling result and sends it to the FCMAC client on the monitoring port. This completes the monitoring output for this data frame.

[0023] Step 6: The communication port monitoring data buffer receives a data frame with message ID 5, performs a query operation on the CAM table, hash(5) = 5%4 = 1, CAM[1] is empty. Initialize the frequency of message 5 to 1, and set MinFreq to 1. Insert 5 into the position of CAM[1], find the head of the MsgidList linked list with frequency 1 in FreqDict, and insert 7 into the head of the linked list. At this time, the states of CAM, FreqDict, MsgidList and MinFreq are as follows: Figure 3 As shown. The monitoring data scheduling module completes the scheduling, and the monitoring data transmission control module reads the frame with message ID 5 from the monitoring buffer and sends it to the monitoring port FC MAC client, completing the monitoring output of this data frame.

[0024] Step 7: The communication port monitoring data buffer receives a data frame with message ID 7 and performs a query operation on the CAM table. hash(7) = 7%4 = 3. The value in CAM[3] matches message ID 7, and the search is successful.

[0025] Step 8: In the CAM table, retrieve the frequency freq corresponding to message ID 7, which is 1. Find the MsgidList corresponding to frequency 1 in FredDict and remove the node from the MsgidList with frequency 1. Check that MinFreq equals freq, but the MsgidList with freq 1 is not empty. Update the frequency freq of 7 in the CAM table to freq + 1 = 2, and move the node with message ID 7 to the head of the MsgidList with frequency 2. At this point, the states of CAM, FreqDict, MsgidList, and MinFreq are as follows: Figure 4 As shown.

[0026] Step 9: The monitoring data scheduling module completes the scheduling, and the monitoring data sending control module reads the frame with message ID 7 from the monitoring buffer and sends it to the monitoring port FC MAC client to complete the monitoring output of this data frame.

[0027] Step 10, the communication port monitoring data buffer receives a data frame with message ID 3, and performs a query operation on the CAM table. hash(3) = 3 % 4 = 3, and the value 7 in CAM[3] does not match 3. The probing distance of 7 is 0, and the current probing distance of 3 is 0. Since the distances are the same, probe the next index position 0. At this time, CAM[0] is empty, and 3 is inserted into the position of CAM[0]. Among them, the probing distance distance value of 3 is 1.

[0028] Step 11, initialize the frequency of message 3 to 1, and set MinFreq to 1. Insert 3 into the head of the MsgidList linked list with freq = 1 in FreqDict. The monitoring data scheduling module completes the scheduling, and the monitoring data sending control module reads out the frame with message ID 3 in the monitoring buffer and sends it to the monitoring port FC MAC client to complete the monitoring output of this data frame. At this time, the states of CAM, FreqDict, MsgidList, and MinFreq are as Figure 5 shown Step 12, the communication port monitoring data buffer receives a data frame with message ID 4, and performs a query operation on the CAM table. hash(4) = 4 % 4 = 0, and CAM[0] = 3, which does not match 4. Compare their probing distances. The probing distance of 3 is 1, and the probing distance of 4 is 0. d(3) > d(4), and the probing distance of 4 is shorter, so it preempts the position of 3, and CAM[0] = 4. The probing distance of 3 is incremented by 1, and the next index position CAM[1] = 5 is probed. d(5) < d(3), the probing distance of 3 is incremented by 1, and continue to probe. CAM[2] is empty, and 3 is inserted into the position of CAM[2]. At this time, the probing distance of 3 is 3.

[0029] Step 13, initialize the frequency of message 4 to 1, and set MinFreq to 1. Insert 4 into the head of the MsgidList linked list with freq = 1 in FreqDict. The monitoring data scheduling module completes the scheduling, and the monitoring data sending control module reads out the frame with message ID 4 in the monitoring buffer and sends it to the monitoring port FC MAC client to complete the monitoring output of this data frame. At this time, the states of CAM, FreqDict, MsgidList, and MinFreq are as Figure 6 shown Step 14, the communication port monitoring data buffer receives a data frame with message ID 2, and performs a query operation on the CAM table. hash(2) = 2 % 4 = 2, and the value 3 in CAM[2] does not match 2. The probing distance of 3 is greater than the probing distance of 2, so continue linear probing. At this time, d(2) = 1. CAM[3] = 7, d(7) < d(2). Since the probing distance of the target element > the probing distance of the current element, stop searching and determine that 2 does not exist in CAM.

[0030] Step 15: The CAM table is full. Locate MsgidList with a frequency of 1 in FredDict using MinFreq=1, and eliminate its tail node 5. Delete 5 from the CAM table. hash(5)=5%4=1, the value in CAM[1] is exactly 5, so let CAM[1] use the "tombstone" flag to mark the deleted slot. Extract the detection distance of the "tombstone" position and add 1, then scan backward. The detection distance of CAM[2] is 3, so move it to the position of CAM[1], and decrement d(3) by 1. Continue detection. The detection distance of CAM[3] is 0, so stop moving and complete the deletion.

[0031] Step 16, insert 2 into the CAM table. hash(2)=2%4=2, CAM[2] is empty, directly insert 2 into CAM[2]. Initialize the frequency freq of 2 to 1, and set MinFreq to 1. Insert 2 into the head of the MsgidList linked list in FreqDict with freq of 1. The monitoring data scheduling module completes the scheduling, and the monitoring data sending control module reads the frame with message ID 2 from the monitoring buffer and sends it to the monitoring port FC MAC client to complete the monitoring output of this data frame. At this time, the states of CAM, FreqDict, MsgidList and MinFreq are as follows Figure 7 As shown Step 17: The communication port monitoring data buffer receives a data frame with message ID 4 and performs a query operation in the CAM table. This message exists in the CAM table. The frequency freq=2 corresponding to this message ID is retrieved from the CAM table, and the MsgidList corresponding to this frequency is found in FredDict. The current freq is updated to freq+1. Then, 4 is moved from the MsgidList corresponding to frequency 1 to the head of the MsgidList corresponding to frequency 2. The monitoring data scheduling module completes the scheduling, and the monitoring data transmission control module reads the frame with message ID 4 from the monitoring buffer and sends it to the monitoring port FC MAC client, completing the monitoring output for this data frame. At this time, the states of CAM, FreqDict, MsgidList, and MinFreq are as follows: Figure 8 As shown.

[0032] Step 18: After messages 2 and 3 communicate sequentially, the process is the same as in step 17. When message 3 moves from the MsgidList corresponding to frequency 1 to the head of the MsgidList corresponding to frequency 2, the MsgidList corresponding to frequency 1 becomes empty. At this time, the value of MinFreq is updated to 2. The monitoring data scheduling module completes the scheduling, and the monitoring data sending control module reads the frame with message ID 3 from the monitoring buffer and sends it to the monitoring port FC MAC client, completing the monitoring output for this data frame. At this time, the states of CAM, FreqDict, MsgidList, and MinFreq are as follows: Figure 9 As shown.

[0033] Step 19: The communication port monitoring data buffer receives a data frame with message ID 7, performs a lookup operation in the CAM table, and the lookup is successful. The frequency freq=2 corresponding to message ID 7 is retrieved from the CAM table. The corresponding MsgidList for this frequency is found in FredDict, and the current freq is updated to freq+1. Then, this value is moved from the MsgidList corresponding to freq=2 to the head of the MsgidList corresponding to freq+1=3. The monitoring data scheduling module completes scheduling, and the monitoring data transmission control module reads the frame with message ID 7 from the monitoring buffer and sends it to the monitoring port FC MAC client, completing the monitoring output for this data frame. At this time, the states of CAM, FreqDict, MsgidList, and MinFreq are as follows: Figure 10 As shown.

[0034] Step 20: The communication port monitoring data buffer receives an ASM data frame with message ID 6 and performs a query operation on the CAM table. The query fails because 6 does not exist in the CAM table. At this time, the CAM table is full. Using MinFreq=2, the MsgidList with a frequency of 2 is found in FredDict, and the tail node 4 is eliminated. Probing backward, CAM[1]=3, its probe distance is 2>0, so it moves forward to the position of CAM[0]. Continuing to probe backward, the probe distance of the value at the position of CAM[2] is 0, so it stops and the deletion is completed. At this time, the state in the CAM table is {[3,1,2],[x,x,x],[2,0,2],[7,0,3]}.

[0035] Step 21, insert 6 into the CAM table. hash(6)=6%4=2, CAM[2] already has the value 2, d(2)=0, continue to probe the position of CAM[3], at this time d(6)=1. The probe distance of 7 in CAM[3] is 0, which is less than the current probe distance of 6, 6 takes the position of 7 and stores it in CAM[3], the probe distance of 6 is 1. 7 continues to probe backward, the probe distance of 7 becomes 1. At the position of CAM[0], d(7)=d(3), 7 continues to probe backward, d(7) is incremented by 1. CAM[1] is empty, insert 7 into the position of CAM[1], at this time the probe distance of 7 is 2.

[0036] Step 22: Initialize frequency freq of node 6 to 1 and MinFreq to 1. Insert this node at the head of the MsgidList linked list in FreqList where freq is 1. The monitoring data scheduling module completes the scheduling, and the monitoring data transmission control module reads the frame with message ID 6 from the monitoring buffer and sends it to the monitoring port FC MAC client, completing the monitoring output for this data frame. At this time, the states of CAM, FreqDict, MsgidList, and MinFreq are as follows: Figure 11 As shown.

[0037] With the aim of minimizing the swapping of entries in and out of the table lookup table on the monitoring port, the effect is as follows: First, the "Robin Hood Hashing" approach is used to store the monitoring port query table. This strategy optimizes query performance by allowing keys with longer probe distances to "hijack" the positions of keys with shorter probe distances when a hash collision occurs during insertion. This is suitable for high-performance network scenarios. Second, the modular design uses a dictionary and doubly linked list structure to group and store message IDs in the monitoring port query table according to access frequency, avoiding global sorting, making it easy to understand and maintain, and effectively managing switch query table resources to improve data access performance. Third, when the message IDs stored in the monitoring port lookup table are full, a two-layer eviction strategy is adopted to update them. This strategy can efficiently locate the "least recently used" message ID without traversing all frequencies, thus achieving rapid updates. Given that the time consumption of other operations is relatively fixed and the embedded system's memory capacity is limited, this strategy plays a crucial role in increasing the hit rate of the FC switch monitoring port lookup table and improving system performance. It is suitable for high-concurrency or large-scale FC network communication scenarios.

[0038] The product provided by this invention has been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this invention. The descriptions of the embodiments above are merely for the purpose of helping to understand the core ideas of this invention. It should be noted that those skilled in the art can make various improvements and modifications to the invention without departing from the principles of the invention, and these improvements and modifications also fall within the protection scope of the invention claims.

Claims

1. A method for updating a monitoring query table of an FC switch based on LFU (Low-Full Functionality), used to update the monitoring query table of an FC switch in an airborne avionics system, characterized in that... The update method includes, Step 1: Initialize the current monitoring query table. Set the minimum frequency MinFreq to 0 after initialization. Set the FC switch's monitoring port query table CAM, access frequency dictionary FreqDict, and multiple message ID doubly linked lists MsgidList to empty. The capacity of the monitoring port query table CAM is the maximum number of queries M supported by the FC switch's monitoring port table. Step 2: When the monitoring data buffer of the FC switch receives the ASM data frame sent by the avionics system, it extracts the message ID field from the ASM data frame and outputs the message ID field to the query interface of the ID configuration buffer of the FC switch. Step 3: Perform a query operation on the CAM table through the query interface. If the current message ID does not exist in the CAM table, proceed to step 4; if the current message ID exists in the CAM table, proceed to step 6. Step 4: Determine if the storage capacity of the CAM table has reached the maximum supported query quantity M. If the CAM table is full, find the lowest frequency message ID doubly linked list MsgidList in the access frequency dictionary FreqDict using the minimum frequency value MinFreq, delete the tail message ID node of the lowest frequency message ID doubly linked list MsgidList, and delete the relevant information of the message ID in the CAM table; if the CAM table is not full, proceed directly to step 5. Step 5: Initialize the frequency freq of the current message ID to 1, and set the minimum frequency MinFreq to 1; insert the node of the current message ID into the CAM table, and insert the node of the current message ID into the head of the doubly linked list MsgidList of message IDs with a frequency freq of 1 in the access frequency dictionary FreqDict, and then execute step 8. Step 6: Obtain the frequency freq of the current message ID in the CAM table, find the doubly linked list MsgidList of message IDs corresponding to the frequency freq of the current message ID in the access frequency dictionary FreqDict, and update the frequency freq of the current message ID to the frequency freq+1; move the current message ID from the doubly linked list MsgidList of message IDs corresponding to the frequency freq to the head of the doubly linked list MsgidList of message IDs corresponding to the frequency freq+1; Step 7: After removing the node of the current message ID from the access frequency dictionary FreqDict, if the doubly linked list MsgidList of message IDs corresponding to the current frequency fred is empty, and the minimum frequency MinFreq is the frequency freq, update the minimum frequency MinFreq to the frequency freq+1, and execute step 8. Step 8: The FC switch writes the current message to the monitoring buffer and sends it to the FC switch's monitoring port FC MAC client.

2. The updating method according to claim 1, characterized in that, In step 1, a hash table is used to store the query table CAM for the monitoring port.

3. The updating method according to claim 2, characterized in that, The structure of the monitoring port query table CAM is defined as follows: key is the query key, msgid is the message ID, freq is the frequency, and distance is the offset.

4. The updating method according to claim 3, characterized in that, The access frequency dictionary FreqDict in step 1 is indexed by access frequency and mapped to the doubly linked list MsgidList of message IDs corresponding to that frequency. Each frequency corresponds to a doubly linked list of message IDs, MsgidList. Nodes in the doubly linked list are sorted by insertion time, with the head of the list being the most recently accessed node and the tail being the least recently accessed node. The message ID doubly linked list MsgidList is defined as MLNode *head as the head node and MLNode *tail as the tail node; The data structure of the MLNode node in the doubly linked list MsgidList of message IDs is defined as follows: msgid is the message ID, MLNode*prev is the pointer to the previous node, and MLNode *next is the pointer to the next node.

5. The updating method according to claim 4, characterized in that, The steps for looking up message ID X in the CAM table in step 3 are as follows: Step (1): Calculate the initial position i of the current message ID based on the current message ID and the maximum number of queries supported M; Step (2): Set the probe distance curD of the current message ID node to 0; Step (3): If position i in the CAM table is empty, it means that the CAM table was not found and the search ends; if position i in the CAM table is not empty, then proceed to step (4). Step (4): If the message ID Y at position i in the CAM table is the same as the current message ID X, then return the corresponding value of i; If the message ID Y at position i in the CAM table is different from the current message ID X, compare the distance of message ID Y with the curD of the current message ID X. If the distance of message ID Y is less than the curD of the current message ID X, it means that the message ID X was not found and the search ends. If the distance of message ID Y is greater than or equal to the curD of the current message ID X, increment the curD of the current message ID X by 1, move to the next search position in the CAM table, and repeat step (3) until the position of the current message ID X is found. Then return the corresponding position i value. Alternatively, if it is determined that the current message ID X does not exist in the CAM table, it means that the message ID X was not found and the search ends.

6. The updating method according to claim 5, characterized in that, The deletion step of message ID X in the CAM table in step 4 is as follows: Step (1): Find the position of message ID X in the CAM table using the lookup method. The offset is i. ; Step (2): Clear the information of position i in the CAM table and organize other elements in the CAM table backwards. The scan starts from the next position after position i, and the movement distance is 1. When a non-empty position is encountered, check the offset of the message ID Y of that position. ,like >= Move message ID Y to position i in the CAM table and update = -curD; Step (3): If an empty space is generated, repeat step (2) until an unoccupied empty space or an element with an offset of 0 is encountered, thereby completing the deletion operation.

7. The updating method according to claim 6, characterized in that, In step 5, the insertion step of message ID X into the CAM table is as follows: Step (1): Calculate the initial position i of the current message ID based on the current message ID and the maximum number of queries supported M, and set the detection distance curD of the current node to 0; Step (2): If position i in the CAM table is empty, insert message ID X directly, and the offset distance of message ID X is 0, and the insertion is completed; Step (3): If the position i in the CAM table is not empty, then compare the offset of the message ID Y at position i with the current offset curD of the current message ID X. When distance(Y) < curD, swap the current message ID X and the message ID Y, insert the current message ID X into the position i of the message ID Y, and perform the insertion operation of the message ID Y. Update curD to the current detection distance of Y, curD = distance(Y) + 1; If the position i in the CAM table is empty, then curD is still identified as the current detection distance of the current message ID X, find the next position in the CAM table, and curD = curD + 1; Step (4): Repeat step (3) until an empty position is found to complete the insertion.