Hash table-based time pulse sequence identification method and system

CN121644457BActive Publication Date: 2026-09-11THE GENERAL DESIGNING INST OF HUBEI SPACE TECH ACAD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511800686.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-02
Publication Date
2026-09-11
Estimated Expiration
2045-12-02

AI Technical Summary

Technical Problem

[0004]本申请提供一种基于哈希表的时间脉冲序列识别方法及系统,解决相关技术中已知多组时间脉冲序列编码情况及有异常数据情况下时间脉冲识别存在匹配难度大且耗时长的技术问题

Benefits of technology

本申请提供一种基于哈希表的时间脉冲序列识别方法,基于已知多组时间脉冲序列构建后序查找表、前序查找表和顺序哈希表,从而根据已知多组时间脉冲序列进行离线预处理过程,确定每个码型中各时间脉冲的顺序和所有可能的匹配起点;再基于顺序哈希表快速定位可能的匹配候选,基于前序查找表更新匹配长度以识别码型;最后根据码型和后序查找表实现精准预测。本方法基于顺序哈希表和各种查找表,使关键操作的时间复杂度均为O(1),极大提升了识别速度,从而完成对脉冲时间序列快速识别,效率高,可一定程度识别异常数据序列。本方法通用性强,可兼容单组时间脉冲序列编码,例如周期码、变间隔码、或有限长度码,也可兼容多组不同时间脉冲序列编码的识别。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121644457B_ABST
    Figure CN121644457B_ABST
Patent Text Reader

Abstract

The application relates to a hash table-based time pulse sequence identification method, which comprises the following steps: constructing a postorder lookup table, a preorder lookup table and a sequential hash table based on a plurality of known time pulse sequences; matching a current time pulse with the known time pulse sequences based on the sequential hash table and the preorder lookup table to identify the code type of the current time pulse; and predicting the time interval from the current time pulse to the next time pulse based on the code type and the postorder lookup table. The application is based on an offline preprocessing process of the plurality of known time pulse sequences, determines the sequence of each time pulse in each code type and all possible matching starting points, then positions the possible matching candidates based on the sequential hash table, updates the matching length based on the preorder lookup table to identify the code type, and finally realizes accurate prediction according to the code type and the postorder lookup table, completes fast identification of the pulse time sequence, is high in efficiency, and can identify abnormal data sequences to a certain extent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of time pulse sequence recognition technology, specifically to a time pulse sequence recognition method and system based on a hash table. Background Technology

[0002] A time pulse sequence refers to a series of pulse signals that appear in a specific pattern on a time axis. Its core information includes not only the existence of the pulses themselves, but more importantly, the sequence formed by the time intervals between the pulses.

[0003] In related technologies, after a set of time pulse sequence codes is known, the arrival time of the time pulse is compared with a preset value in the absence of abnormal data. If the comparison matches, it means that the set of time pulses has been identified. However, if multiple sets of time pulse sequence codes are known, identifying a set of time pulses requires matching all of the known sequences. Moreover, when there is a lot of abnormal data, the matching is difficult and time-consuming. Summary of the Invention

[0004] This application provides a time pulse sequence recognition method and system based on a hash table, which solves the technical problems of high matching difficulty and long time consumption in time pulse recognition when there are multiple known time pulse sequence encodings and abnormal data.

[0005] This application provides a method for identifying time pulse sequences based on hash tables, which includes the following steps: Step S1: Construct a post-order lookup table, a pre-order lookup table, and a sequential hash table based on multiple known time pulse sequences; Step S2: Based on the sequential hash table and the preorder lookup table, match the current time pulse with the known time pulse sequence to identify the code pattern of the current time pulse; Step S3: Based on the code pattern and the subsequent lookup table, predict the time interval from the current time pulse to the next time pulse.

[0006] In one embodiment, step S1, constructing a post-order lookup table, a pre-order lookup table, and a sequential hash table based on multiple known time pulse sequences, includes: Step S11: Based on multiple known time pulse sequences, construct a code pattern matrix according to the minimum resolution; Step S12: Sort the valid elements in the code pattern matrix in ascending order to obtain a sorted array s[N] and an index array sX[N][2] corresponding to the sorted array s[N], such that sX[i][1] is the horizontal coordinate of the code pattern matrix, i.e., the number of groups; sX[i][2] is the vertical coordinate of the code pattern matrix, i.e., the number of elements; s[i] is the value of the horizontal and vertical coordinates in the code pattern matrix; where N is the total number of valid elements in the code pattern matrix. Step S13: Construct a post-order lookup table hs[N] based on the index array sX to obtain the position of the next pulse interval in the sorted array s[N] that has the same code pattern as any element s[i] in the index array sX and is adjacent to it; Step S14: Construct a preorder lookup table qs[N] based on the index array sX to obtain the position of the previous pulse interval in the sorting array s[N] that has the same code pattern as any element s[i] in the index array sX and is adjacent to it; Step S15: Construct a sequential hash table based on the sorted array s[N] to obtain the number of matching starting points corresponding to a certain pulse interval in the sorted array s[N].

