General protocol decoding method based on AI model group
By adopting a protocol decoding method based on AI model groups, and by identifying the waveform signal bit rate and the number of segmented sampling points, and combining multiple specialized AI models for start and stop bit detection, the problem of long computation time and high resource consumption in traditional methods is solved, and fast decoding of ultra-large data volume signals is achieved.
Patent Information
- Application Number
- CN202511539663.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-27
- Publication Date
- 2026-01-13
AI Technical Summary
Traditional protocol signal decoding methods are computationally time-consuming and resource-intensive when processing ultra-long signals. A single AI model struggles to handle multiple protocols, resulting in high training and deployment costs. Furthermore, traditional recursive detection methods are slow when dealing with large amounts of data.
A general protocol decoding method based on AI model groups is adopted. By identifying the waveform signal bit rate and the number of segmented sampling points, and combining multiple specialized AI models to detect start and stop bits, fast decoding of protocol packets is achieved.
It achieves efficient decoding of ultra-large data volume signals, reduces the resource consumption for model training and deployment, improves decoding speed, and is easy to use.
Smart Images

Figure CN121334278A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of artificial intelligence and digital signal analysis, and more specifically relates to a general protocol decoding method based on an AI model group. BACKGROUND
[0002] Decoding of protocol signals is a common problem in modern signal processing. Traditional protocol signal decoding uses a recursive method to find protocol packets in a sampled signal, and some special processing is required for signal glitches, noise, waveform morphology determined by the bandwidth of the acquisition system, etc. during the processing of signal data, especially in the case of long signal sequences. These processing logics will occupy a large amount of computing time, resulting in a slow decoding process.
[0003] AI models can extract signal features and perform some signal processing, but the number of AI model parameters limits their ability to process large continuous data. Processing of large continuous waveform data requires models with sufficient model parameters, which greatly increases the cost of model training and deployment. There are many types of protocol signals, and a single AI model cannot distinguish all protocols. Building an AI model for each protocol will waste training and deployment resources due to lack of universality.
[0004] In view of the above defects, a general decoding method that can process large continuous signals, is efficient, has universality, and is easy to train and deploy is of practical significance. SUMMARY
[0005] The present application aims to overcome the shortcomings of the prior art and provide a general protocol decoding method based on an AI model group. By combining multiple AI models with special functions, the decoding method supports multiple protocols, supports large data volume waveform processing, is easy to train and deploy, and can efficiently decode.
[0006] To achieve the above-mentioned application purposes, the present application provides a general protocol decoding method based on an AI model group, characterized in that it comprises the following steps:
[0007] (1) Extract the bit rate of the waveform signal to be analyzed;
[0008] Let the waveform signal to be analyzed be , and obtain the bit rate of the waveform signal by an AI bit rate recognition module.
[0009] (2) Calculate the number of sampling points contained in each bit;
[0010] Let the sampling rate of the acquisition system be , and calculate the number of sampling points contained in each bit of the waveform signal The number of sampling points contained in each bit :
[0011] ;
[0012] (3) Calculate the number of sampling points of the segmented waveform signal;
[0013] Suppose the bit length of the longest "start bit" in all protocols supported by the decoder is , and the bit length of the longest "stop bit" is , then the pre-stored minimum waveform segmentation bit number is:
[0014] ;
[0015] Calculate the number of sampling points of the segmented waveform signal : :
[0016] ;
[0017] Half of is ;
[0018] (4) Segment the waveform signal in two ways;
[0019] First segmentation method:
[0020] Starting from the first sampling point of the waveform signal , every sampling point is intercepted to obtain a waveform sequence group composed of multiple sub-waveform sequences, denoted as ;
[0021] Second segmentation method:
[0022] Starting from the sampling point of the waveform signal , every sampling point is intercepted to obtain a waveform sequence group composed of multiple sub-waveform sequences, denoted as ;
[0023] (5) Start bit and stop bit detection;
[0024] (5.1) Start bit detection;
[0025] Denote the AI model for start bit detection in the AI model group as , and use the AI model to process the waveform sequence group the first sample point of the first bit of the start bit of all protocol packets in the waveform signal is marked, and the position indexes of the start bits contained in all the sub-waveform sequences are stored in a set , , represents the position index of the first start bit;
[0026] At the same time, the AI model outputs the protocol type of the waveform signal ;
[0027] Similarly, a set of position indexes of the start bits contained in all the sub-waveform sequences in the waveform sequence group is obtained , represents the position index of the first start bit;
[0028] (5.2), stop bit detection;
[0029] The AI model for stop bit detection in the AI model group is denoted as , and the AI model is used to identify the sub-waveform sequences in the waveform sequence group , mark the last sample point of the last bit of the stop bit of all protocol packets in the waveform signal , and then store the position indexes of the stop bits contained in all the sub-waveform sequences in a set , , represents the position index of the first stop bit;
[0030] Similarly, a set of position indexes of the stop bits contained in all the sub-waveform sequences in the waveform sequence group is obtained , represents the position index of the first stop bit;
[0031] (6), merging of start bits and stop bits;
[0032] (6.1), merging of start bits;
[0033] The intersection of and is obtained, and a set of position indexes of all start bits is obtained :
[0034] ;
[0035] in, Indicates the first The position index of each starting bit;
[0036] (6.2) Stop bit merging;
[0037] Merge and The intersection of these intersections yields the set of position indices for all stop bits. :
[0038] ;
[0039] in, Indicates the first The position index of each stop bit;
[0040] (7) Intercept protocol packets;
[0041] According to the set and From waveform signal Extract the sampling point sequence corresponding to all protocol packets, assuming a total of 1000 packets. If there are several protocol packets, then all the captured protocol packets are represented by a set. Represented as:
[0042]
[0043] in, Indicates the first One protocol packet, ;
[0044] (8) Protocol packet parsing;
[0045] (8.1) Based on the waveform signal The protocol type is used to detect protocol packets using a set of corresponding attribute AI detection models. Each protocol packet is parsed, and the position indices of the first and last sampling points in the sampling point sequence of each protocol packet are extracted for the "attribute bits" and "data bits".
[0046] (8.2) Protocol packet attribute parsing;
[0047] Based on the position indices of the first and last sampling points corresponding to each "attribute bit" in the protocol packet, the sampling points between the first and last sampling points are converted into bit information to obtain the attribute decoding result;
[0048] (8.3) Protocol packet data parsing;
[0049] Based on the position indices of the first and last sample points corresponding to the "data bits" of each protocol packet, the sequence of sample points between the first and last sample points is extracted; then, based on the waveform signal... The protocol type is used to parse the AI model by converting the sampling point sequence into a bit sequence, and then the data bit decoding result of each protocol packet is obtained.
[0050] The objective of this invention is achieved as follows:
[0051] This invention discloses a general protocol decoding method based on AI model groups. First, the bit rate of the waveform signal to be parsed is identified. Then, the number of sampling points contained in each bit and the number of sampling points of the segmented waveform signal are calculated. Next, the waveform signal is segmented in two ways, and the start and stop bits are detected. Then, the start and stop bits under the two segmentation methods are merged. Finally, the protocol packet is extracted and parsed based on the merging result, thereby realizing fast decoding of the waveform signal to be parsed.
[0052] Meanwhile, the general protocol decoding method based on AI model groups of the present invention also has the following beneficial effects:
[0053] (1) The protocol decoding method used in this invention can convert the captured physical waveform signal (high and low level changes) back into the digital information or protocol instructions it represents, interpret the bit stream according to the rules of the selected protocol (start bit, address bit, data bit, stop bit, parity bit, etc.), and display it in a human-readable form (such as hexadecimal, decimal or characters);
[0054] (2) This invention uses multiple small models to combine and divide the work to realize the decoding function of protocol signals. The specialized small models greatly reduce the model parameters required in model training, solve the problem of training and deployment difficulties caused by too many model parameters required for a single model to directly parse the original data, and reduce the resource consumption of model training and deployment.
[0055] (3) Using multi-task trimming and splicing of signal data, the signal is segmented and then integrated into the detection protocol data packet. With the help of a dedicated small model, the decoding function of ultra-long signals is realized with less resources.
[0056] (4) The use of model detection of protocol packets and packet attributes solves the problem of slow operation of traditional recursive detection methods under large data volume, and greatly speeds up the decoding speed;
[0057] (5) The decoding method of the present invention can directly obtain the protocol type of the signal and parse it by the AI model without manually setting the decoding type and decoding parameters, which is easier to use than the traditional decoding method. Attached Figure Description
[0058] Figure 1 This is a flowchart of a general protocol decoding method based on AI model groups according to the present invention;
[0059] Figure 2 This is a schematic diagram illustrating the waveform segmentation method of the present invention;
[0060] Figure 3 This refers to the processing of protocol packets located at waveform segmentation boundaries;
[0061] Figure 4 It is the waveform of the CAN protocol signal;
[0062] Figure 5 It is the waveform of a single CAN protocol packet;
[0063] Figure 6 This is a frame structure diagram of the CAN protocol. Detailed Implementation
[0064] The specific embodiments of the present invention will now be described with reference to the accompanying drawings to enable those skilled in the art to better understand the invention. It should be particularly noted that in the following description, detailed descriptions of known functions and designs that might obscure the main content of the invention will be omitted here.
[0065] Example
[0066] In this embodiment, as Figure 1 As shown, the present invention provides a general protocol decoding method based on AI model groups, comprising the following steps:
[0067] (1) Extract the bit rate of the waveform signal being parsed;
[0068] Let the waveform signal to be analyzed be denoted as . Waveform signals are obtained through the AI bit rate recognition module. bit rate The bit rate is the maximum number of level changes per second for this waveform;
[0069] (2) Calculate the number of sampling points contained in each bit;
[0070] The sampling rate of the acquisition system is denoted as _____. Calculate waveform signal Number of sampling points contained in each bit :
[0071] ;
[0072] (3) Calculate the number of sampling points for the segmented waveform signal;
[0073] Let the longest "start bit" bit length among all protocols supported by the decoder be . The longest "stop bit" has a bit length of 1. Then the minimum number of pre-stored waveform segmentation bits for:
[0074] ;
[0075] in, The segmented waveform signal can be calculated by considering the longest bit length of the "start bit" and the longest bit length of the "stop bit" among all protocols supported by the decoder. Number of sampling points :
[0076] ;
[0077] remember Half of ;
[0078] In this embodiment, it is necessary to ensure that the segmented waveform segment contains a complete packet header or packet tail. This minimum waveform segmentation bit length is the minimum bit length that can determine the start bit and stop bit. When taken into account together with the sampling rate, it can be converted into the minimum segmentation length of each sub-waveform.
[0079] (4) Waveform signals are processed in two ways. Segment;
[0080] Methods for segmenting waveforms, such as Figure 2 As shown, the first segmentation method is denoted as method A, and the second segmentation method is denoted as method B. The two segmentation methods are described in detail below.
[0081] The first segmentation method is denoted as Method A:
[0082] From waveform signal Starting from the first sampling point, each Each sampling point extracts a sub-waveform sequence, resulting in a waveform sequence group composed of multiple sub-waveform sequences, denoted as . ;
[0083] The second segmentation method is denoted as Method B:
[0084] From waveform signal The Starting from each sampling point, each Each sampling point extracts a sub-waveform sequence, resulting in a waveform sequence group composed of multiple sub-waveform sequences, denoted as . ;
[0085] In this embodiment, because the complete packet at the junction of two segments may be destroyed when truncating the sub-waveform, such as... Figure 3 Multiple vertical solid lines indicate the positions where the waveform is cut, and dashed boxes represent complete protocol packets. In method A, the complete packet at the dashed box position is cut off by the solid lines of the waveform segment, with the cut occurring inside the protocol packet. In method B, however, the packet is in the middle of the waveform segment and can be completely preserved. Therefore, both methods A and B are used to cut the waveform, ensuring that data packets at the waveform segment boundaries in method A are within the segments in method B, and vice versa, avoiding packet omissions caused by data cutting. The same principle applies to packet headers and trailers, so two methods are used to extract data.
[0086] (5) Start and stop bit detection;
[0087] (5.1) Start bit detection
[0088] In this embodiment, as Figure 4 As shown, the waveform signal being analyzed, data, is a very long data set that may contain many protocol packets. These packets may be consecutive (adjacent to each other) or discontinuous. Figure 5 It is a waveform of a CAN protocol packet. The set of detection start bits and stop bits is actually the set of the first sampling point of the start bit corresponding to all S1 arrows in the entire waveform and the last sampling point of the stop bit marked by all E2 arrows in the entire waveform. It is used to obtain all the complete protocol packets in the data.
[0089] Let the AI model used for start-position detection in the AI model group be denoted as . Using AI models For waveform sequence groups Identify the sub-waveform sequences in the waveform signal and mark the first sampling point of the first bit of the start bit of all protocol packets in the waveform signal. The position index is used to determine the starting position index of each sub-waveform sequence, and then the position indexes of the starting positions contained in all sub-waveform sequences are stored in a set. , , Indicates the first The position index of each starting bit;
[0090] At the same time, through AI models Output waveform signal Protocol type ;
[0091] Similarly, waveform sequence groups are obtained. The set of position indices of the start position contained in all sub-waveform sequences. , Indicates the first The position index of each starting bit;
[0092] (5.2) Stop bit detection;
[0093] Let the AI model used for stop bit detection in the AI model group be denoted as . Using AI models For waveform sequence groups Identify the sub-waveform sequences in the waveform signal and mark the last sample point of the last bit of the last stop bit of all protocol packets in the waveform signal. The position index is used to calculate the position index of the stop position in all sub-waveform sequences, and then the position index of the stop position contained in all sub-waveform sequences is stored in a set. , , Indicates the first The position index of each stop bit;
[0094] Similarly, waveform sequence groups are obtained. The set of stop bit position indices contained in all sub-waveform sequences , Indicates the first The position index of each stop bit;
[0095] Each waveform segment may contain multiple start bits or stop bits, so the number of start bits and stop bits is not necessarily the same as the number of sub-waveform sequences, nor is there a necessary relationship between them;
[0096] (6) Merging the start and stop bits
[0097] (6.1) Merging of start bits;
[0098] Merge and The intersection of these intersections yields the set of position indices for all starting positions. :
[0099] ;
[0100] in, Indicates the first The position index of each starting bit;
[0101] (6.2) Stop bit merging;
[0102] Merge and The intersection of these intersections yields the set of position indices for all stop bits. :
[0103] ;
[0104] in, Indicates the first The position index of each stop bit;
[0105] (7) Intercept protocol packets;
[0106] According to the set and From waveform signal Extract the sampling point sequence corresponding to all protocol packets, assuming a total of 1000 packets. If there are several protocol packets, then all the captured protocol packets are represented by a set. Represented as:
[0107]
[0108] in, Indicates the first One protocol packet, ;
[0109] In this embodiment, the specific method for intercepting protocol packets is as follows:
[0110] if Less than Then take the waveform signal. The position index is arrive All sampling points are used as the first protocol packet Take waveform signal The position index is arrive All sampling points are used as the second protocol packet Then, by analogy, waveform signals are obtained. The position index is arrive All sampling points are used as the first One protocol packet ;in, ;
[0111] if Greater than Then take the waveform signal. The position index is arrive All sampling points are used as the first protocol packet Take waveform signal The position index is arrive All sampling points are used as the second protocol packet Then, by analogy, waveform signals are obtained. The position index is arrive All sampling points are used as the first One protocol packet .
[0112] (8) Protocol packet parsing;
[0113] (8.1) Based on the waveform signal The protocol type is used to detect protocol packets using a set of corresponding attribute AI detection models. Each protocol packet is parsed, and the position indices of the first and last sampling points in the sampling point sequence of each protocol packet are extracted for the "attribute bits" and "data bits". The "attribute bits" include attributes such as "start bit", "address bit", "check bit", and "stop bit". Since the attributes of each protocol are different, they are not listed here, but are collectively referred to as "attribute bits".
[0114] (8.2) Protocol packet attribute parsing;
[0115] like Figure 6 As shown, Figure 6 A complete CAN protocol packet consists of the following segments: Start of Frame, Arbitration Segment, Control Segment, Data Segment, CRC Segment, ACK Segment, and End of Frame. The Start of Frame is the "start bit," the End of Frame is the "stop bit," the Data Segment is the "data bits," and the Start of Frame, Arbitration Segment, Control Segment, Data Segment, CRC Segment, ACK Segment, and End of Frame are all "attribute bits."
[0116] like Figure 5 As shown in the figure, this is a complete CAN protocol packet. The waveform between arrows S1 and S2 is the packet header, the waveform between arrows E1 and E2 is the packet tail, and the waveform between arrows D1 and D2 is the data bits. Since the CAN protocol standard stipulates that the end of the frame is also a continuous 7-bit recessive bit, and the inter-frame spacer length is 3 bits, the bus must remain idle during this period (i.e., three consecutive repeated recessive bits). Figure 5 The waveform between E1 and E2 consists of 7 consecutive recessive bits, with the bit information "111 1111", which is "7F" in hexadecimal. Therefore, the parsing of the "stop bit" attribute involves taking all sampling points between E1 and E2, recording the positions of E1 and E2 in the original data, and translating all sampling points between E1 and E2 into the bit information "7F". Other attribute bits are not listed one by one.
[0117] (8.3) Protocol packet data parsing;
[0118] Data bits contain a large amount of data and have a simple structure, allowing for the use of a dedicated model to extract bit information and improve decoding efficiency. Based on the position indices of the first and last sample points corresponding to the "data bits" of each protocol packet, the sequence of sample points between the first and last sample points is extracted; then, based on the waveform signal... The protocol type is used to parse the AI model by converting the sampling point sequence into a bit sequence, and then the data bit decoding result of each protocol packet is obtained.
[0119] like Figure 5 As shown, parsing the "data bits" involves taking all the sampling points between arrows D1 and D2, as well as the indices of the sampling points at arrows D1 and D2 in the original sequence. Since the CAN signal uses NRZ encoding, the "NRZ encoding parsing AI model" is selected here to parse the CAN data bits. All the sampling points between arrows D1 and D2 are converted into bit information using the NRZ encoding parsing AI model, resulting in "55, 4E, 49, 2D, 54".
[0120] Ultimately, the indexes of the protocol attributes such as "start bit," "data bit," "address bit," "check bit," and "stop bit" in the original data of each protocol packet, along with the corresponding bit information for each attribute, constitute the protocol parsing result output by this protocol parsing method.
[0121] Although the illustrative specific embodiments of the present invention have been described above to enable those skilled in the art to understand the invention, it should be understood that the invention is not limited to the scope of the specific embodiments. For those skilled in the art, various changes are obvious as long as they are within the spirit and scope of the invention as defined and determined by the appended claims, and all inventions utilizing the concept of the present invention are protected.
Claims
1. A general protocol decoding method based on AI model groups, characterized in that, Includes the following steps: (1) Extract the bit rate of the waveform signal being parsed; Let the waveform signal to be analyzed be denoted as . Waveform signals are obtained through the AI bit rate recognition module. bit rate ; (2) Calculate the number of sampling points contained in each bit; The sampling rate of the acquisition system is denoted as _____. Calculate waveform signal Number of sampling points contained in each bit : ; (3) Calculate the number of sampling points for the segmented waveform signal; Let the longest "start bit" bit length among all protocols supported by the decoder be... The longest "stop bit" has a bit length of 1. Then the minimum number of pre-stored waveform segmentation bits for: ; Calculate segmented waveform signal Number of sampling points : ; remember Half of ; (4) Waveform signals are processed in two ways. Segment; First segmentation method: From waveform signal Starting from the first sampling point, each Each sampling point extracts a sub-waveform sequence, resulting in a waveform sequence group composed of multiple sub-waveform sequences, denoted as . ; The second segmentation method: From waveform signal The Starting from each sampling point, each Each sampling point extracts a sub-waveform sequence, resulting in a waveform sequence group composed of multiple sub-waveform sequences, denoted as . ; (5) Start and stop bit detection; (5.1) Start bit detection; Let the AI model used for start-position detection in the AI model group be denoted as . Using AI models For waveform sequence groups Identify the sub-waveform sequences in the waveform signal and mark the first sampling point of the first bit of the start bit of all protocol packets in the waveform signal. The position index is used to determine the starting position index of each sub-waveform sequence, and then the position indexes of the starting positions contained in all sub-waveform sequences are stored in a set. , , Indicates the first The position index of each starting bit; At the same time, through AI models Output waveform signal Protocol type ; Similarly, waveform sequence groups are obtained. The set of position indices of the start position contained in all sub-waveform sequences. , Indicates the first The position index of each starting bit; (5.2) Stop bit detection; Let the AI model used for stop bit detection in the AI model group be denoted as . Using AI models For waveform sequence groups Identify the sub-waveform sequences in the waveform signal and mark the last sample point of the last bit of the last stop bit of all protocol packets in the waveform signal. The position index is used to calculate the position index of the stop position in all sub-waveform sequences, and then the position index of the stop position contained in all sub-waveform sequences is stored in a set. , , Indicates the first The position index of each stop bit; Similarly, waveform sequence groups are obtained. The set of stop bit position indices contained in all sub-waveform sequences , Indicates the first The position index of each stop bit; (6) The start bit and the stop bit are merged; (6.1) Merging of start bits; Merge and The intersection of these intersections yields the set of position indices for all starting positions. : ; in, Indicates the first The position index of each starting bit; (6.2) Stop bit merging; Merge and The intersection of these intersections yields the set of position indices for all stop bits. : ; in, Indicates the first The position index of each stop bit; (7) Intercept protocol packets; According to the set and From waveform signal Extract the sampling point sequence corresponding to all protocol packets, assuming a total of 1000 packets. If there are several protocol packets, then all the captured protocol packets are represented by a set. Represented as: ; in, Indicates the first One protocol packet, ; (8) Protocol packet parsing; (8.1) Based on the waveform signal The protocol type is used to detect protocol packets using a set of corresponding attribute AI detection models. Each protocol packet is parsed, and the position indices of the first and last sampling points in the sampling point sequence of each protocol packet are extracted for the "attribute bits" and "data bits". (8.2) Protocol packet attribute parsing; Based on the position indices of the first and last sampling points corresponding to each "attribute bit" in the protocol packet, the sampling points between the first and last sampling points are converted into bit information to obtain the attribute decoding result; (8.3) Protocol packet data parsing; Based on the position indices of the first and last sample points corresponding to the "data bits" of each protocol packet, the sequence of sample points between the first and last sample points is extracted; then, based on the waveform signal... The protocol type is used to parse the AI model by converting the sampling point sequence into a bit sequence, and then the data bit decoding result of each protocol packet is obtained.
2. The general protocol decoding method based on AI model groups according to claim 1, characterized in that, The specific method for intercepting the protocol packets is as follows: if Less than Then take the waveform signal. The position index is arrive All sampling points are used as the first protocol packet Take waveform signal The position index is arrive All sampling points are used as the second protocol packet Then, by analogy, waveform signals are obtained. The position index is arrive All sampling points are used as the first One protocol packet ;in, ; if Greater than Then take the waveform signal. The position index is arrive All sampling points are used as the first protocol packet Take waveform signal The position index is arrive All sampling points are used as the second protocol packet Then, by analogy, waveform signals are obtained. The position index is arrive All sampling points are used as the first One protocol packet .