Data interaction checking method and system, and WiFi system on chip
By dividing data packets into multiple data segments and configuring type identifiers in a WiFi on-chip system, the problem of data misalignment caused by corrupted data frame headers is solved, thus achieving the effectiveness and reliability of data interaction.
Patent Information
- Application Number
- CN202511491897.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-17
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2045-10-17
AI Technical Summary
In WiFi on-chip systems, during data interaction between the media access control layer and the physical layer, data frame headers may be corrupted in the air, causing data misalignment. This can lead to upper-layer software being unable to correctly parse frames, resulting in frame drops or memory overflow issues.
By converting the received data packets into a data stream and dividing it into multiple consecutive data segments, configuring the field information and type identifier of each data segment, each data segment is stored in a preset format, and verification is performed sequentially during reading to ensure the correctness of the data segment boundaries.
It enables timely termination of erroneous processes during data interaction, improving the effectiveness of the interaction process and reducing communication overhead.
Smart Images

Figure CN120980605B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of communication technology, in particular to a data interaction verification method and system and a WiFi system on chip. BACKGROUND
[0002] In a WiFi system on chip (SOC), data interaction between a media access control (MAC) layer and a physical layer (PHY) is involved, that is, the RX path between the MAC layer and the PHY is provided.
[0003] The RX path is defined as follows: data from the air reaches the PHY through an RF module, and then is sent to the MAC layer, and finally, after being processed by the SOC, reaches the software protocol stack.
[0004] In this process, the MAC layer plays a role of data transfer and medium control in the communication process, and is a data link layer in the ISO seven-layer network model. From the implementation point of view, the PHY receives the data packet from the air, and converts the radio signal into a data stream and sends it to the MAC layer.
[0005] In the data delivered by the PHY, if the data frame header is damaged in the air, the data stored in the storage unit (such as static random access memory SRAM) through the MAC layer is misaligned, and the result of the misaligned data is that the upper layer software cannot obtain the correct frame, thus bringing unknown consequences, such as frame loss or memory trampling caused by length error, and even a dead machine.
[0006] The above information disclosed in the background art is only used to enhance the understanding of the background of the present application, and therefore it can contain information which is not formed as prior art known by those skilled in the art. SUMMARY
[0007] The embodiments of the present application provide a data interaction verification method and system and a WiFi system on chip, which can verify data in real time, terminate the interaction process in time when an error occurs, and improve the effectiveness of the interaction process.
[0008] According to a first aspect of the embodiments of the present application, a data interaction verification method is provided, comprising:
[0009] The received data packet is converted into a data stream, and the data stream is divided into at least two continuous data segments according to the content attribute of the data stream, the content attribute including field information and length information corresponding to the field information;
[0010] In the transmission of the at least two continuous data segments, a type identifier is configured for each of the field information in each of the data segments, so that the field information and the type identifier in each of the data segments are sequentially stored in a preset format, and the type identifiers of different data segments are different;
[0011] In order to read the stored field information in sequence according to the order in which each of the field information is stored, and perform verification according to the preset length information, the actual length information and the type identifier of the read field information, and continue to read the stored field information when the verification is correct.
[0012] Optionally, the conversion of the received data packet into a data stream, and the division of the data stream into at least two continuous data segments according to the content attribute of the data stream, comprises:
[0013] The physical frame header of the data packet is demodulated, and a first data segment is generated according to the first length information carried by the physical frame header and the metadata field information indicated by the first length information;
[0014] When the first data segment is correctly verified, the data packet is continuously demodulated, and a media access control protocol data unit is generated according to the second length information carried by the physical frame header and the payload field information indicated by the second length information; the second length information is carried in the field information of the first data segment;
[0015] When the media access control protocol data unit is correctly verified, a second data segment is generated according to the third length information carried by the physical frame header and the radio frequency information field information indicated by the third length information.
[0016] Optionally, the verification method of data interaction satisfies one or more of the following:
[0017] Each of the data segments is stored in a data transmission interface structure, the data transmission interface comprises a first-in-first-out queue composed of a plurality of basic data units, each of the basic data units has a first type bit and a second type bit, one of the first type bit and the second type bit is used to store field information, and the other is used to store a type identifier;
[0018] Each of the first type bits has 8 bits, and each of the second type bits has 2 bits;
[0019] The data transmission interface structure is a first-in-first-out queue with a depth of 128 and a width of 10 bits;
[0020] The payload field information indicated by the second length information can be zero.
[0021] The type identifier corresponding to the first data segment includes 2'b01;
[0022] The type identifier corresponding to the media access control protocol data unit includes 2'b10;
[0023] The type identifier corresponding to the second data segment includes 2'b11.
[0024] Optionally, the preset length information, the actual length information and the type identifier according to the read field information are used to perform verification, and when the verification is correct, the stored field information is continuously read, including:
[0025] When reading the field information of the stored current data segment, the actual type identifier of the field information is read one by one, compared with the type identifier configured for the current data segment, and when it is determined that the type identifiers in the preset length information are all the same as the actual type identifiers in the actual length information, the correctness of the adjacent segment boundary is confirmed by checking whether the actual type identifier of the next field information is switched to the configured type identifier of the next data segment, and when it is determined that it is the configured type identifier of the next data segment, the field information of the stored next data segment is continuously read and verified in sequence.
[0026] Optionally, the at least two continuous data segments include three continuous data segments, and when the current data segment is the first data segment, the preset length information of the data segment adjacent to the first data segment is determined through the field information carried by the first data segment.
[0027] Optionally, in response to the correct verification of the field information of the first data segment, when the field information of the data segment adjacent to the first data segment is read, the temporary counter is continuously added by 1 every time the reading is correct, and when it is determined that the count value of the temporary counter is less than the preset length information of the adjacent data segment, it is determined that the actual type identifier of the field information is the same as the configured type identifier; and when it is determined that the count value of the temporary counter is the preset length information plus 1, and when it is determined that the count value of the temporary counter is less than the preset length information of the adjacent data segment, it is determined that the actual type identifier of the field information is the same as the configured type identifier; and when it is determined that the count value of the temporary counter is the preset length information plus 1, it is determined that the last data segment is the second data segment, and when the read type identifier is verified to correspond to the second data segment, the field information of the second data segment is continuously processed.
[0028] Optionally, in any data segment, if a type identifier is found to be mismatched through checking, or at the boundary of adjacent data segments, the type identifier of the adjacent data segment is determined to be incorrectly switched, it is determined that the checking fails, and an error processing mechanism is triggered.
[0029] The error processing mechanism includes at least one of discarding the received data, reporting an error to an upper layer, and terminating the current receiving process.
[0030] Optionally, the checking method is applied to a media access control layer and a physical layer in a WiFi system on chip, and the media access control layer and the physical layer are connected through a data transmission interface structure.
[0031] The received data packet further includes: in response to receiving a start request signal from the media access control layer, and replying to a start response signal in response to the start request signal, the physical layer performs a transmission operation of a data segment.
[0032] According to a second aspect of the embodiments of the present application, a data interaction system is provided, including:
[0033] A physical layer is configured to convert a received data packet into a data stream, divide the data stream into at least two continuous data segments according to a content attribute of the data stream, and configure a type identifier for each field information in each data segment during transmission of the at least two continuous data segments; wherein the content attribute includes field information and length information corresponding to the field information, and the type identifiers of different data segments are different.
[0034] A data transmission interface structure is connected with the physical layer, and is configured to store field information and type identifiers in each data segment in a preset format.
[0035] A media access control layer is connected with the data transmission interface structure, and is configured to sequentially read stored field information from the data transmission interface structure in an order in which each field information is stored, and perform checking according to preset length information, actual length information of the read field information, and the type identifier, and continue to read the stored field information when the checking is correct.
[0036] According to a third aspect of the embodiments of the present application, a WiFi system on chip is provided, including the data interaction system as described in any of the preceding embodiments.
[0037] The embodiments of the present application have the following technical effects due to the adoption of the above technical solutions:
[0038] By the content attribute, the field information and the length information corresponding to the field information of each data segment in the received data packet can be determined, and the two parameters define the parameter information of each data segment. And the type identifier is configured for each field information in each data segment during transmission, and the field information and the type identifier in each data segment are stored in sequence according to the preset format, so that the field information and the type identifier are bound and transmitted at the physical layer. In this way, based on the length information and the type label, strict boundaries between different data segments are realized. When reading the stored field information in sequence, since the boundaries have been delimited in advance, the check can be performed according to the preset length information, the actual length information of the read field information, and the type identifier, so that the stored field information is read only when the check is correct. This means that when the check fails, the current process can be terminated at any time, the effectiveness of the interaction process is improved, and the communication overhead is reduced. BRIEF DESCRIPTION OF DRAWINGS
[0039] The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and serve to explain the principles of the application, and do not limit the application in any way. In the drawings:
[0040] Figure 1 A flowchart of a data interaction verification method in an embodiment of the application;
[0041] Figure 2 A structural schematic diagram of a data transmission interface structure in an embodiment of the application;
[0042] Figure 3 A structural schematic diagram of a data interaction system in an embodiment of the application;
[0043] Figure 4 A timing diagram of a data interaction verification method in an embodiment of the application. DETAILED DESCRIPTION
[0044] In order to make the technical solutions and advantages of the embodiments of the application clearer, the exemplary embodiments of the application will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the application, not all the embodiments. It should be noted that the embodiments in the application and the features in the embodiments can be combined with each other without conflict.
[0045] As in the background art, under the communication architecture and mechanism of the existing physical layer-media access control layer, interaction errors are prone to occur. And usually, errors are detected only after most of the data has been received. In this way, a large amount of interaction time is occupied, resulting in low utilization of the channel.
[0046] After the inventor studies the cause of the above situation, it is found that the data exchange process of the physical layer and the media access control layer is composed of three data stages, i.e. RXV1 stage + MPDU stage + RXV2 stage. Among them, the RXV1 stage carries the length information of RXV1 itself and the subsequent MPDU length information provided by the physical layer, the MPDU stage is the 802.11 protocol data transmission stage, and the RXV2 stage is the RF information data block stage following the MPDU stage.
[0047] Specifically, after the physical layer decodes the physical frame header and extracts the header information, it can determine the information of the RXV1 stage, and then continue to decode to obtain the MPDU. Moreover, since the frame header has length information, the RXV2 is started to be generated after the length is decoded.
[0048] Further, in addition to carrying the MPDU length information, RXV1 also carries important physical layer parameters such as bandwidth used in data transmission, physical layer working mode, actual transmission rate, etc.; the data transmitted in the MPDU stage is the 802.11 standard format frame and the PAD content filled according to the WORD; the content of the RXV2 stage is the RF related information such as RSSI, EVM, etc., and its length is fixed.
[0049] At present, the data is divided into three segments and enters the media access control layer in sequence. From the perspective of the media access control layer, the segmentation between the data segments strictly depends on the two length information in RXV1 and the integrity of the data. Therefore, there are often the following problems in actual use:
[0050] First, when the physical layer cannot completely deliver all the data according to the length given in the RXV1 stage, the media access control layer is dead waiting.
[0051] The root cause is that in actual working conditions, the physical layer cannot completely handle uncontrollable factors of the space environment, such as data collision, interference, distortion generated in signal transmission, etc., which leads to demodulation failure, thereby giving an incomplete frame, resulting in the above abnormal situation.
[0052] Secondly, in the data delivered by the physical layer, after the data frame header is destroyed in the air, the length filled in RXV1 may not be real. For example, the physical layer claims that the byte of the MPDU data segment for the media access control layer is 100, but the physical layer can only provide 99 bytes or provide 101 bytes in actual work.
[0053] In this case, the boundaries of RXV1 data segment, MPDU data segment and RXV2 data segment are misaligned. The misalignment of boundaries leads to misalignment of data stored in SRAM by the media access control layer, and the misaligned data results in that the upper software cannot obtain correct frames, thus bringing unknown consequences. For example, frame loss or length error brings memory trampling, and then causes a crash.
[0054] Based on this, the application provides a data interaction verification method, that is, type identifiers are configured for each field information in the process of transmitting field information, and the type identifiers of different data segments are different. In this way, based on the length information of each data segment and the type identifier, it can be judged whether the currently received field information is correct, so that the stored field information can be continuously read only when the verification is correct. This means that when the verification fails, the current process can be terminated at any time, the effectiveness of the interaction process is improved, and the communication overhead is reduced.
[0055] In order to enable those skilled in the art to better understand and implement the present application, the specific schemes, principles, advantages and effects of the present application will be described in detail below with reference to the accompanying drawings.
[0056] The data interaction verification method in the embodiment can be applied to the media access control layer and the physical layer in the WiFi system on chip, and the media access control layer and the physical layer are connected through a data transmission interface structure.
[0057] Among them, on the RX path, the physical layer is the "front-end scout", which is responsible for capturing and preliminarily processing digital signals from the analog world (air).
[0058] The data transmission interface structure serves as a temporary storage station, so that the data stream obtained by the physical layer processing is arranged according to the pre-set format. Moreover, the data transmission interface structure in the present application can be configured to realize the storage and reading of data based on the first-in first-out (FiFo) mode.
[0059] The media access control layer is the "command center", which is responsible for the final data verification, analysis and scheduling.
[0060] From the specific implementation, the physical layer can include:
[0061] A digital front-end module (DFE) for receiving the original digital signal after sampling by an analog-to-digital converter (ADC) in the RX path, mainly including:
[0062] Automatic gain control (AGC), that is, dynamically adjusting the amplification multiple of the received signal to keep its amplitude within the optimal range, avoiding saturation or insufficient precision during subsequent analog-to-digital converter quantization.
[0063] DC offset correction, i.e. to eliminate the DC component introduced by the non-ideal hardware circuit (such as mixer) to prevent interference with signal demodulation.
[0064] I / Q imbalance correction function, i.e. to correct the possible amplitude inequality and phase non-orthogonality (non-90 degrees) error between the in-phase (I) and quadrature (Q) two-way signals.
[0065] Synchronization and channel estimation module, mainly to realize frame checking (i.e. to identify whether there is a valid data frame in the signal, usually by detecting the known preamble or synchronization word to achieve), frequency synchronization (i.e. to estimate and compensate for the frequency deviation between the local oscillators of the transmitting end and the receiving end, and the frequency deviation caused by the Doppler effect), timing synchronization ISI (i.e. to accurately determine the starting time of each symbol, to find the best sampling point to minimize the inter-symbol interference), channel estimation function (i.e. to estimate the impact of the wireless channel on the signal through the known pilot signal).
[0066] Demodulation and decoding module, mainly to realize equalization (i.e. to use the channel information obtained by the channel estimation module to reverse compensate for the distortion caused by the channel to recover the original symbol sequence of the transmitting end), demapping (i.e. to map the complex symbols after equalization back to the corresponding bit soft information or hard decision bits according to the modulation rule), despreading (i.e. to collect the signal energy spread over a wide frequency band to recover it into a narrow band signal, while obtaining the spread spectrum gain to resist interference), channel decoding function (i.e. to perform decoding algorithms corresponding to the encoding at the transmitting end to correct bit errors generated during transmission using redundant information).
[0067] In other words, the working process of the physical layer in the embodiment of the application is briefly described as: ADC-DFE-synchronization-channel estimation-equalization-demapping-decoding. That is, the physical layer mentioned in the embodiment of the application is a hardware functional entity that converts the A / D sampled digital signal into a standard frame of 802.11 format through a series of transformations.
[0068] It should be pointed out that the definition scope of the physical layer does not include the RF part, but only the baseband processing part, which can also be called baseband processor (BBP).
[0069] From the implementation point of view, the medium access control layer is a hardware entity composed of data framing function module, data deframing function module, channel contention and management module, data security accelerator and other main modules.
[0070] Among them, the data framing function module is responsible for encapsulating the data packet delivered from the upper layer into a frame conforming to a specific standard, for example, a frame conforming to the 802.11 protocol.
[0071] The data frame parsing function module is configured to parse the original bit stream received from the physical layer and restore the original bit stream into valid data frames, and then extract the data payload and deliver the data payload to the upper layer.
[0072] The channel contention and management module implements a specific medium access control protocol.
[0073] For WiFi, a more complex CSMA / CA (Carrier Sense Multiple Access / Collision Avoidance) is implemented, including a series of operations such as channel listening, random backoff, channel reservation (RTS / CTS), etc.
[0074] The data security accelerator is configured to accelerate the data encryption / decryption and integrity verification process in hardware, greatly improving the processing efficiency and reducing the CPU burden.
[0075] The structure of the data transmission interface structure will be described in detail below.
[0076] In short, by using the scheme provided in the embodiments of the present application, the transmission mechanism and error detection mechanism of the MAC layer and the PHY layer on the RX path in the system on chip of WiFi (such as WiFi6, WiFi7, WiFi8, and future WiFi protocols) can be realized, so that the data from the air can be reliably transmitted and error detected between the two.
[0077] In some embodiments, referring to the flowchart of a data interaction verification method in the embodiments of the present application shown in Figure 1 As shown in Figure 1 The following steps can be performed:
[0078] S101, converting the received data packet into a data stream, and dividing the data stream into at least two continuous data segments according to the content attribute of the data stream, the content attribute including field information and length information corresponding to the field information.
[0079] The step S101 can be implemented in the physical layer.
[0080] Specifically, the physical layer can obtain the data packet sent by the external device from the air through the antenna, and parse the data packet according to the predetermined process, so as to convert the data packet into a data stream.
[0081] In the actual interaction process, the data packet has valid data. By performing the parsing, the data stream can be divided according to the field information and the length information corresponding to the field information, so as to obtain a plurality of data streams. Since the field information and the length information have a corresponding relationship, the boundaries of different data segments can be clearly defined.
[0082] In some embodiments, the data stream can be divided into two continuous data segments without payload and three data segments with payload according to whether the payload is carried in the data packet.
[0083] It should be noted that the processing procedure of the more physical layer to the data packet can refer to the existing protocol.
[0084] S102, when transmitting the at least two continuous data segments, configuring a type identifier for each field information in each of the data segments, so that the field information and the type identifier in each of the data segments are sequentially stored according to a preset format, and the type identifiers of different data segments are different.
[0085] In some embodiments, by performing step S101, the division operation of the data segment can be correctly performed according to the length information and the field information. And when transmitting these data segments, they are transmitted one by one in the manner of data stream.
[0086] And in order to better cooperate with the verification process of the media access control layer, a type identifier is specially configured for each field information to be transmitted during the transmission process, so that the media access control layer can correct errors in time based on the length information, the type identifier, and the data segment corresponding to the type identifier.
[0087] In some embodiments, the type identifiers of different data segments are different, and the type identifiers of the same data segment are the same. In this way, after determining the length information of each data segment, the switching points between different type identifiers can be determined.
[0088] Exemplarily, for the three data segments that may occur, three different types of type identifiers are configured in the embodiments of the present application, so that the type identifier corresponds to the data segment or the interval between data segments.
[0089] In some embodiments, the divided data segments usually need to be stored first and then read, so as to realize the ordered storage and reading of the field information.
[0090] More specifically, in the case of configuring the field information and the type identifier, the field information and the type identifier can be stored according to the pre-set storage format. Through this standardized storage format, the verification process can be more clearly and simply performed.
[0091] In some embodiments, the stored field information can be read according to the order in which the field information is stored, that is, the storage and reading operation of the data is performed in the first-in first-out manner.
[0092] S103, sequentially read the stored field information according to the order when each of the field information is stored, and perform verification according to the preset length information, the actual length information and the type identifier of the read field information, and continue to read the stored field information when the verification is correct.
[0093] In some embodiments, the field information between the physical layer and the media access control layer can be interacted in a first-in-first-out manner, so that the reading order of the field information can be arranged in the data stream.
[0094] This is because: by performing steps S101 and S102, the one-to-one pairing of field information, length information and type identifier is realized, and through one of the parameters, the data segment where the field information is located and the type identifier of the field information can be determined.
[0095] In this way, each data segment has preset length information, and the preset length information corresponds to a preconfigured type identifier, so that each field information has actual length information when read. In this way, when belonging to a data segment, the type identifiers corresponding to the preset length information and the actual length information should be the same, so that the verification can be performed according to the length and type identifier of the read field information.
[0096] Among them, the verification refers to whether the currently read field information is the same as the previously estimated field information and whether it is in the same data segment, so as to judge whether the interaction between the physical layer and the media access control layer is correct.
[0097] Further, the verification result can be used to determine whether to further receive the next field information and / or read the already stored field information.
[0098] In this way, in response to the verification failure, the current process can be terminated at any time, the effectiveness of the interaction process is improved, and the communication overhead is reduced.
[0099] It should be pointed out that the "stored field information" in step S103 refers to the field information that is continuously stored within the time when the media access control layer receives the current field information and performs verification.
[0100] In addition, the media access control layer can know the information of each data segment through cooperation with the physical layer. The description of the cooperation between the media access control layer and the physical layer can be referred to the existing scheme.
[0101] In some embodiments, the above step S101 can include:
[0102] demodulate the physical frame header of the data packet, and generate a first data segment according to first length information carried in the physical frame header and metadata field information indicated by the first length information.
[0103] Specifically, the data packet contains physical information, and by demodulating the physical frame header, metadata header or descriptor in the data packet can be determined. It can tell the media access control layer what is coming and how to correctly process it before the media access control protocol data unit arrives.
[0104] In some embodiments, the physical frame header carries the first length information. The first length information defines the indicated metadata field information, and based on the length information and the metadata field information, the first data segment can be generated.
[0105] Specifically, the first length information indicates how long the first data segment is, which allows the hardware logic of the media access control layer to dynamically parse this physical frame header, even if the RXV1 length of different chip versions or modes can be different.
[0106] The physical layer demodulates the physical frame header to determine the first data segment, and the determination can refer to the determination of the prior art.
[0107] In other words, in the embodiments of the present application, the first data segment can be obtained by the first demodulation.
[0108] Exemplarily, the first data segment can be RXV1 data segment.
[0109] When the first data segment is correctly checked, the data packet is continuously demodulated, and a media access control protocol data unit is generated according to second length information carried in the physical frame header and payload field information indicated by the second length information; the second length information is carried in the field information of the first data segment.
[0110] Specifically, the embodiments of the present application adopt a process of demodulation-transmission-storage-reading-checking, that is, each field information read is checked, and when all the field information in the first data segment is correctly checked, the data packet is continuously demodulated.
[0111] In this way, the next data segment, that is, the media access control protocol data unit, can be generated according to the second length information carried in the field information of the first data segment and the payload field corresponding to the second length information.
[0112] More specifically, once all the field information in the first data segment is read, it can be considered that the receiving and checking of the first data segment has ended. In this way, all the important parameters can be parsed from the field information of the first data segment, which includes the second length information. Since the second length information can indicate the field information, a media access control protocol data unit, i.e., a nominal second data segment, can be formed.
[0113] When the media access control protocol data unit is correctly checked, a second data segment is generated according to a third length information carried by the physical frame header and radio frequency information field information indicated by the third length information.
[0114] It should be noted that when the data of the MPDU data segment is a 802.11 standard format frame and the PAD content is filled in "words" (i.e., four bytes), the PAD part is also configured with a type identifier, but in the checking, the media access control layer calculates and discards the PAD part to prevent misalignment in checking.
[0115] That is, the role of the PAD is only to align for the convenience of hardware implementation, and the length is known. For example: 0 to 3 bytes.
[0116] It should be noted that word alignment only occurs in the last few bytes. For example, if there are 65 bytes of real data to be transmitted, the data transmission interface structure is transmitted in groups of four bytes, and the last byte is filled.
[0117] In which, the specific length to be filled in is calculated by the formula X=4-(Y%4), Y is the length of the real data, % represents the remainder, and X is the length to be filled.
[0118] In this case, if the length of the real data is 65, then X=4-(65%4)=3, i.e., 0x00 is brought into the above example.
[0119] Specifically, the embodiment of the application checks each field information read, and when all the field information in the media access control protocol data unit is correctly checked, the data packet is continued to be demodulated. In this way, a second data segment can be generated according to a third length information carried by the physical frame header and radio frequency information field information corresponding to the third length information.
[0120] In which, the radio frequency information field information includes: RSSI, EVM, and other RF related information.
[0121] Exemplarily, the second data segment can be an RXV2 data segment, and the length of the segment is fixed, for example, 8, i.e., the third length information can not be carried, i.e., the fixed value by default.
[0122] In some embodiments, the payload field information indicated by the second length information can be zero, i.e., the current data packet is empty.
[0123] In some embodiments, the type identifier corresponding to the first data segment includes 2'b01, which can also be written as 01; the type identifier corresponding to the media access control protocol data unit includes 2'b10, which can also be written as 10; and the type identifier corresponding to the second data segment includes 2'b11, which can also be written as 11.
[0124] In this way, through different type identifiers, the data segment to which the data belongs can be determined. Conversely, according to the data segment in which the data is located, the type identifier can be determined. Through this correspondence, the verification process can be better and faster.
[0125] In other words, 2'b01 indicates that the byte belongs to the RXV1 data segment, 2'b10 indicates that the byte belongs to the MPDU data segment, and 2'b11 indicates that the byte belongs to the RXV2 data segment. The type identifier is generated during transmission for the media access control layer to check.
[0126] It should be pointed out that the type identifiers listed in the above examples are only for illustrative purposes and do not represent that only the above type identifiers can be used. The type identifiers can be flexibly configured according to actual needs.
[0127] In some optional examples, the type identifier can also include 2'b00, i.e., a reserved bit. This means that the current bit is not used, but the detection of the reserved bit by the media access control layer also means an error, such as a glitch caused during transmission, a timing problem, or a logic problem in the physical layer, etc.
[0128] It should be pointed out that since it is a data segment-by-data segment parsing method, the data segment to which each length information belongs can be determined, and mismatch between the data segment and the length information will not occur.
[0129] In some embodiments, each of the data segments is stored in a data transmission interface structure, the data transmission interface includes a first-in-first-out queue composed of a plurality of basic data units, each of the basic data units has a first type bit and a second type bit, one of the first type bit and the second type bit is used to store field information, and the other is used to store a type identifier.
[0130] Specifically, the data transmission interface structure has a preset depth and width, and the data stream parsed by the physical layer can be stored according to the format of the set data transmission interface structure when flowing through the data transmission interface structure.
[0131] That is, the data transmission interface structure includes a plurality of basic data units, each of which has the same parameters, so that the field information that can be stored can be determined by configuring the number of basic data units.
[0132] In some embodiments, each basic data unit has a first type bit and a second type bit, one of which is used to store field information and the other of which is used to store type identification.
[0133] That is, by different storage locations, the field information and type identification are stored in different bits.
[0134] Exemplarily, the data transmission interface structure supports a first-in-first-out mode, which enables the field information to be stored first and the type identification to be stored second when each field information in the transmission data stream is transmitted.
[0135] In this case, during the transmission of the data stream, the physical layer knows the start of each segment, so that during the transmission of the field information, the bit extension operation can be performed to enable the corresponding type identification tag to be configured in two bits of the bytes occupied by the field information.
[0136] More specifically, each of the first type bits has 8 bits, and each of the second type bit type identifications has 2 bits.
[0137] It can be understood that the first type bit can have 2 bits, and the second type bit type identification can have 8 bits.
[0138] Exemplarily, referring to Figure 2 , a structure diagram of a data transmission interface structure in an embodiment of the present application is shown, as Figure 2 , the data transmission interface structure is a first-in-first-out queue with a depth of 128 and a width of 10 bits.
[0139] More specifically, the high bits (i.e., bits 9~bit 2) are used to store field information, and the low bits (i.e., bits 1~bit 0) are used to identify the properties of each field information, i.e., to identify the type.
[0140] It should be noted that a depth of 128 is only an example, and the reason for setting 128 here is that it takes into account delay, throughput, empty probability, etc., and is a better balance point under multiple comprehensive factors.
[0141] In addition, when performing storage and reading, there is no need to split and change the depth and width. When the physical layer pushes the data stream into the data transmission interface structure, it indicates that there is data, at which time the valid signal is pulled up, and the medium access control layer reads the data according to the pulling up of the valid signal. If the data transmission interface structure has been filled, a back pressure signal is given. At this time, either the processing waits for the signal or an error processing module is entered, which depends on the current state of the physical layer.
[0142] In short, the data transmission interface structure itself is a temporary storage area, and the unit size is 10 bits, with a total of 128 units (i.e., the depth).
[0143] By performing the above-mentioned data stream splitting mode, the delimitation of the data segment can be correctly performed, and a unique identifier can be configured for each data segment, which is beneficial to better perform the verification.
[0144] Exemplarily, for the physical layer, after receiving the data packet, demodulation processing can be performed, and the following scheme is performed in this way:
[0145] RXV1 is generated, and a corresponding tag=2'b01 is generated for each RXV1 byte;
[0146] The RXV1 is transmitted, and a corresponding tag=2'b01 is configured for each RXV1 byte;
[0147] MPDU is generated, and a corresponding tag=2'b10 is generated for each MPDU byte;
[0148] The MPDU is transmitted, and a corresponding tag=2'b10 is configured for each MPDU byte;
[0149] RXV2 is generated, and a corresponding tag=2'b11 is generated for each RXV2 byte;
[0150] The RXV2 is transmitted, and a corresponding tag=2'b11 is configured for each RXV2 byte.
[0151] Wherein, any stage error stops immediately, and then sends a PHY_err indication, and waits for the RX_DONE signal of the medium access control layer.
[0152] In some embodiments, step S103 can include: when reading the field information of the stored current data segment, reading the actual type identifier of the field information one by one, comparing with the configured type identifier of the current data segment, and when determining that the type identifier within the preset length information is the same as the actual type identifier within the actual length information, confirming the correctness of the adjacent segment boundary by checking whether the actual type identifier of the next field information is switched to the configured type identifier of the next data segment, and when determining that the configured type identifier of the next data segment, sequentially continuing to read the field information of the stored next data segment and performing verification.
[0153] Specifically, the embodiments of the present application adopt the way that each field information is verified, so that when reading the field information one by one, since the field information itself carries the type identifier, the actual read type identifier can be compared with the expected type identifier to determine whether the current verification is successful. In this way, when it is determined that they are the same, it means that the current data segment can be correctly received and successfully verified.
[0154] Further, whether the actual type identifier of the next field information is the configured type identifier of the next data segment to be switched to can be determined to confirm the correctness of the adjacent segment boundary. Then, when it is determined that the configured type identifier of the next data segment, sequentially continue to read the field information of the stored next data segment and perform verification.
[0155] That is, the present application takes into account both boundary determination and integrity verification.
[0156] In some embodiments, the at least two continuous data segments include three continuous data segments, and when the current data segment is a first data segment, the preset length information of the data segment adjacent to the first data segment is determined through the field information carried by the first data segment.
[0157] Among them, the data segment adjacent to the first data segment is the data segment indicated by the media access control protocol data unit.
[0158] Correspondingly, in response to correctly verifying the field information of the first data segment, when reading the field information of the data segment adjacent to the first data segment, the temporary counter is continuously added by 1 each time the field information is correctly read, and when it is determined that the count value of the temporary counter is less than the preset length information of the adjacent data segment, it is determined that the actual type identifier of the field information is the same as the configured type identifier; and when it is determined that the count value of the temporary counter is the preset length information plus 1, it is determined that the last data segment is a second data segment, and by verifying the read type identifier corresponding to the second data segment, the field information of the second data segment is continued to be processed.
[0159] Exemplarily, the start of receiving data is initiated under the scheduling of the media access management engine, wherein the media access management scheduling engine complies with the 802.11 protocol related conventions.
[0160] In this way, the media access control layer acquires the length information rxv_len of the first byte of RXV1, and simultaneously determines whether the tag corresponding to each byte is 2'b01. If not, it is abandoned, and enters the error processing and returns to the idle state, waiting for the next instruction of the media access management engine.
[0161] If yes, the length information is saved, and the subsequent content of RXV1 is continuously read, while monitoring whether the tag on the byte is 2'b01.
[0162] After the processing of RXV1, the media access control layer will obtain the mpdu_len information, and continue to read the content provided by the subsequent physical layer, at this time, the MPDU content is acquired, and the temporary counter is continuously added by 1. At the same time, the media access control layer checks whether the tag corresponding to each byte is 2'b10, if yes, it continues to read the subsequent and check the tag.
[0163] If the count value of the accumulated counter is <mpdu_len, the value of the tag should only be 2'b10, otherwise, an error is reported, and the error processing procedure is entered.
[0164] After processing the MPDU segment, the value of the temporary accumulated counter is mpdu_len+1, at this time, the tag value corresponding to the content read from the physical layer should be 2'b11, and then the subsequent RXV2 is processed. Otherwise, an error is reported, and the error processing procedure is entered.
[0165] In other words, the above-mentioned check of the tag is carried out on each coming byte under the length constraint, and therefore each byte is detected.
[0166] In this way, the scheme in the embodiment of the application not only depends on the pre-declared length information, but also checks the type identifier of each data unit in real time, and through the double verification of "declaration length" and "real-time identification", the boundary of the data segment is accurately determined, and the transmission error caused by data loss, redundancy or misplacement is detected.
[0167] In some embodiments, in any data segment, through the verification, it is found that the type identifier does not match, or at the boundary of adjacent data segments, it is determined that the type identifier of the adjacent data segment is not correctly switched, then it is determined that the verification fails, and an error processing mechanism is triggered.
[0168] The error processing mechanism includes at least one of the following operations: discarding the received data, reporting an error to the upper layer, and terminating the current receiving process.
[0169] By using multiple error handling mechanisms, abnormal processes can be better handled, and communication between the media access control layer and the physical layer can be more orderly.
[0170] In some embodiments, when the check method is applied to a WiFi system on chip, before receiving a data packet, the method further comprises: in response to receiving a start request signal from the media access control layer and replying to a start response signal in response to the start request signal, the physical layer performs a transmission operation of a data segment.
[0171] For example, referring to Figure 4 When data needs to be received, the media access control layer initiates a start request signal RX_start_req under the control of the media management engine to control the physical layer to start receiving functions and prepare to receive data. Once the physical layer receives data and prepares to transmit it to the media access control layer, it replies to a start response signal RX_start_rsp and starts transmitting data to the media access control layer.
[0172] In this way, the physical layer and the media access control layer can establish a channel to better transmit data.
[0173] In this way, using the scheme in the above example, when the media access control layer checks the boundary or checks an error, it can take effective extraction actions or interception actions, thereby ensuring the effectiveness and correctness of data in the key path between the media access control layer-physical layer interface.
[0174] For better understanding and illustration, an example is described in detail below.
[0175] In the embodiments of the present application, the data transmission interface structure is set to 128 (deep) 10bit (wide) first-in-first-out queue, so that field information and type identification can be stored at the same time. Among them, 01 represents RXV1, 10 represents MPDU, and 11 represents RXV2.
[0176] If the length given in RXV1 is incorrect, the tag of the last read value according to this length must be wrong. By length + tag information carried by each field information, the validity of the data segment can be accurately delimited and judged.
[0177] The data order agreed by PHY-MAC is RXV1 (01 tag) - mpdu (10 tag) - RXV2 (11 tag), wherein RXV1 carries the length of RXV1 itself and the length of the subsequent MDPU, and the length of RXV2 is fixed at 8 BYTES. The length plus the tag information of each element can detect the error of the length.
[0178] For example, the physical layer claims to give 100 bytes, but actually only 99 bytes are given, and then RXV2 comes, when the media access control layer reads the 100th byte, the tag of the 100th byte obtained is 11, which is contradictory to the expectation of 10 at this time, and thus an error is detected.
[0179] For another example, if the physical layer claims to give 100 bytes, but actually 101 bytes are given, and then RXV2 comes, when the media access control layer reads the 101th byte, it obtains 10, which is contradictory to the expectation of 11 at this time.
[0180] In other words, the media access control layer uses the tag[1:0]=01 of the first byte to strengthen the condition of starting to receive RXV1 when starting to receive RXV1, and defines the boundary between RXV1 and MPDU by whether the length and the tag[1:0] of the received byte are equal to 10.
[0181] When the media access control layer checks the boundary or detects an error, it can take effective extraction actions or interception actions, thereby guaranteeing the effectiveness and correctness of the data in the critical path.
[0182] The embodiment of the application also provides a data interaction system, which can execute the scheme in the foregoing examples to perform a verification operation in a data transmission process.
[0183] Referring to Figure 3 As shown in the structural schematic diagram of a data interaction system in the embodiment of the application, the data interaction system 300 can include: Figure 3
[0184] The physical layer 310 is configured to convert a received data packet into a data stream, divide the data stream into at least two continuous data segments according to a content attribute of the data stream, and configure a type identifier for each field information in each data segment when transmitting the at least two continuous data segments; wherein the content attribute includes field information and length information corresponding to the field information, and the type identifiers of different data segments are different;
[0185] The data transmission interface structure 320 is connected with the physical layer 310 and is configured to store the field information and the type identifier in each data segment in a preset format;
[0186] The media access control layer 330, connected with the data transmission interface structure 320, is configured to sequentially read the stored field information from the data transmission interface structure according to the order in which each field information is stored, and perform verification according to the preset length information, the actual length information of the read field information, and the type identifier. If the verification is correct, the stored field information is continuously read.
[0187] More details about the physical layer 310, the data transmission interface structure 320, and the media access control layer 330 can be found in the foregoing examples.
[0188] More specifically, the physical layer 310 divides the data stream into at least two continuous data segments (e.g., control information segment, payload data segment, etc.) according to the content attributes of the data stream before transmitting the data stream. During transmission, a corresponding type identifier (tag) is attached to the data unit (e.g., byte or word) constituting each data segment, and stored in the data transmission interface structure 320.
[0189] The bit width of the data transmission interface structure 320 is expanded to include additional bits for carrying type identifiers (tags) in addition to the bits for carrying valid data (Data). This allows the data and its attribute identifiers to be transmitted at the physical layer.
[0190] When the media access control layer 330 reads data from the data transmission interface structure 320, it not only checks the length information declared in advance, but also checks the type identifier of each data unit in real time. Through the double verification of "declared length" and "real-time identifier", the boundary of the data segment is accurately determined, and transmission errors caused by data loss, redundancy or misplacement are detected.
[0191] Specifically, the media access control layer 330 is configured to read the expected length information of the subsequent data segment from the initial data segment of the data stream. During the data reading process, the type identifier attached to the current received data unit is continuously compared with the expected type identifier of the current data segment. When the count of received data units reaches the expected length, the correctness of the segment boundary is confirmed by checking whether the type identifier of the next data unit is switched to the expected identifier of the next data segment. If a type identifier mismatch is found within a segment, or the identifier is not correctly switched at the segment boundary, it is determined that a transmission error has occurred, and the corresponding error handling mechanism (e.g., discarding the data frame, reporting the error to the upper layer, etc.) is triggered.
[0192] For more details, please refer to Figure 4 When data needs to be received, the media access control layer initiates an RX_start_req request signal under the control of the media management engine to control the physical layer to start receiving data.
[0193] Once the physical layer receives the data and prepares to transmit it to the media access control layer, the physical layer will respond with RX_start_rsp and start transmitting data to the media access control layer.
[0194] The RX-data is transmitted through a data transmission interface structure (i.e., mpi-fifo) between the media access control layer and the physical layer. Referring to Figure 2 , the data transmission interface structure is 128 (deep) 8 bits (wide).
[0195] In the actual interaction process, each data exchange between the media access control layer and the physical layer is composed of three data stages, RXV1 stage, MPDU stage and RXV2 stage. The RXV1 stage carries the length information of RXV1 itself and the subsequent MPDU length information provided by the physical layer; the MPDU stage is the 802.11 protocol data transmission stage; and the RXV2 stage is the RF information data block stage following the MPDU stage.
[0196] In addition, the RXV1 stage carries not only the MPDU length information, but also important physical layer parameters such as bandwidth used in the data transmission, physical layer working mode, actual transmission rate, etc.
[0197] When the media access control layer senses the end of the current transmission, it will pull down RX_done to turn off PHY-rx and end the current data exchange, in order to prepare for the next time.
[0198] The conditions it senses are: 1) the media access control layer receives the data claimed by the physical layer and ends normally, 2) the media access control layer receives the error indication given by the physical layer, such as detecting the arrival of PHY_err signal, giving rx_done and doing error processing, 3) the media access control layer receives the data, but the FCS detection error and other arbitrary errors, such as the full load of the storage unit behind the media access control layer, giving RX_done, and then performing error processing.
[0199] In the embodiments of the present application, the boundaries of the data segments are accurately determined through the dual verification of "claimed length" and "real-time identification", and transmission errors caused by data loss, redundancy or misplacement are detected.
[0200] The present application also provides a WiFi system on chip, which can include the data interaction system in the foregoing examples.
[0201] It should be noted that, although several modules or units of the devices for action execution are mentioned in the above detailed description, such division is not mandatory. Indeed, according to an embodiment of the application, the features and functionalities of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functionalities of one module or unit described above can be further divided into a plurality of modules or units.
[0202] While the preferred embodiments of the application have been described above, it will be recognized and understood that various modifications and changes can be made to these embodiments by those skilled in the art without departing from the spirit and scope of the application. Accordingly, it is intended that the appended claims be construed as including all such modifications and changes as fall within the scope of the application.
[0203] It is apparent that a person skilled in the art can make several changes and variants to the application without departing from the scope of the application. Thus, the application is intended to embrace all such changes and variants that fall within the scope of the application, as defined by the claims and their equivalents.
Claims
1. A method for checking data interaction, characterized in that, The method comprises: converting the received data packet into a data stream, and dividing the data stream into at least two continuous data segments according to the content attribute of the data stream, the content attribute comprising field information and length information corresponding to the field information; configuring a type identifier for each field information in each of the at least two continuous data segments when transmitting the at least two continuous data segments, so that the field information and the type identifier in each of the at least two continuous data segments are sequentially stored in a preset format, and the type identifiers of different data segments are different; sequentially reading the stored field information according to the order in which each field information is stored, and performing verification according to the preset length information, the actual length information of the read field information, and the type identifier, and continuing to read the stored field information when the verification is correct.
2. The data interaction verification method of claim 1, wherein, The method comprises: demodulating the physical frame header of the data packet, and generating a first data segment according to the first length information carried by the physical frame header and the metadata field information indicated by the first length information; when the first data segment is correctly verified, continuing to demodulate the data packet, and generating a media access control protocol data unit according to the second length information carried by the physical frame header and the payload field information indicated by the second length information; the second length information is carried in the field information of the first data segment; when the media access control protocol data unit is correctly verified, generating a second data segment according to the third length information carried by the physical frame header and the radio frequency information field information indicated by the third length information.
3. The data interaction verification method of claim 2, wherein, One or more of the following are met: each of the data segments is stored in a data transmission interface structure, the data transmission interface comprising a first-in-first-out queue composed of a plurality of basic data units, each of the basic data units having a first type bit and a second type bit, one of the first type bit and the second type bit being used to store field information, and the other being used to store a type identifier; each of the first type bits has 8 bits, and each of the second type bits has 2 bits; the data transmission interface structure is a first-in-first-out queue with a depth of 128 and a width of 10 bits; the payload field information indicated by the second length information can be zero; the type identifier corresponding to the first data segment comprises 2’b01; the type identifier corresponding to the media access control protocol data unit comprises 2’b10; the type identifier corresponding to the second data segment comprises 2’b11.
4. The method of claim 1, wherein, The verification according to the preset length information, the actual length information of the read field information, and the type identifier, and the continuation of reading the stored field information when the verification is correct, comprises: In reading the stored field information of the current data segment, the actual type identifier of the field information is read one by one, compared with the type identifier configured for the current data segment, and when it is determined that the type identifier in the preset length information is the same as the actual type identifier in the actual length information, the correctness of the adjacent data segment boundary is confirmed by checking whether the actual type identifier of the next field information is switched to the configured type identifier of the next data segment, and when it is determined that the configured type identifier of the next data segment, the field information of the next data segment stored is read in turn, and the verification is carried out.
5. The data interaction verification method of claim 4, wherein, The at least two continuous data segments include three continuous data segments, and when the current data segment is a first data segment, the preset length information of the data segment adjacent to the first data segment is determined through the field information carried by the first data segment.
6. The data interaction verification method of claim 5, wherein, In response to correctly verifying the field information of the first data segment, when reading the field information of the data segment adjacent to the first data segment, the temporary counter is continuously added by 1 every time the field information is correctly read, and when it is determined that the count value of the temporary counter is less than the preset length information of the adjacent data segment, it is determined that the actual type identifier of the field information is the same as the configured type identifier; and when it is determined that the count value of the temporary counter is the preset length information plus 1, and it is determined that the count value of the temporary counter is less than the preset length information of the adjacent data segment, it is determined that the actual type identifier of the field information is the same as the configured type identifier; and when it is determined that the count value of the temporary counter is the preset length information plus 1, it is determined that the last data segment is a second data segment, and when the read type identifier is verified to correspond to the second data segment, the field information of the second data segment is processed continuously.
7. The data interaction verification method of claim 1, wherein, In any data segment, through verification, it is found that the type identifier does not match, or at the boundary of the adjacent data segment, it is determined that the type identifier of the adjacent data segment is not correctly switched, then it is determined that the verification fails, and an error handling mechanism is triggered; The error handling mechanism includes at least one of discarding the received data, reporting an error to an upper layer, and terminating the current receiving process.
8. The method of claim 1, wherein, The verification method is applied to a media access control layer and a physical layer in a WiFi system on chip, and the media access control layer and the physical layer are connected through a data transmission interface structure; The received data packet further includes: in response to receiving a start request signal from the media access control layer, and in response to the start request signal, the physical layer performs a transmission operation of a data segment.
9. A data interaction system, characterized by Comprise: The physical layer is configured to convert the received data packet into a data stream, divide the data stream into at least two continuous data segments according to the content attribute of the data stream, and configure a type identifier for each field information in each data segment during transmission of the at least two continuous data segments; wherein the content attribute includes field information and length information corresponding to the field information, and the type identifiers of different data segments are different; a data transmission interface structure, connected with the physical layer, configured to store field information and type identification in each data segment in a preset format; a media access control layer, connected with the data transmission interface structure, configured to sequentially read the stored field information from the data transmission interface structure according to the order in which each field information is stored, and perform verification according to preset length information, actual length information of the read field information, and the type identification, and continue to read the stored field information when the verification is correct.
10. A WiFi system-on-a-chip, comprising: The data interaction system according to claim 9. The data interaction system according to claim 9.
Citation Information
Patent Citations
Methods and apparatus for communicating high efficiency control information
CN107667497A
Data analysis and verification method and device
CN110727691A