[0007] In one embodiment, step S13, constructing a post-order lookup table hs[N] based on the index array sX to obtain the position of the next pulse interval in the sorted array s[N] that has the same code pattern as any element s[i] and is adjacent to it, includes: For any 1≤i≤N, hs[i]=j, such that: sX[i][1]==sX[j][1]; (sX[i][2]+1)% sN [sX[i][1]]==sX[j][2]; Where sN is the effective length vector of the time pulse sequence; j is the position of the next pulse interval in the sorted array s[N].

[0008] In one implementation, step S14, constructing a preorder lookup table qs[N] based on the index array sX to obtain the position of the previous pulse interval in the sorted array s[N] that has the same code pattern as any element s[i] and is adjacent to it, includes: For any 1≤i≤N, qs[i]=j, such that: sX[j][1]==sX[i][1]; (sX[j][2]+1)% sN [sX[j][1]]==sX[i][2]; Where sN is the effective length vector of the time pulse sequence; j is the position of the previous pulse interval in the sorted array s[N].

[0009] In one implementation, step S15, constructing a sequential hash table based on the sorted array s[N] to obtain the number of matching starting points corresponding to a certain pulse interval in the sorted array s[N], includes: Step S151: Define the length of the sequential hash table h[hLength][2] as k'+2g, where k' is the difference between the maximum and minimum values ​​in the sorted array s[N], and g is the threshold range; Step S152: Construct a hash function, expressed as: Hash[Key] = Key - v_d + g, where v_d is the minimum value of the sorted array s[N], and Key is the time pulse interval; Step S153: Set the traversal pointer BL to the index of the sorted array s[N], and let Key traverse the sorted array s[N] starting from [s[BL]-g, s[BL]+g); Step S154: Calculate the hash address, represented as: HK=Hash[Key]; Step S155: Update the sequential hash table to obtain the number of matching starting points corresponding to the time pulse interval in the sorted array s[N].

[0010] In one implementation, step S2, matching the current time pulse with a known time pulse sequence based on the sequential hash table and the preorder lookup table to identify the code pattern of the current time pulse, includes: Step S21: Set the initialization environment: Set the recording array vAll for recording the pulse arrival time, the hash mapping address table corresponding to the recording array vAll, the hash mapping area containing multiple hash mapping tables, the maximum hit array arr for recording the current longest continuous matching length, and the split point split=0 as the effective matching starting point; Step S22: Record a new time pulse: Receive the current time pulse and calculate the time interval between the current time pulse and the previous time pulse; if it does not exceed the timer period, load the current time pulse into the recording array vAll at position new; Step S23, Reverse Scan: In the record array vAll, the loop variable j moves backward from the position new-1 to the position split to traverse the historical pulses, calculates the time variable Tmp between the position new of the current time pulse and the loop variable j, and determines whether Tmp is within the range of [v_u-g, v_u+g], where v_u is the last element in the sorted array s[N] and g is the threshold range; If Tmp is in the range [v_u-g, v_u+g], proceed to step S24; Continue until the loop variable j moves to the position of split, then execute step S25; Step S24, interval matching: calculating the hash address HK=Hash[Tmp] based on the time variable Tmp, querying the ordered hash table to obtain the position begin of the matching starting point in the sorted array s[N] and the corresponding number kMax; for each candidate k in [begin, begin+kMax-1], querying the preorder lookup table to obtain qs[begin+k], and updating the maximum hit array arr and the hash mapping table according to whether the matching length of qs[begin+k] is recorded in the hash mapping table corresponding to the loop variable j; Step S25, forward scanning: in the recording array vAll, the loop variable j moves forward from the position of split to the position of new to traverse historical pulses, calculating the time variable Tmp between the position new of the current time pulse and the loop variable j, and determining whether Tmp is within the range of [v_d-g, v_u+g], wherein v_d is the first element in the sorted array s[N], and g is a threshold range; if Tmp is within the range of [v_d-g, v_u+g], setting split=split+1, and executing step S24; executing step S26 until the loop variable j moves to the position of new; Step S26, checking the maximum hit array arr, if there is a unique maximum value and the maximum value is greater than the set value D of the minimum allowable matching number, taking the maximum value as the code pattern of the current time pulse, and executing step S3.

[0011] In one embodiment, step S23 further comprises: if Tmp>v_u+g, taking j+1 as a new split, releasing the hash mapping table between the original split and the new split, and executing step S25; if Tmp<v_u-g, continuing the loop.

[0012] In one embodiment, step S25 further comprises: if Tmp>v_u+g, releasing and initializing the current hash mapping table, setting split=split+1, and continuing the loop; if Tmp<v_d-g, executing step S26.

[0013] In one embodiment, said step S3 of predicting a time interval from the current time pulse to a next time pulse based on the identified code pattern and a post-order lookup table comprises: If it is the first prediction, based on the index x corresponding to the maximum value in the maximum value array arr, the corresponding hs[x] is obtained by looking up the subsequent lookup table, and the value s[hs[x]] in the sorted array s[N] corresponding to hs[x] is used as the time interval from the current time pulse to the next time pulse; If it is not the first prediction, based on the hs[x] corresponding to the previous subsequent lookup table, the corresponding hs[hs[x]] is obtained in the subsequent lookup table, and the value s[hs[hs[x]]] in the sorted array s[N] corresponding to hs[hs[x]] is used as the time interval from the current time pulse to the next time pulse.

