A time-ordered access control method based on period division for a periodic flow table
By dividing the data stream into periodic groups and using multi-level comparators for ordered access control, the problem of duplicate entries in periodic flow tables is solved, enabling time-ordered access without duplicate entries and improving the storage efficiency and determinism of data transmission of TSN switches.
Patent Information
- Application Number
- CN202310501625.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-06
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2043-05-06
AI Technical Summary
In existing technologies, periodic flow tables suffer from duplicate entries, leading to wasted storage space and reduced determinism in data transmission, which is particularly prominent in resource-constrained TSN switches.
Data streams with the same transmission period are grouped into period groups, and non-overlapping pairwise comparisons are performed using multi-level comparators. The target data stream is determined using a period partitioning method, and the location of the target data stream is stored and updated using a storage structure to avoid duplicate entries.
It implements time-ordered access control for non-duplicate entries in periodic flow tables, reduces storage space usage, improves the determinism and efficiency of data transmission, and is suitable for large-scale time-sensitive networks.
Smart Images

Figure CN116633877B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer network technology, and in particular to a time-ordered access control method based on periodic partitioning of periodic flow tables. Background Technology
[0002] Time-Sensitive Networking (TSN), proposed and standardized by the IEEE 802.1TSN Group in 2012, has become an important research direction for the transformation and upgrading of industrial internet infrastructure and is widely accepted by academia and industry. Periodic flow tables are the core configuration information for TSN to achieve deterministic real-time transmission.
[0003] Periodic flow tables typically contain windows (w i That is, the duration of the window and the start time (o). i (i.e., window start time), data stream (f) i This includes entries such as the scheduled messages to be transmitted within the window duration. The flow table is executed sequentially based on the start time, starting at time o. i Open data stream f i The corresponding queue switch, during the window duration w i The TSN sends messages for the data stream within a given window. When the window duration expires, the queue switch closes, and other queue switches open to send other data. The flow table cycles periodically from the first entry after executing the last entry. The cycle period of the flow table is the least common multiple (LCM) of all data stream cycles, known as the macro cycle. TSN uses periodic flow tables to control the gating of different queues, enabling real-time data streams to be sent at precise times, thus ensuring determinism and real-time data transmission. However, such access control methods can lead to duplicate entries. Figure 1 The example illustrates three data streams with a macro period of 4ms. Within this macro period, data stream f1 appears 4 times, f2 appears twice, and f3 appears once. Therefore, due to the repetition of entries, the periodic flow table for the three data streams contains 7 entries. Generally, for n data streams f1, f2, ..., f... n The space complexity is When the macro cycle differs significantly from the cycle of a single data stream, it will lead to a large number of duplicate data stream entries, resulting in a waste of storage space.
[0004] To address the above issues, one solution is to increase the window size. iThe size of the window is adjusted to allow multiple data streams to be transmitted within it, thereby reducing the number of entries in the periodic flow table. However, these methods only alleviate the problem of duplicate entries and do not fundamentally solve it. Moreover, transmitting multiple data streams within the same window introduces greater latency jitter, compromising the determinism of data transmission. Furthermore, TSN switches are typical embedded devices, and resource constraints are a defining characteristic. Therefore, implementing a time-ordered access control method for periodic flow tables with no duplicate entries is of great significance to TSN switches. Summary of the Invention
[0005] Embodiments of the present invention provide a time-ordered access control method for periodic flow tables based on periodic partitioning, so as to realize ordered access control of data flow in periodic flow tables.
[0006] To achieve the above objectives, the present invention adopts the following technical solution.
[0007] A time-ordered access control method for periodic flow tables based on period partitioning includes:
[0008] Data streams with the same sending period are grouped into period groups, and the target data stream to be sent in each period group is found based on the sending time of each data stream.
[0009] The storage structure stores a set of target data streams to be sent in each cycle group. A multi-level comparator is used to perform non-overlapping pairwise comparisons of adjacent data streams within the storage structure. The next target data stream to be sent in the storage structure is determined based on the comparison results.
[0010] After any data stream stored in the storage structure is sent, the next target data stream in the period group where the data stream is located is found, and the found target data stream is set at the position of the data stream in the storage structure.
[0011] Preferably, the step of grouping data streams with the same transmission period into a periodic group includes:
[0012] The periodic flow table is configured in the external storage device by the host computer. The data flow is organized according to the sending period p and the start sending time o of the data flow using the period division method, so that the data flow with different sending periods p are respectively formed into period groups, and the table entries in each period group are arranged in order according to the start sending time o.
[0013] Preferably, the step of finding the target data stream to be sent in each period group based on the sending time of each data stream includes:
[0014] First, select the data stream at the middle position within the period group. Compare the transmission time of this data stream with the current time. Based on the comparison result, determine the next search interval. Repeat the previous step within the next search interval. By continuously narrowing the search interval and gradually searching, finally determine the target data stream f that is closest to the current time. target Alternatively, using the zero point of the macro cycle as a reference point, the first data stream of the cycle group is taken as the target data stream f closest to the zero point of the macro cycle. target ;
[0015] After finding the data stream closest to the current time point within each group, the next data stream is extracted sequentially, resulting in a total of n groups of data streams. Each group contains two data streams. The two data streams within each group are compared, and the data stream whose sending time point is closer to the current time point is selected as the target data stream f. target The target data streams to be sent in each periodic group form a set {f1, f2, ..., f...} n}, which stores the address of the data stream within the set in the data stream table.
[0016] Preferably, the method of using a storage structure to store a set of target data streams to be sent in each period group, and using a multi-level comparator to perform non-overlapping pairwise comparisons of adjacent data streams within the storage structure, and determining the next target data stream to be sent in the storage structure based on the comparison results, includes:
[0017] A multi-stage comparator is connected to the entries in the storage structure. Each entry in the storage structure corresponds one-to-one with the data input port of the lowest stage of the multi-stage comparator. Within each stage of the multi-stage comparator, adjacent data streams are compared pairwise. The result of each pairwise comparison becomes the input for the next stage comparison, until the final output set contains the next data stream f to be sent from the storage structure closest to the transmission time. target ;
[0018] Methods for comparing adjacent data streams pairwise within each comparator stage include periodic accumulation and periodic truncation.
[0019] (1) Periodic Accumulation Method: A counter is configured for each period group. The counter corresponding to each period group is cleared when the device starts working. After each period, the value of the counter is incremented by one. Using the value of the counter of the period group and the sending period and sending time information of the data stream itself, the absolute time point of the next sending of the data stream is directly calculated and compared. Let the counter contents corresponding to the i-th and j-th period groups be count respectively. i count j The corresponding data stream sending period and sending time are period i offset iwith period j offset j Comparing the data streams corresponding to these two period groups is equivalent to comparing the absolute time point of the next transmission of the two data streams: (count) i *period i +offset i ) and (count) j *period j +offset j The smaller of the two streams will be selected as the comparison result.
[0020] (2) Periodic Truncation Method: Introducing the current time t, the difference gap between the current time t and the next transmission time of the data stream is used for judgment. The current time t is truncated using the data stream period to obtain the relative time point of t within the period. The difference between this relative time point and offset within the same period is calculated to obtain gap, i.e., gap = offset - t % period. As the storage structure is continuously updated until the new entry is the first entry of the period group, gap′ = gap + period is calculated. Gap′ is used to replace the original gap as the comparison basis. Comparing the data streams corresponding to the two period groups i and j is the comparison gap. i With gap j The data stream corresponding to the smaller of the two is selected as the comparison result.
[0021] Preferably, after any data stream stored in the storage structure has been sent, the next target data stream within the period group containing that data stream is found, and the found target data stream is set at the position of that data stream in the storage structure, including:
[0022] When the unpublished item f in the storage structure target i After transmission is complete, the contents of the storage structure are updated using f. target i The next entry in its periodic group replaces f. target i Within the table of the storage structure, a multi-level comparator is used to re-perform non-overlapping pairwise comparisons of adjacent data streams within the storage structure. Based on the comparison results, the next new target data stream f to be sent in the storage structure is determined. target i+1 ;
[0023] Repeatedly execute the pending item f in the storage structure target i Send, update content, reselect items to be published target i+1The processing procedure involves reassembling data stream sets with the same sending period into period groups after the data stream table is reconfigured, and then finding the target data stream to be sent in each period group based on the sending time of each data stream.
[0024] As can be seen from the technical solutions provided by the embodiments of the present invention above, the present invention designs a time-ordered access control method for periodic flow tables based on periodic partitioning. This solves the problem of duplicate entries in periodic flow tables. This method is suitable for time-ordered access control of large-scale periodic flow tables, such as time-sensitive networks with data flow volumes in the millions.
[0025] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and will become apparent from the description or may be learned by practice of the invention. Attached Figure Description
[0026] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments 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.
[0027] Figure 1 This is an example diagram of a periodic flow table containing repeating entries in the prior art.
[0028] Figure 2 This is a schematic diagram illustrating the implementation principle of a time-ordered access control method based on periodic partitioning provided in an embodiment of the present invention.
[0029] Figure 3 This is a flowchart of a time-ordered access control method for periodic flow tables based on periodic partitioning, provided by an embodiment of the present invention.
[0030] Figure 4 This is a breakdown description of a time-ordered access control method based on periodic partitioning provided in an embodiment of the present invention.
[0031] Figure 5 This is a module pin connection diagram provided in an embodiment of the present invention.
[0032] Figure 6 This is a state machine for the initialize module provided in an embodiment of the present invention.
[0033] Figure 7 This is a state machine for the initialize module provided in an embodiment of the present invention.
[0034] Figure 8 This is a cache module state machine provided in an embodiment of the present invention.
[0035] Figure 9 This is a state machine for the reg_group module provided in an embodiment of the present invention. Detailed Implementation
[0036] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0037] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this specification means the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. It should be understood that when we say an element is “connected” or “coupled” to another element, it can be directly connected or coupled to the other element, or there may be intermediate elements. Furthermore, “connected” or “coupled” as used herein can include wireless connections or couplings. The term “and / or” as used herein includes any and all combinations of one or more of the associated listed items.
[0038] It will be understood by those skilled in the art that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. It should also be understood that terms such as those defined in general dictionaries should be understood to have the same meaning as in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless defined as herein.
[0039] To facilitate understanding of the embodiments of the present invention, the following will provide further explanation and description with reference to the accompanying drawings and several specific embodiments. These embodiments do not constitute a limitation on the embodiments of the present invention.
[0040] To completely solve the problem of duplicate entries in periodic flow tables, this invention provides a time-ordered access control method for periodic flow tables based on periodic partitioning, as illustrated in the following diagram. Figure 2 As shown, the processing flow of this method is as follows: Figure 3 As shown, the processing steps include the following:
[0041] Step S10: Group the data streams with the same transmission period.
[0042] In the periodic division method, the periodic flow table is configured in the external storage device by the host computer. Its organization is as follows: data flows with the same sending period are grouped into periodic groups, and the data flows in each periodic group are arranged in ascending order according to the sending time.
[0043] Figure 4 (a) illustrates a periodic flow table organization method based on periodic division, that is, the data flow is organized according to the sending period (p) and the start sending time (o) of the data flow, so that the data flow with different sending periods (p) are respectively formed into periodic groups, and the entries in each periodic group are arranged in ascending order according to the start sending time (o).
[0044] Step S20: Based on the sending time of each data stream, find the target data stream to be sent in each period group.
[0045] Considering the characteristics of data flow table periodicity, the target data flow f to be sent in each periodic group target The set {f1, f2, ..., f} that will inevitably be sent in each periodic group n In the context of}, n represents the number of groups. The target data stream f target The methods for determining this include the following two methods:
[0046] (1) Using the current time as a reference time: This strategy mainly uses the binary search method, performing a binary search within each period group. That is, first, select the data stream at the middle position within the period group, compare the sending time of the data stream at the middle position with the current time, and determine the next search interval based on the comparison result. Then, repeat the previous step within the next search interval. By continuously narrowing the search interval and searching step by step, the data stream to be sent that is closest to the current time is finally determined.
[0047] Considering that entries found during the search of other periodic groups may expire, we retrieve the next data stream after finding the data stream closest to the current time within each group. Therefore, we obtain a total of n groups of data streams, each containing two data streams. Finally, we compare the two data streams within each group and select the data stream whose sending time is closer to the current time as the target data stream f. target The target data streams to be sent in each periodic group form a set {f1, f2, ..., f...} n Furthermore, while determining this set, the addresses of the data streams within that set in the data stream table are saved to prepare for subsequent updates.
[0048] (2) Using the zero point of the macro cycle as a reference time: Considering that a wait of one macro cycle is tolerable during the equipment preparation phase, the zero point of the macro cycle can be used as a reference to determine the data streams to be sent within each cycle group. Since the data streams within each cycle group are arranged in ascending order of transmission time, the first data stream f in each cycle group... firsti This means it is closest to the zero point of the macro cycle. Therefore, when adopting this strategy, it is only necessary to output the first data stream f of each cycle group in the cycle division flow table item by item. firsti The address will be used to take the first data stream of the periodic group as the target data stream f. target The target data streams to be sent in each periodic group form a set {f1, f2, ..., f...} n}
[0049] Step S30: Use a cache structure to store the set {f1, f2, ..., f...} of the target data streams to be sent in each cycle group. n The process involves using a multi-stage comparator to perform non-overlapping pairwise comparisons of adjacent data streams within the cache. The comparison results are used as input for the next stage, and this process is repeated at each stage until the final comparison result becomes the target data stream f. target .
[0050] Since the number of periodic groups n in the flow table is finite and its range is determinable, a fixed-length cache (memory) structure with a length ≥ n can be used to store the set of target data streams to be sent in each periodic group. Figure 4 The n periodic groups in (a) are output after step one. Figure 4 (b) n-ary cache.
[0051] To ensure that the final published item f is obtained target The correctness of this requires ensuring the validity of the data stream set stored within the cache structure; that is, the data stream within the cache must always be the closest to the sending time within its corresponding period group. To achieve this, it is necessary to... target Upon expiration, promptly update the contents of the cache entry containing that data stream. Because data streams within each periodic group are sorted in ascending order of transmission time, the original pending entry f... target The data stream within the same period group that is closest to the time of transmission is its next data stream within that period group, which is the updated content of the cache table where the original data stream to be sent is located; in particular, if f target If it is the last data stream in this periodic group, then the first data stream in this periodic group will be used as the update content.
[0052] To find the target f from the data stream collection stored in the cache target f target Select an initial f from the target data stream set.target The choice and its afterf target The selection method is consistent, that is, it is obtained by hierarchical pairwise comparison of the target data stream set through a multi-level comparator. Because f target The data stream in the current cache is the one closest to the time of transmission. Therefore, without considering cache updates, the data streams in the cache will be sequentially used as f based on their transmission times. target Complete the sending process; if cache updates are considered, all data streams in the periodic stream table are actually sent sequentially according to the sending time.
[0053] We chose a multi-stage comparator to compare data streams. This multi-stage comparator is directly connected to a cache table, with each cache entry corresponding to a data input port at the lowest level of the comparator. Within each stage, the comparator compares adjacent data streams pairwise; the result of each pairwise comparison becomes the input for the next stage, until a unique data stream is finally output—the data stream f closest to the point of transmission in the set. target Considering that the data streams input to a multi-level comparator have different sending periods, and that the sending offset in the period-divided data stream table only represents the sending time within its period, the offset field of the data streams cannot be simply compared during comparison. For multi-level comparators, we have two comparison strategies:
[0054] (1) Periodic Accumulation Method: This method requires a counter for each period group. The counter for each period group is reset to zero when the device starts working, and then increments by one every period. This method uses the value of the period group counter, along with the transmission period and transmission time information of the data stream itself, to directly calculate and compare the absolute time of the next transmission of the data stream. Let the counter contents corresponding to the i-th and j-th period groups be count, respectively. i count j The corresponding data stream sending period and sending time are period i offset i with period j offset j Comparing the data streams corresponding to these two period groups is equivalent to comparing the absolute time point of the next transmission of the two data streams: (count) i *period i +offset i ) and (count) j *period j +offset j We will select the data stream corresponding to the smaller of the two as the comparison result.
[0055] (2) Periodic Truncation Method: This method requires the current time t and uses the difference between the current time t and the next transmission time of the data stream (denoted as gap) for judgment. In this method, since no counter is set, the absolute time of the next transmission cannot be directly obtained. Therefore, it is considered to truncate the current time t using the data stream period to obtain the relative time point of t within the period, and then calculate the difference with the offset, which is also a relative time point within the period, to obtain gap, i.e., gap = offset - t % period. In particular, when the cache is continuously updated until the new entry is the first entry of the period group, the gap calculated by the above method is a negative value. At this time, gap′ = gap + period should be calculated, and gap′ should be used to replace the original gap as the comparison basis. Comparing the data streams corresponding to the two period groups i and j is equivalent to comparing gap. i With gap j We will select the data stream corresponding to the smaller of the two as the comparison result.
[0056] To select the data stream table entry to be sent from multiple data streams, a multi-level comparator is required for comparison. Figure 4 (c) The function of the multi-level comparator is to compare each cache entry pairwise and select the entry f that is closest to the sending time among all input entries. target As the final output. Figure 4 The cache in (b) ultimately generates the final output after connecting multiple levels of comparators. Figure 4 f in (c) target0 This entry is the first pending entry after the TSN switch starts working.
[0057] Step S40: After any pending data stream stored in the cache is sent, retrieve the next data stream in its period group from the periodic segmentation stream table and overwrite its record in the original cache.
[0058] When the original item to be published f target i After sending, the cache content needs to be updated to ensure the accuracy of the items to be published. Because, except for f... target i All other cache entries were not sent, and the data streams within each periodic group were sorted in ascending order according to the start time (o). Therefore, only f is needed. target i The next entry in the periodic group replaces f. target i Location within the cache table. For example... Figure 4 (d) After step one, the multi-level comparator re-compares and generates a new item to be published, f. target i+1 .
[0059] The initial cache table for this stream table is now complete. Afterwards, when the data stream f is about to be sent in time-ordered fashion... target After sending is complete, step three is executed to update the cache table content. The time-ordered access control method for periodic flow tables based on period partitioning is actually a sequential execution of steps one and two followed by a repetition of step three. Steps one and two are only executed for re-initialization when the flow table needs to be reconfigured.
[0060] In specific projects, the top-level module (such as the initialize module, cache module, and reg_group module) is composed of three sub-modules. Figure 5 This module serves as the functional implementation module for the time-ordered access control method based on periodic partitioning for periodic flow tables. The following section, in conjunction with the appendix... Figure 5 , 6 Sections 7, 8, and 9 explain the functions and specific implementation details of each module.
[0061] initialize module:
[0062] Module function: Complete the search task in step one and output the n entries obtained from the search to the cache module.
[0063] The specific engineering work for implementing Method 1 is as follows:
[0064] 1. Signal definition: down indicates the completion signal of the previous module and is the start signal of this initialization module. base[i] indicates the address of the first data stream of the i-th period in the periodic partitioning flow table. This part is configured by the host computer. length[i] indicates the total length of the data stream of the i-th period in the periodic partitioning flow table, representing the number of entries in the group. t indicates the external time. n indicates the number of different periods. T[addr] indicates the data stream with address addr in the data stream table T. T[addr].offset is its sending time. addr indicates the address passed to T for looking up the corresponding data stream. bias[i] indicates the address of the data stream of the i-th period obtained from initialization. ini_data[i] indicates the content of the data stream of the i-th period obtained from initialization.
[0065] `finished` indicates whether the initialization operation has been completed and serves as the start signal for the next module. Necessary intermediate signals are explained as follows: `start` indicates the position of the first data stream in the current cycle; `last` indicates the position of the last data stream in the current cycle; `mid` indicates the intermediate position of the binary search calculated from `start` and `last`; `count` is a counter used to record the number of cycles currently being processed; `timeoffset` represents the sending time variable of the current data stream; `total` represents the number of remaining data streams in the current cycle; `find1` indicates whether the first matching data has been found in a cycle (1 indicates valid, 0 indicates invalid, initially `find1 = 0`); `tmpaddress` represents the address sent to the data stream table T for searching; several register groups are also used to store data.
[0066] 2. State 1: such as Figure 6 As shown in state 1, when down = 0, the module state remains unchanged, and the control signals also remain unchanged. When down = 1, the initialization module starts, enters state 1, and begins working. Since the core idea of this initialization method is binary search, i = count is always maintained in the module, so that the counter controls the initialization in each cycle to complete normally from 0 to n-1. Generally, the module calculates four intermediate variables, start, last, total, and mid, using the two inputs base[i] and length[i]. The mid variable of the middle position of this group is the position of the next data stream to be retrieved. mid is assigned to tmpaddress and passed to the data stream table T as information for retrieving the next data stream. At the same time, T[tmpaddress].offset is assigned to the timeoffset value for subsequent operations. Other variables that are not affected remain unchanged. The module will reach this state multiple times. The first time it enters this state indicates that the initialization operation starts from the first group, and subsequent times indicate the completion of the 1st, 2nd, 3rd...nth groups. It then enters the waiting stage of state 2.
[0067] 3. State 2: such as Figure 6As shown in Status 2, the function of this status is to judge the obtained data to see if it meets the requirements. Since the tmpaddress address signal cannot be obtained immediately during the transmission of the clock pulse, a waiting stage needs to be set up to hold all variables for several cycles to ensure the correct transmission of data through delay. The main function is implemented by setting an if branch structure, with the condition being the remaining number total within the current cycle group. There are 4 cases: the remaining total is greater than 2, equal to 2, equal to 1, and other cases. When total > 2, in order to obtain a certain piece of data, due to binary search, at least one more binary operation is required. Therefore, the module needs to compare the current timeoffset with time t. Since the transmission times of the data streams within the same cycle group in the data flow table are arranged in ascending order. If timeoffset > t, it means the transmission time is later than t, so the data stream to be sent must be above the mid position. At this time, start remains unchanged, the current mid is assigned to last, and then the next mid value is calculated. At the same time, the quantity total is halved. The next mid is assigned to tmpaddress and passed to T as the information for retrieving the next data stream. At the same time, T[tmpaddress].offset is assigned to the timeoffset variable for continuous operation. Similarly, if timeoffset < t, it means the transmission time is earlier than t, so the data stream to be sent must exist below the mid position. At this time, last remains unchanged, the current mid is assigned to start, and the rest of the operations remain the same, entering the waiting stage. When total = 2, there is no need for comparison. This data stream must be one of the target data streams. At this time, start is directly assigned to mid, and the rest of the operations and values remain unchanged, entering the waiting stage. When total = 1, this data stream is the required data stream, and mid is the corresponding address. At this time, both the data and the address have been obtained, find1 is set to 1, and the data and the address are respectively stored in the preset register group. The remaining irrelevant variables remain unchanged, and it enters Status 3. The situation where total is other values generally does not exist in actual cases.
[0068] 4. Status 3: As Figure 6As shown in state 3, when find1 = 0, the operation cannot continue, so the variables remain unchanged, and the process transitions to state 1 to re-search for the first entry. When find1 = 1, it means that the first entry in the current group has been determined. Only the next adjacent entry needs to be retrieved sequentially to determine the two data streams within the same group. The mid value at this point is the address of the first data stream. Incrementing it by 1 gives the address of the next data stream, which can then be retrieved. The contents and addresses of these two data streams are filled into preset intermediate registers, and the counter count is incremented by 1, signifying the completion of all operations for one cycle. Simultaneously, a check is performed to see if count equals n. If count = n, it means all cycle groups have completed their operations, and the process jumps to state 4 for final processing. If count ! = n, it means the process is not yet complete, and the process returns to state 1 to operate on the next group.
[0069] 5. State 4: such as Figure 6 As shown in state 4, this state is typically reached only after each of the n cycle groups has completed its initialization and two data streams that meet the requirements have been found. In this state, the module sets the finished signal to 1 and clears the remaining variables. The two data streams of the same cycle stored in the register are compared one by one. Since the next data stream to be sent will be the one with the shorter transmission time, the final n data streams and n addresses can be obtained by comparing their addresses. These contents are assigned to ini_data and bias, preparing for integration into the next cache module, and stored in the cache structure for future use.
[0070] The specific engineering work for implementing Method Two is as follows:
[0071] 1. Signal Definitions: T represents a periodic flow table, base[i] represents the address of the first data stream in the i-th period of T, and macrocycle represents the macrocycle of all data streams in T. Both of these signals are input from the reg_group module. reset indicates whether the parameters of the periodic flow table have been updated again (1 indicates that the parameter update is complete and a new round of initialization is required). ini_data represents the set of data streams that are searched and output. finished indicates whether the module's work is complete (1 indicates that one round of initialization is complete). down indicates whether the periodic flow table parameter configuration provided by the host computer is complete (0 indicates that the parameter configuration is not complete, 1 indicates that it is complete). This signal is input from the host computer.
[0072] 2. State 1: such as Figure 7As shown in state 1, when down = 1, the periodic flow table parameters are configured, the initialize module leaves the waiting state and enters state 1. Subsequently, the first data stream content of each period segment in T is stored in ini_data respectively. Then, an unconditional jump to state 2 occurs. (It should be noted that due to the different read latency of the external storage device where the periodic flow table is stored, there may be a delay of several clock cycles in this state during actual operation. However, for ease of explanation, the read of the periodic flow table is considered instantaneous.)
[0073] 3. State 2: such as Figure 7 As shown in state 2, when the zero point of the entire data stream macro cycle is reached, the finished signal is set to 1 to indicate that the cache module can start working using ini_data; otherwise, it remains at 0 and continues to wait. When finished = 1, it unconditionally jumps to state 3.
[0074] 4. State 3: such as Figure 7 As shown in state 3, reaching this state indicates that one initialization has been completed. This state stops working after setting finished to 0. It only jumps to state 1 to start a new round of initialization when reset = 1.
[0075] cache module:
[0076] Module function: Stores the n table entries obtained from the search, and implements table entry comparison and table entry update functions.
[0077] The specific project details are as follows:
[0078] 1. Signal Definitions: T represents a periodic flow table, base[i] represents the address of the first data stream in the i-th period of T, and bias[i] represents the bias of the next entry in the cache table corresponding to the current entry in the i-th period of T within this period. Both signals are input from the reg_group module. item is used to store the entry content (item.content) and appends a period flag (item.label) to it. t represents the current time of the TSN system, and gap(t, item[i]) represents the time since the entry was sent. f targetThis represents the data stream to be sent in chronological order, or the items to be published. `valid` indicates the validity of the items to be published (valid only when it is 1). `update` is used to output the bias update request (`update.REQ`) and update guide (`update.label`) to the `reg_group` module. `finished` indicates whether the `initialize` module has completed its work (1 indicates a new round of initialization is complete); this signal is input from the `initialize` module. `ini_data` represents the data stream group found and output by the `initialize` module; `ini_data[i]` is the entry in the `i`th cycle of `T` that meets the conditions; this signal is input from the `initialize` module.
[0079] 2. State 1: such as Figure 8 As shown in state 1, when finished = 1, the cache module exits the waiting state and enters state 1 to begin working. Afterwards, the content of ini_data is merged and the flag is stored in item. The entry within item closest to the time of sending is f. target Transition unconditionally to state 2.
[0080] 3. State 2: such as Figure 8 As shown in state 2, when the condition is true, it means the current time is later than the original sending time of the item to be published, the cache entry needs to be updated, the currently output item to be published is no longer reliable, and valid is set to 0; if it is false, valid remains at 1. When valid = 0, it means that the entry needs to be updated, and the process transitions to state 3. Once finished = 1, the process transitions to state 1.
[0081] 4. State 3: such as Figure 8 As shown in state 3, the cache table content item(label) corresponding to the original item to be published is replaced by the next item T[base[label]+bias[label]] in the periodic flow table corresponding to that item. Additionally, an update signal needs to be sent to reg_group to update the item bias bias[label] for the corresponding label period. After the work is completed, it unconditionally transitions to state 2. Once finished = 1, it needs to transition to state 1. It should be noted that due to the different read latency of the external storage devices where the periodic flow table is stored, there may be a delay of several clock cycles in this state during actual operation. However, for ease of explanation, the read of the periodic flow table is considered instantaneous.
[0082] reg_group module:
[0083] Module function: Receives and stores multiple parameters of the periodic data flow table related to periodic division; outputs the necessary parameters required for the operation of other modules.
[0084] The specific project details are as follows:
[0085] 1. Signal Definition: T represents a periodically partitioned flow table. Signal is an internal signal storing the relevant parameters of the periodically partitioned data flow table. Its components are as follows: Signal.length[i] represents the number of data flows in the i-th period of T; Signal.base[i] represents the data in the i-th period of T; Signal.num represents the total number of data flows in T; Signal.macrocycle represents the macrocycle of all data flows in T; Signal.bias[i] represents the bias of the next entry in the cache table corresponding to the current entry in the i-th period of T within this period. `update` represents the update request (`update.REQ`) and update guide (`update.label`) for Signal.bias, which is input from the cache module. `finished` indicates whether the initialize module has completed its work (1 indicates a new round of initialization is complete), which is input from the initialize module. "down" indicates whether the configuration of the periodic flow table parameters provided by the host computer is complete (0 indicates that the parameter configuration is not complete, and 1 indicates that it is complete). This signal is input by the host computer.
[0086] 2. State 1: such as Figure 9 As shown in state 1, when down = 0, the reg_group module leaves the waiting state and enters state 1 to configure the flow table parameters periodically. That is, all components of Signal except bias are updated with the parameters provided by the host computer, and Signal.bias[i] is initialized to 0. When down = 1, it means that the parameter configuration is complete, and the process transitions to state 2.
[0087] 3. State 2: such as Figure 9 As shown in state 2, this module maintains and waits for data. When finished = 1, it indicates that the initialize module has completed its work, i.e., initializing Signal.bias. When update.REQ = 1, it means that Signal.bias needs to be updated, and the process transitions to state 3. If down = 0, it indicates that the parameters in T have changed, and the process transitions to state 1 for parameter reconfiguration.
[0088] 4. State 3: such as Figure 9As shown in state 3, this state updates the Signal.bias content indicated by update, that is, it increments bias[update.label] by one by default; when there is a period out of bounds, bias[update.label] is set to 0. After the update is complete, it unconditionally transitions to state 2.
[0089] In summary, this invention presents a time-ordered access control method for periodic flow tables based on periodic partitioning. Its most significant feature is that the periodic flow table is partitioned according to a period. This method offers the following advantages:
[0090] (1): There are no duplicate entries in the periodic flow table, that is, each data flow uniquely corresponds to one entry in the periodic flow table;
[0091] (2): Periodic flow tables can be stored in external storage, and internally a cache structure is used to store a single entry corresponding to each period, avoiding excessive memory occupation. The flow table has strong scalability.
[0092] (3): This method solves the problem of duplicate entries in periodic flow tables. It is suitable for time-ordered access control of large-scale periodic flow tables, such as time-sensitive networks with data flow scales of millions.
[0093] Those skilled in the art will understand that the accompanying drawings are merely schematic diagrams of one embodiment, and the modules or processes shown in the drawings are not necessarily essential for implementing the present invention.
[0094] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that the present invention can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of the present invention.
[0095] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for apparatus or system embodiments, since they are basically similar to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. The apparatus and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0096] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A time-ordered access control method for periodic flow tables based on periodic partitioning, characterized in that, include: Data streams with the same sending period are grouped into period groups, and the target data stream to be sent in each period group is found based on the sending time of each data stream. The storage structure stores a set of target data streams to be sent in each cycle group. A multi-level comparator is used to perform non-overlapping pairwise comparisons of adjacent data streams within the storage structure. The next target data stream to be sent in the storage structure is determined based on the comparison results. After any data stream stored in the storage structure is sent, the next target data stream in the period group where the data stream is located is found, and the found target data stream is set at the position of the data stream in the storage structure. When the unpublished item f in the storage structure tatget i After transmission is complete, the contents of the storage structure are updated using f. target i The next entry in its periodic group replaces f. target i Within the table of the storage structure, a multi-level comparator is used to re-perform non-overlapping pairwise comparisons of adjacent data streams within the storage structure. Based on the comparison results, the next new target data stream f to be sent in the storage structure is determined. target i+1 Repeatedly execute the pending item f in the storage structure. target i Send, update content, reselect items to be published target i+1 The processing procedure; A multi-stage comparator is connected to the entries in the storage structure. Each entry in the storage structure corresponds one-to-one with the data input port of the lowest stage of the multi-stage comparator. Within each stage of the multi-stage comparator, adjacent data streams are compared pairwise. The result of each pairwise comparison becomes the input for the next stage comparison, until the final output set contains the next data stream f to be sent from the storage structure closest to the transmission time. target .
2. The method according to claim 1, characterized in that, The method of grouping data streams with the same transmission period into a periodic group includes: The periodic flow table is configured in the external storage device by the host computer. The data flow is organized according to the sending period p and the start sending time o of the data flow using the period division method, so that the data flow with different sending periods p are respectively formed into period groups, and the table entries in each period group are arranged in ascending order according to the start sending time o.
3. The method according to claim 1 or 2, characterized in that, The method of finding the target data stream to be sent in each period group based on the sending time of each data stream includes: First, select the data stream at the middle position within the period group. Compare the transmission time of this data stream with the current time. Based on the comparison result, determine the next search interval. Repeat the previous step within the next search interval. By continuously narrowing the search interval and gradually searching, finally determine the target data stream f that is closest to the current time. target Alternatively, using the zero point of the macro cycle as a reference point, the first data stream of the cycle group is taken as the target data stream f closest to the zero point of the macro cycle. target ; After finding the data stream closest to the current time point within each group, the next data stream is extracted sequentially, resulting in a total of n groups of data streams. Each group contains two data streams. The two data streams within each group are compared, and the data stream whose sending time point is closer to the current time point is selected as the target data stream f. target The target data streams to be sent in each periodic group form a set {f1, f2, ..., f...} n }, which stores the address of the data stream within the set in the data stream table.
4. The method according to claim 3, characterized in that, The method of using a storage structure to store a set of target data streams to be sent in each cycle group, and using a multi-level comparator to perform non-overlapping pairwise comparisons of adjacent data streams within the storage structure, and determining the next target data stream to be sent in the storage structure based on the comparison results, includes: Methods for comparing adjacent data streams pairwise within each comparator stage include periodic accumulation and periodic truncation. (1) Periodic Accumulation Method: A counter is configured for each period group. The counter corresponding to each period group is cleared when the device starts working. After each period, the value of the counter is incremented by one. Using the value of the counter of the period group and the sending period and sending time information of the data stream itself, the absolute time point of the next sending of the data stream is directly calculated and compared. Let the counter contents corresponding to the i-th and j-th period groups be count respectively. i count j The corresponding data stream sending period and sending time are period i iffset i with peri od j offset j Comparing the data streams corresponding to these two period groups is equivalent to comparing the absolute time point of the next transmission of the two data streams: (count) i *period i +offset i ) and (count) j *period j +offset j The smaller of the two streams will be selected as the comparison result. (2) Periodic Truncation Method: Introducing the current time t, the difference gap between the current time t and the next transmission time of the data stream is used for judgment. The current time t is truncated using the data stream period to obtain the relative time point of t within the period. The difference between this relative time point and the offset within the same period is calculated to obtain gap, i.e., gap = offset - t % period. As the storage structure is continuously updated until the new entry is the first entry of the period group, gap′ = gap + period is calculated. Gap′ is used to replace the original gap as the comparison basis. Comparing the data streams corresponding to the two period groups i and j is the comparison of gqp. i With gap j The data stream corresponding to the smaller of the two is selected as the comparison result.
5. The method according to claim 4, characterized in that, After any data stream stored in the storage structure has been sent, the next target data stream within the period group containing that data stream is found, and the found target data stream is set at the position of that data stream in the storage structure, including: When the data flow table is reconfigured, the data flow sets with the same sending period are reassembled into period groups, and the target data flow to be sent in each period group is found again according to the sending time of each data flow.
Citation Information
Patent Citations
Large-scale OpenFlow flow table hierarchical storage architecture and accelerated searching method
CN108337172A
Time-sensitive network gating list implementation method and gating list entry generation method
CN113645149A