[0014] This application also provides a time pulse sequence recognition system based on a hash table, which applies the time pulse sequence recognition method based on a hash table as described in any of the above claims, and includes: The preprocessing module is configured to: construct a post-order lookup table, a pre-order lookup table, and a sequential hash table based on multiple known time pulse sequences; The matching module is configured to: match the current time pulse with a known time pulse sequence based on the sequential hash table and the preorder lookup table, so as to identify the code pattern of the current time pulse; The prediction module is configured to predict the time interval from the current time pulse to the next time pulse based on the identified code pattern and the subsequent lookup table.

[0015] The beneficial effects of the technical solutions provided in this application include: This application provides a time pulse sequence recognition method based on hash tables. It constructs a post-order lookup table, a pre-order lookup table, and a sequential hash table based on multiple known time pulse sequences. This allows for offline preprocessing of the known time pulse sequences to determine the order of each time pulse in each code pattern and all possible matching starting points. Then, it quickly locates possible matching candidates based on the sequential hash table and updates the matching length based on the pre-order lookup table to identify the code pattern. Finally, it achieves accurate prediction based on the code pattern and the post-order lookup table. This method, based on sequential hash tables and various lookup tables, achieves a time complexity of O(1) for key operations, greatly improving the recognition speed and enabling rapid recognition of pulse time sequences. It is highly efficient and can identify abnormal data sequences to a certain extent. This method is also highly versatile, compatible with single-set time pulse sequence encodings, such as periodic codes, variable-interval codes, or finite-length codes, and also compatible with the recognition of multiple sets of different time pulse sequence encodings. Attached Figure Description

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

[0017] Figure 1 This is a flowchart illustrating the steps of a time pulse sequence recognition method based on a hash table in one embodiment of the present invention.

[0018] Figure 2 This is a schematic diagram of the operation of an information processing device in one embodiment of the present invention.

[0019] Figure 3 This is a schematic diagram of the preprocessing process of an information processing device in one embodiment of the present invention.

[0020] Figure 4 This is a mapping diagram of the matching process region in one embodiment of the present invention.

[0021] Figure 5 This is a flowchart illustrating the hash table update process within the mapping area in one embodiment of the present invention.

[0022] Figure 6 This is a flowchart of the prediction time pulse in one embodiment of the present invention. Detailed Implementation

[0023] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.

[0024] This application provides a method and system for identifying time pulse sequences based on hash tables, which can solve the technical problems of high matching difficulty and long time consumption in time pulse identification when there are multiple known time pulse sequence encodings and abnormal data.

[0025] like Figure 1 As shown, Figure 1 This is a flowchart illustrating the steps of a time pulse sequence recognition method based on a hash table in one embodiment of the present invention.

[0026] This embodiment provides a time pulse sequence identification method based on a hash table, which includes the following steps: Step S1: Construct a post-order lookup table, a pre-order lookup table, and a sequential hash table based on multiple known time pulse sequences; Step S2: Based on the sequential hash table and the preorder lookup table, match the current time pulse with the known time pulse sequence to identify the code pattern of the current time pulse; Step S3: Based on the code pattern and the subsequent lookup table, predict the time interval from the current time pulse to the next time pulse.

[0027] This embodiment provides a time pulse sequence recognition method based on hash tables. It constructs a post-order lookup table, a pre-order lookup table, and a sequential hash table based on multiple known time pulse sequences. This allows for offline preprocessing of the known time pulse sequences to determine the order of each time pulse in each code pattern and all possible matching starting points. Then, it quickly locates possible matching candidates based on the sequential hash table and updates the matching length based on the pre-order lookup table to identify the code pattern. Finally, it achieves accurate prediction based on the code pattern and the post-order lookup table. This method, based on sequential hash tables and various lookup tables, achieves a time complexity of O(1) for key operations, greatly improving the recognition speed and enabling rapid recognition of pulse time sequences. It is highly efficient and can identify abnormal data sequences to a certain extent. This method is also highly versatile, compatible with single-set time pulse sequence encodings, such as periodic codes, variable-interval codes, or finite-length codes, as well as the recognition of multiple sets of different time pulse sequence encodings.

[0028] The following provides a detailed explanation of each step.

[0029] like Figure 2 and Figure 3 As shown, multiple time pulse sequences are provided by an external device and transmitted to an information processing device. Assume there are M time pulse sequences forming a code pattern, with each time interval ranging from Vd to Vu. The data length of the i-th code pattern is Ni, and the i-th code pattern can be represented as {ci1, ci2…ciNi}; the maximum code pattern length is N. The information processing device completes information preprocessing based on step S1 and stores the preprocessed information in flash memory. After powering on, the information processing device first loads the information in flash memory. Based on step S2, it performs a matching process according to the time pulse information input. After the matching process ends, it proceeds to step S3, the prediction process, to predict the arrival time of the next time pulse based on the arrival time of the time pulse information.

[0030] The specific process is as follows: In one embodiment, step S1, constructing a post-order lookup table, a pre-order lookup table, and a sequential hash table based on multiple known time pulse sequences, includes: Step S11: Based on multiple known time pulse sequences, construct a code pattern matrix according to the minimum resolution.

[0031] The external device constructs an M*N' pattern matrix according to the M-group pattern information and the maximum number of single-group pattern data at the minimum resolution P, and transmits it to the information processing device. The pattern matrix is expressed as follows: ; Wherein, the effective length of each row is Ni, and the effective length vector sN is .

[0032] N' is the maximum sequence length, and shorter sequences can be filled with specific invalid values (such as 0 or -1) in the matrix. All time intervals are quantized by using the minimum resolution P (e.g., 1µs, 1ms), so that all time values are converted into integers with P as the basic unit, which makes the operation fast and accurate, and facilitates the subsequent construction of ordered hash tables. Data is stored continuously or regularly in memory, which is conducive to rapid access and batch operations. Subsequent steps such as sorting and index recording can use unified loops and pointer operations to process the entire matrix, without writing different logical branches for each sequence, which greatly simplifies the program design and calculation process.

[0033] Step S12: Sort the valid elements in the pattern matrix in ascending order to obtain a sorted array s[N] and an index array sX[N][2] corresponding to the sorted array s[N], such that sX[i][1] is the abscissa of the pattern matrix, that is, the group number; sX[i][2] is the ordinate of the pattern matrix, that is, the number; s[i] is the corresponding value of the abscissa and ordinate in the pattern matrix; wherein, N is the total number of valid elements in the pattern matrix.

[0034] Further, ascending sorting is defined as: si≤sj, where i<j. Wherein, si and sj respectively represent the i-th element s[i] and the j-th element s[j] of the array s, with the condition that the subscript i is smaller than the subscript j.

[0035] Specifically, the information processing device receives the matrix information transmitted from the external device, extracts all valid pulse intervals from the pattern matrix, sorts them in ascending order, and the obtained sorted array s[N] provides rapid search capability. During sorting, the array subscript sX[N][2] is recorded, that is, a two-dimensional array is formed with a size of N (rows) * 2 (columns), and a "data-position" mapping is established to obtain the index array sX, which is used to record the position of each time pulse in the original matrix after sorting, that is [group number, position in sequence], indicating which pattern group it belongs to and which pulse in the group it is, providing structural association capability. By constructing the pattern matrix, the sorted array, and the index array, it is possible to quickly associate all sequences containing a single time interval measurement value and their specific positions from a single time interval measurement value, realizing rapid cross-sequence association.

[0036] Step S13: Construct a post-order lookup table hs[N] based on the index array sX to obtain the position of the next pulse interval in the sorted array s[N] that has the same code pattern as any element s[i] in the index array sX and is adjacent to it.

[0037] In one embodiment, step S13 includes: For any 1≤i≤N, hs[i]=j, such that: sX[i][1]==sX[j][1]; (sX[i][2]+1)% sN [sX[i][1]]==sX[j][2]; Where sN is the effective length vector of the time pulse sequence; j is the position of the next pulse interval in the sorted array s[N].

[0038] That is, the x-coordinates of the index array sX corresponding to the two values ​​i and j are the same, and the y-coordinates are shifted to the right within the number of valid y-coordinates of the current x-coordinate.

[0039] Step S14: Construct a preorder lookup table qs[N] based on the index array sX to obtain the position of the previous pulse interval in the sorted array s[N] that is adjacent to any element s[i] in the index array sX and has the same code pattern.

[0040] In one embodiment, step S14 includes: For any 1≤i≤N, qs[i]=j, such that: sX[j][1]==sX[i][1]; (sX[j][2]+1)% sN [sX[j][1]]==sX[i][2]; Where sN is the effective length vector of the time pulse sequence; j is the position of the previous pulse interval in the sorted array s[N].

[0041] That is, the x-coordinates of the index array sX corresponding to the two values ​​i and j are the same, and the y-coordinates are shifted to the left sequentially within the number of valid y-coordinates of the current x-coordinate.

[0042] Step S15: Construct a sequential hash table based on the sorted array s[N] to obtain the number of matching starting points corresponding to a certain pulse interval in the sorted array s[N].

[0043] In one embodiment, step S15 includes: Step S151: Define the length of the sequential hash table h[hLength][2] as k'+2g, where k' is the difference between the maximum and minimum values ​​in the sorted array s[N], and g is the threshold range; Furthermore, g represents the number of points contained in the threshold range at the minimum resolution, and the first row is initialized to a negative number.

[0044] Step S152: Construct a hash function, expressed as: Hash[Key] = Key - v_d + g, where v_d is the minimum value of the sorted array s[N] and Key is the time pulse interval.

[0045] Step S153: Set the traversal pointer BL to the index of the sorted array s[N], and let Key traverse the sorted array s[N] starting from [s[BL]-g, s[BL]+g).

[0046] Step S154: Calculate the hash address, represented as: HK=Hash[Key]; Step S155: Update the sequential hash table to obtain the number of matching starting points corresponding to the time pulse interval in the sorted array s[N].

[0047] Specifically, the traversal pointer BL is set to the index of the sorted array s[N]. Traversing from the leftmost to the rightmost position of the sorted array s[N], for each value, the Key is traversed from [s[BL]-g, s[BL]+g) through the sorted array s[N]. It is checked whether h[HK][1] is negative. If it is, h[KY][1] = BL and h[KY][2] = 1; otherwise, h[KY][2] = h[KY][2] + 1. That is, for each value s[i], all Keys within its surrounding threshold range are mapped to the hash table. h[Hash(Key)][1] records the starting position of the first match, and h[Hash(Key)][2] records the number of matches. Furthermore, the constructed sorted array, preorder lookup table qs, postorder lookup table hs, and sequential hash table h are stored in non-volatile memory (such as Flash).

[0048] After the information processing device is powered on, it loads the data stored in flash memory and enters the matching mode.

[0049] In one embodiment, step S2, matching the current time pulse with a known time pulse sequence based on a sequential hash table and a preorder lookup table to identify the code pattern of the current time pulse, includes: Step S21: Set the initialization environment: Set the recording array vAll for recording the arrival time of the pulse, the hash mapping address table corresponding to the recording array vAll, the hash mapping area containing multiple hash mapping tables, the maximum hit array arr for recording the current longest consecutive match length, and the split point split=0 as the starting point of the valid match.

[0050] Specifically, such as Figure 4As shown, the size of the record array can be set in a circular array manner. A hash mapping address table is set, and the length of the table is consistent with that of the record array. A hash mapping area is set, wherein the size of each hash table value in the hash mapping area does not exceed N, and all data is initialized to negative numbers. The time record array is in one-to-one correspondence with the hash mapping address table, and the hash mapping address table is in one-to-one correspondence with the mapping tables of the hash mapping area in principle, unless no data is matched at a certain moment, and in this case the table does not correspond to any mapping table content in the hash mapping area. For example, address 2 corresponds to hash table 1 in the hash mapping area, address i corresponds to hash table 2 in the hash mapping area, and address 3 does not correspond to any hash table. A hit maximum value array arr is set, with a length of N. The effective area of the matching process is the range from the starting point of the effective range to the arrival moment of the time pulse. split contains the information indicating that the minimum value allowed for matching is not reached within the area range; all data from split to the current position are less than the minimum value, and all data from the starting point to split are greater than the minimum value.

[0051] Step S22, recording a new time pulse: receiving the current time pulse, and calculating the time interval between the current time pulse and the previous time pulse; if the time interval does not exceed the timer period, loading the current time pulse into the record array vAll at the position new.

[0052] Specifically, the information processing device receives a new time pulse input from the outside as the current time pulse, and records the numerical information of a high-precision timer after obtaining effective information. The time interval between the current time pulse and the previous time pulse is calculated; if the time interval from the previous time pulse exceeds one timer period, step 21 is re-executed; if the time interval does not exceed the timer period, the current time pulse is loaded into the record array vAll at the position new, and a free hash mapping table is allocated to the hash mapping address table corresponding to the array position. All data in the hit maximum value array arr are cleared. Let j=split (to be updated subsequently).

[0053] Step S23, reverse scanning: in the record array vAll, a cyclic variable j moves reversely from the position of new-1 to the position of split to traverse historical pulses, a time variable Tmp between the position new of the current time pulse and the cyclic variable j is calculated, and whether Tmp is within the range of [v_u-g, v_u+g] is judged, wherein v_u is the last element in the sorted array s[N], and g is a threshold range; If Tmp is within the range of [v_u-g, v_u+g], step S24 is executed; If Tmp>v_u+g, j+1 is taken as a new split, the hash mapping tables between the original split and the new split are released according to the hash mapping address table, and step S25 is executed; If Tmp<v_u-g, the circulation continues; Continue until the loop variable j moves to the position of split, then execute step S25.

[0054] Specifically, when calculating the time variable Tmp between the current time pulse position new and the loop variable j, the calculation method is ((vAll[new]- vAll[j]+ Freq)%Freq) / (sP*Freq) and rounded down. Freq is the timer frequency, which is also the maximum value recorded by the timer, and sP is a value in seconds.

[0055] Step S24, Interval Matching: Calculate the hash address HK=Hash[Tmp] based on the time variable Tmp, query the sequential hash table to obtain the position begin of the matching starting point in the sorted array s[N] and the corresponding number kMax; for each candidate k in [begin, begin+kMax-1], query the preorder lookup table to obtain qs[begin+k], and update the maximum hit array arr and the hash map table according to whether the matching length of qs[begin+k] is recorded in the hash map table corresponding to the loop variable j.

[0056] Furthermore, if the hash mapping address table corresponding to j is empty, then this step ends immediately.

[0057] Specifically, if Hash[Tmp] is within the range [v_d-g, v_u+g), and the first row of the hash table corresponding to Hash[Tmp] is not negative, then let begin = h[Hash[Tmp]][1], kMax = h[Hash[Tmp]][2], and let k = increment from 0 to kMax-1. For each k, calculate the begin+k value, obtain qs[begin+k] through the preorder lookup table, check whether the hash mapping table corresponding to j stores the value of qs[begin+k]. If it does, let the new value _new = the stored value + 1; otherwise, let _new = 1. Check whether _new is greater than arr[begin+k]. If it is, let arr[begin+k] = _new, and re-insert the _new value in begin+k.

[0058] like Figure 5As shown, in other words, after calculating the time variable Tmp based on time j and time new, the value of hash function Hash[Tmp] starts to be calculated, and the information is queried according to the ordered hash table. Assuming that two values before and after begin and kMax are queried, the corresponding array values [arr1, arrkMax] of the arr array are obtained according to the value [begin, begin+kMax-1], and [trans1, transkMax] are obtained after conversion through the pre-order lookup table. According to the converted values, the corresponding address j hash table is searched to obtain [value1, valuekMax], the value of arri is compared with the value of valuei. If valuei is larger, the value of the arr array is overwritten, and the stored value at the position begin+i-1 under the hash table corresponding to new is also overwritten.

[0059] Step S25, forward scanning: in the recording array vAll, the cyclic variable j moves forward from the split position to the new position to traverse historical pulses, calculate the time variable Tmp between the position new of the current time pulse and the cyclic variable j, and determine whether Tmp is within the range [v_d-g, v_u+g], wherein v_d is the first element in the sorted array s[N], and g is the threshold range; if Tmp is within the range [v_d-g, v_u+g], set split=split+1, and perform step S24; if Tmp>v_u+g, release and initialize the current hash mapping table, set split=split+1, and continue the loop; if Tmp<v_d-g, perform step S26; until the cyclic variable j moves to the new position, perform step S26; Step S26, check the hit maximum value array arr, if there is a unique maximum value and the maximum value is greater than the minimum allowable matching number set value D, take the maximum value as the code pattern of the current time pulse, and perform step S3.

[0060] the maximum value in the hit maximum value array arr is the number of successfully matched points, if all elements in arr are negative, release the hash mapping table at the current position.

[0061] The above scheme uses the split point as the matching center point, that is, by using a dynamic and intelligent boundary pointer to continuously eliminate invalid historical data, the matching range is limited to a finite sliding window, avoiding invalid searches and calculations within the minimum matching value range. At the same time, the complexity is O(1), which greatly saves the matching process time and makes the calculation more efficient. Moreover, the matching process is within a dynamic threshold range. That is, if a data is successfully matched, its historical matching values ​​are all kept within the threshold u of the ideal time deviation, avoiding the system offset error caused by the pulse source. In addition, both the hash table and the hash mapping table have a memory usage limit. The hash mapping table can be reused after being released, saving memory and enabling the processing of infinitely long data streams.

[0062] Here, `j` serves as a loop variable / pointer used in local steps. It is assigned different initial values ​​in different steps and moves in different directions to complete different scanning tasks. After being assigned a value in step 22, `j` is reinitialized in steps 23 and 25. These steps execute sequentially, rather than using the same value of `j` repeatedly. This design avoids introducing too many temporary variables.

[0063] In one embodiment, step S3, predicting the time interval from the current time pulse to the next time pulse based on the identified code pattern and the subsequent lookup table, includes: If it is the first prediction, based on the index x corresponding to the maximum value in the maximum value array arr, look up the corresponding hs[x] in the post-order lookup table, and use the value s[hs[x]] in the sorted array s[N] corresponding to hs[x] as the time interval from the current time pulse to the next time pulse; If it is not the first prediction, based on the hs[x] corresponding to the previous post-order lookup table, the corresponding hs[hs[x]] is obtained in the post-order lookup table, and the value s[hs[hs[x]]] in the sorted array s[N] corresponding to hs[hs[x]] is used as the time interval from the current time pulse to the next time pulse.

[0064] Specifically, such as Figure 6 As shown, it is known that the index of the post-order lookup table queried when the previous pulse arrives is x. The data hs[x] stored at index x is obtained from the post-order lookup table, and this is used as the current index to find the stored data hs[hs[x]]. Using this value as the index, the corresponding data s[hs[hs[x]]] of the sorted array s[N] is searched, which is the interval time with the center position of the next pulse.

[0065] The above scheme uses a post-order lookup table to replace the original internal order relationship of the matrix. The matching and prediction process can be achieved simply by looking up the table value to the corresponding sorting table. No complex calculations are performed; only a few array lookup operations are performed, and the time complexity is O(1).

[0066] This application also provides a time pulse sequence recognition system based on a hash table, which applies the above-mentioned time pulse sequence recognition method based on a hash table and includes: The preprocessing module is configured to: construct a post-order lookup table, a pre-order lookup table, and a sequential hash table based on multiple known time pulse sequences; The matching module is configured to match the current time pulse with a known time pulse sequence based on a sequential hash table and a preorder lookup table in order to identify the code pattern of the current time pulse. The prediction module is configured to predict the time interval between the current time pulse and the next time pulse based on the identified code pattern and the subsequent lookup table.

[0067] The functions of each module correspond to the steps in the aforementioned identification method, and will not be repeated here.

[0068] The following is a specific example for illustration.

[0069] Assume three code patterns: 1: {45ms}; 2: {45ms, 50ms}; 3: {45ms, 50ms, 55ms}, with a threshold of 0.001ms, a sampling frequency of 10MHz, abnormal data around 1kHz, and a minimum allowed number of matches of 10 to construct the matching environment.

[0070] The first set of code patterns is normal input data. When the 459th pulse is input, the maximum value of arr is 10 and it is unique. Record the index at this time as 0. The next pulse will arrive 45ms from the current pulse time.

[0071] The second set of code patterns is normal input data. When the 484th pulse is input, the maximum value of arr is 10 and it is unique. Record the index at this time as 3. The next pulse will arrive 45ms from the current pulse time.

[0072] The third set of code patterns is normal input data. When the 504th pulse is input, the maximum value of arr is 10 and it is unique. Record the index at this time as 2. The next pulse will arrive 50ms from the current pulse time.

[0073] It should be noted that the sequence numbers of the embodiments in this application are merely for descriptive purposes and do not represent the superiority or inferiority of the embodiments. The terms "comprising" and "having," and any variations thereof, in the specification, claims, and accompanying drawings of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices. The terms "first," "second," and "third," etc., are used to distinguish different objects, etc., and do not represent a sequential order, nor do they limit "first," "second," and "third" to different types.

[0074] In the description of the embodiments of this application, terms such as "exemplary," "for example," or "for instance" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplary," "for example," or "for instance" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary," "for example," or "for instance" is intended to present the relevant concepts in a concrete manner.

[0075] In the description of the embodiments of this application, unless otherwise stated, " / " means "or". For example, A / B can mean A or B. The "and / or" in the text is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of this application, "multiple" means two or more.

[0076] In some processes described in the embodiments of this application, multiple operations or steps are included in a specific order. However, it should be understood that these operations or steps may not be executed in the order they appear in the embodiments of this application, or they may be executed in parallel. The sequence number of the operation is only used to distinguish the different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed sequentially or in parallel, and these operations or steps may be combined.

[0077] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A hash table-based time pulse sequence recognition method, characterized by, It includes the following steps: Step S1: Construct a post-order lookup table, a pre-order lookup table, and a sequential hash table based on multiple known time pulse sequences; Step S2: Based on the sequential hash table and the preorder lookup table, match the current time pulse with the known time pulse sequence to identify the code pattern of the current time pulse; Step S3: Based on the code pattern and the subsequent lookup table, predict the time interval from the current time pulse to the next time pulse; Step S1, which involves constructing a post-order lookup table, a pre-order lookup table, and a sequential hash table based on multiple known time pulse sequences, includes: Step S11: Based on multiple known time pulse sequences, construct a code pattern matrix according to the minimum resolution; Step S12: Sort the valid elements in the code pattern matrix in ascending order to obtain a sorted array s[N] and an index array sX[N][2] corresponding to the sorted array s[N], such that sX[i][1] is the horizontal coordinate of the code pattern matrix, i.e., the number of groups; sX[i][2] is the vertical coordinate of the code pattern matrix, i.e., the number of elements; s[i] is the value of the horizontal and vertical coordinates in the code pattern matrix; where N is the total number of valid elements in the code pattern matrix. Step S13: Construct a post-order lookup table hs[N] based on the index array sX to obtain the position of the next pulse interval in the sorted array s[N] that has the same code pattern as any element s[i] in the index array sX and is adjacent to it; Step S14: Construct a preorder lookup table qs[N] based on the index array sX to obtain the position of the previous pulse interval in the sorting array s[N] that has the same code pattern as any element s[i] in the index array sX and is adjacent to it; Step S15: Construct a sequential hash table based on the sorted array s[N] to obtain the number of matching starting points corresponding to a certain pulse interval in the sorted array s[N]; Step S15, constructing a sequential hash table based on the sorted array s[N] to obtain the number of matching starting points corresponding to a certain pulse interval in the sorted array s[N], includes: Step S151: Define the length of the sequential hash table h[hLength][2] as k'+2g, where k' is the difference between the maximum and minimum values ​​in the sorted array s[N], and g is the threshold range; Step S152: Construct a hash function, expressed as: Hash[Key] = Key - v_d + g, where v_d is the minimum value of the sorted array s[N], and Key is the time pulse interval; Step S153: Set the traversal pointer BL to the index of the sorted array s[N], and let Key traverse the sorted array s[N] starting from [s[BL]-g, s[BL]+g); Step S154: Calculate the hash address, represented as: HK=Hash[Key]; Step S155: Update the sequential hash table to obtain the number of matching starting points corresponding to the time pulse interval in the sorted array s[N]; Step S2, which involves matching the current time pulse with a known time pulse sequence based on the sequential hash table and the preorder lookup table to identify the code pattern of the current time pulse, includes: Step S21: Set the initialization environment: Set the recording array vAll for recording the pulse arrival time, the hash mapping address table corresponding to the recording array vAll, the hash mapping area containing multiple hash mapping tables, the maximum hit array arr for recording the current longest continuous matching length, and the split point split=0 as the effective matching starting point; Step S22: Record a new time pulse: Receive the current time pulse and calculate the time interval between the current time pulse and the previous time pulse; if it does not exceed the timer period, load the current time pulse into the recording array vAll at position new; Step S23, Reverse Scan: In the record array vAll, the loop variable j moves backward from the position new-1 to the position split to traverse the historical pulses, calculates the time variable Tmp between the position new of the current time pulse and the loop variable j, and determines whether Tmp is within the range of [v_u-g, v_u+g], where v_u is the last element in the sorted array s[N] and g is the threshold range; If Tmp is in the range [v_u-g, v_u+g], proceed to step S24; Continue until the loop variable j moves to the position of split, then execute step S25; Step S24, Interval Matching: Calculate the hash address HK=Hash[Tmp] based on the time variable Tmp, query the sequential hash table to obtain the position begin of the matching starting point in the sorted array s[N] and the corresponding number kMax; for each candidate k in [begin, begin+kMax-1], query the preorder lookup table to obtain qs[begin+k], and update the maximum hit array arr and the hash map table according to whether the matching length of qs[begin+k] is recorded in the hash map table corresponding to the loop variable j; Step S25, Forward Scan: In the record array vAll, the loop variable j moves forward from the position of split to the position of new to traverse the historical pulses, calculates the time variable Tmp between the position of the current time pulse new and the loop variable j, and determines whether Tmp is within the range of [v_d-g, v_u+g], where v_d is the first element in the sorted array s[N] and g is the threshold range; If Tmp is in the range [v_d-g, v_u+g], set split=split+1 and execute step S24; Continue until the loop variable j moves to the position of new, then execute step S26; Step S26: Check the maximum hit array arr. If there is a unique maximum value that is greater than the minimum allowed number of matches set value D, use the maximum value as the code pattern of the current time pulse and execute step S3.

2. The hash table-based time pulse sequence identification method of claim 1, wherein, Step S13, constructing a post-order lookup table hs[N] based on the index array sX to obtain the position of the next pulse interval in the sorted array s[N] that has the same code pattern as any element s[i] in the index array sX, includes: For any 1≤i≤N, hs[i]=j, such that: sX[i][1]==sX[j][1]; (sX[i][2]+1)% sN [sX[i][1]]==sX[j][2]; wherein, sN is the effective length vector of the time pulse sequence; and j is the position of the next pulse interval in the sorted array s[N]. 3.The hash table-based time pulse sequence identification method of claim 1, wherein, Said step S14, constructing a pre-order lookup table qs[N] based on said index array sX, so as to obtain the position of the previous pulse interval, which is of the same pattern as any element s[i] in said index array sX and adjacent thereto, in said sorted array s[N] comprises: For any 1≤i≤N, qs[i]=j, such that: sX[j][1]==sX[i][1]; (sX[j][2]+1)% sN [sX[j][1]]==sX[i][2]; wherein, sN is the effective length vector of the time pulse sequence; and j is the position of the previous pulse interval in the sorted array s[N].

4. The hash table-based time pulse sequence identification method of claim 1, wherein, Said step S23 further comprises: if Tmp>v_u+g, take j+1 as a new split, release the hash mapping table between the original split and the new split, and execute step S25; if Tmp<v_u-g, continue the loop.

5. The hash table-based time pulse sequence identification method of claim 1, wherein, Said step S25 further comprises: if Tmp>v_u+g, release and initialize the current hash mapping table, set split=split+1, and continue the loop; if Tmp<v_d-g, execute step S26.

6. The time pulse sequence recognition method based on a hash table as described in claim 1, characterized in that, Said step S3, predicting the time interval from the current time pulse to the next time pulse based on the identified said pattern and the post-order lookup table comprises: if it is the first prediction, find the corresponding hs[x] in said post-order lookup table based on the subscript x corresponding to the maximum value in said maximum hit value array arr, and take the value s[hs[x]] in the sorted array s[N] corresponding to hs[x] as the time interval from the current time pulse to the next time pulse; if it is not the first prediction, obtain the corresponding hs[hs[x]] in said post-order lookup table based on hs[x] corresponding to the previous post-order lookup table, and take the value s[hs[hs[x]]] in the sorted array s[N] corresponding to hs[hs[x]] as the time interval from the current time pulse to the next time pulse.

7. A time pulse sequence recognition system based on a hash table, characterized in that, An application of the hash table-based time pulse sequence identification method according to any one of claims 1 to 6, comprising: a preprocessing module, configured to construct a post-order lookup table, a pre-order lookup table and a sequential hash table based on a plurality of known time pulse sequences; a matching module, configured to match the current time pulse with known time pulse sequences based on said sequential hash table and pre-order lookup table, so as to identify the pattern of said current time pulse; a prediction module, configured to predict the time interval from the current time pulse to the next time pulse based on the identified said pattern and the post-order lookup table.

Citation Information

Patent Citations

  • Pulse modulation code identification method

    CN106612147A

  • System and method for model-based radar signal deinterleaving using polysweep technique

    US20250138138A1