A data analysis method and device and a storage medium

By parsing the physical and MAC layers of data packets, the problem of excessively long data packet parsing time is solved, achieving fast and efficient data parsing and directly obtaining target data information.

CN116192992BActive Publication Date: 2026-06-05BEIJING XIAOMI MOBILE SOFTWARE CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING XIAOMI MOBILE SOFTWARE CO LTD
Filing Date
2022-12-13
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing technologies take too long to parse data packets, making it difficult to achieve fast and efficient data parsing.

Method used

By parsing the physical and MAC layers of data packets, the data packet format and MAC layer information can be determined, allowing direct acquisition of target data information and avoiding complete parsing of each layer of the data packet.

Benefits of technology

It shortens data parsing time, improves parsing efficiency, and enables rapid acquisition of target data information without manual calculation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116192992B_ABST
    Figure CN116192992B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a data analysis method and device and a storage medium, and belongs to the technical field of data analysis. The method is used for improving the analysis time of data analysis. The method comprises the following steps: obtaining a data packet to be analyzed; analyzing the physical layer of the data packet to be analyzed to determine the data packet format of the data packet to be analyzed; if it is determined that the data packet format obtained by analysis is a target data packet format, analyzing the MAC layer of the data packet to be analyzed to obtain MAC layer information included in the data packet to be analyzed; and determining target data information included in the data packet to be analyzed based on the MAC layer information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of data parsing technology, and in particular to a data parsing method, apparatus and storage medium. Background Technology

[0002] With the development of the internet and the widespread use of computers, the number of internet users has grown rapidly, and online behavior has gradually become one of the most important social phenomena in human behavior. A deeper understanding and analysis of internet user behavior brings great convenience to users.

[0003] Due to the wide variety of data packets and their varying data storage patterns, accurate data parsing and extraction are difficult. Current technologies typically parse each data packet completely, resulting in excessively long parsing times. Therefore, finding a fast way to parse data packets has become a pressing issue. Summary of the Invention

[0004] To overcome the problems existing in related technologies, this disclosure provides a data parsing method, apparatus and storage medium.

[0005] According to a first aspect of the present disclosure, a data parsing method is provided, comprising: acquiring a data packet to be parsed;

[0006] The physical layer of the data packet to be parsed is parsed to determine the data packet format of the data packet to be parsed;

[0007] If it is determined that the parsed data packet format is the target data packet format, then the MAC layer of the data packet to be parsed is parsed to obtain the MAC layer information included in the data to be parsed;

[0008] Based on the MAC layer information, the target data information included in the data packet to be parsed is determined.

[0009] In one embodiment, the MAC layer information includes at least the data packet type.

[0010] In one implementation, determining the target data information included in the data packet to be parsed based on the MAC layer information includes:

[0011] If the source address in the MAC information matches a preset source address, and the destination address in the MAC information matches a preset destination address, then the data packet type of the data packet to be parsed is determined.

[0012] If the data packet type is a preset data packet type, then the key information of the data packet to be parsed is obtained, and the key information includes the data information encapsulated in the data packet to be parsed;

[0013] Based on the aforementioned key information, the target data information included in the data packet to be parsed is determined.

[0014] In one embodiment, the key information includes at least the transmission type of the data packet to be parsed, and the transmission type includes retransmission type and non-retransmission type;

[0015] There is a correspondence between the data packets to be parsed of different transmission types and the target data information, and / or, there is a correspondence between the different frame information of the data packets to be parsed of the same transmission type and the target data information. The frame information of the data packets to be parsed is used to indicate the function of the data frames included in the data packets to be parsed.

[0016] In one implementation, determining the target data information included in the data packet to be parsed based on the key information includes:

[0017] Based on the key information, the transmission type of the data to be parsed is determined;

[0018] Based on the transmission type of the data to be parsed, determine the target correspondence triggered by the transmission type of the data to be parsed;

[0019] Based on the target correspondence, the target data information included in the data packet to be parsed is determined.

[0020] In one embodiment, the method further includes: when the data packet to be parsed satisfies a preset rule, obtaining a new data packet to be parsed;

[0021] The preset rules include at least one of the following:

[0022] The data format of the data packet to be parsed does not belong to the target data packet format;

[0023] The source address of the data packet to be parsed does not match the preset source address, and / or the destination address does not match the preset destination address;

[0024] The data packet type to be parsed does not belong to the preset data packet type.

[0025] In one embodiment, the method further includes: outputting the target data information in a visual form.

[0026] According to a second aspect of the present disclosure, a data parsing apparatus is provided, comprising: an acquisition module, configured to acquire a data packet to be parsed;

[0027] The parsing module is used to parse the physical layer of the data packet to be parsed in order to determine the data packet format of the data packet to be parsed; if it is determined that the parsed data packet format is the target data packet format, then the MAC layer of the data packet to be parsed is parsed to obtain the MAC layer information included in the data to be parsed; based on the MAC layer information, the target data information included in the data packet to be parsed is determined.

[0028] In one embodiment, the MAC layer information includes at least the data packet type.

[0029] In one embodiment, the parsing module is configured to: determine the data packet type of the data packet to be parsed if the source address in the MAC information matches a preset source address and the destination address in the MAC information matches a preset destination address; if the data packet type is a preset data packet type, obtain key information of the data packet to be parsed, the key information including data information encapsulated in the data packet to be parsed; and determine the target data information included in the data packet to be parsed based on the key information.

[0030] In one embodiment, the key information includes at least the transmission type of the data packet to be parsed, and the transmission type includes retransmission type and non-retransmission type;

[0031] There is a correspondence between the data packets to be parsed of different transmission types and the target data information, and / or, there is a correspondence between the different frame information of the data packets to be parsed of the same transmission type and the target data information. The frame information of the data packets to be parsed is used to indicate the function of the data frames included in the data packets to be parsed.

[0032] In one embodiment, the parsing module is configured to: determine the transmission type of the data to be parsed based on the key information; determine the target correspondence triggered by the transmission type of the data to be parsed based on the transmission type of the data to be parsed; and determine the target data information included in the data packet to be parsed based on the target correspondence.

[0033] In one embodiment, the acquisition module is used to acquire a new data packet to be parsed when the data packet to be parsed meets a preset rule;

[0034] The preset rules include at least one of the following:

[0035] The data format of the data packet to be parsed does not belong to the target data packet format;

[0036] The source address of the data packet to be parsed does not match the preset source address, and / or the destination address does not match the preset destination address;

[0037] The data packet type to be parsed does not belong to the preset data packet type.

[0038] In one embodiment, the device further includes:

[0039] The output module is used to output the target data information in a visual form.

[0040] According to a third aspect of the present disclosure, a data parsing apparatus is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute the data parsing method as described in the first aspect and its embodiments above.

[0041] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, which, when instructions in the storage medium are executed by a processor of a terminal, enables the terminal to perform the data parsing method as described in the first aspect and its embodiments above.

[0042] The technical solutions provided by the embodiments of this disclosure can include the following beneficial effects: After obtaining the data packet to be parsed, the physical layer of the data packet to be parsed is parsed to determine the data packet format. If the parsed data packet format is determined to be the target data packet format, the MAC layer of the data packet to be parsed is parsed to obtain the MAC layer information included in the data to be parsed, and then the target data information included in the data packet to be parsed is determined based on the MAC layer information. It can be seen that the technical solution provided by this disclosure, by parsing the physical layer and MAC layer of the data packet, eliminates the need for complete parsing of each layer of the data packet, thus shortening the data parsing time. Furthermore, the technical solution provided by this disclosure can directly obtain the target data information included in the data packet to be parsed based on the MAC layer information, eliminating the need for manual calculation of the MAC layer information and improving the parsing efficiency.

[0043] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0044] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0045] Figure 1 This is a flowchart illustrating a data parsing method in a related art according to an exemplary embodiment.

[0046] Figure 2 This is a flowchart illustrating a data parsing method according to an exemplary embodiment.

[0047] Figure 3 This is a flowchart illustrating a data parsing method according to an exemplary embodiment.

[0048] Figure 4 This is a flowchart illustrating a data parsing method according to an exemplary embodiment.

[0049] Figure 5 This is a flowchart illustrating a data parsing method according to an exemplary embodiment.

[0050] Figure 6 This is a schematic diagram illustrating a scenario of target data information according to an exemplary embodiment.

[0051] Figure 7 This is a flowchart illustrating a data parsing method according to an exemplary embodiment.

[0052] Figure 8 This is a block diagram illustrating a data parsing apparatus according to an exemplary embodiment.

[0053] Figure 9 This is a block diagram illustrating a data parsing apparatus according to an exemplary embodiment. Detailed Implementation

[0054] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure.

[0055] In the accompanying drawings, the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The described embodiments are some, but not all, of the embodiments of this disclosure. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this disclosure, and should not be construed as limiting this disclosure. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without inventive effort are within the scope of protection of this disclosure. The embodiments of this disclosure will be described in detail below with reference to the accompanying drawings.

[0056] As described in the background section, due to the wide variety of data packets and the different data storage patterns of different types of data packets, it is difficult to achieve accurate data parsing and extraction. Related technologies typically parse each data packet completely, resulting in excessively long parsing times.

[0057] like Figure 1 As shown, Figure 1This is a flowchart illustrating a data parsing method in a related art, as shown in an exemplary embodiment. The specific parsing process is as follows: The physical layer of the data packet is parsed to determine whether the data packet format belongs to the target data packet format (e.g., IEEE 80211 format). If the data packet belongs to the target data packet format, the data link layer of the data packet is completely parsed to obtain Media Access Control Address (MAC) information and determine whether a network layer header is included. If a network layer header is included, the Internet Protocol (IP) and Address Resolution Protocol (ARP) information in the network layer of the data packet is completely parsed, and data validity is verified to determine whether a transport layer header is included. After determining that a transport layer header is included, the Transmission Control Protocol (TCP) and User Datagram Protocol (UDP) information in the network layer is completely parsed, and data validity is verified. The data packet parsing ends.

[0058] It is evident that while related technologies can fully present all the information contained in a data packet during parsing, they cannot perform calculations on that information, thus failing to extract specific data. Specific data requires manual calculation based on the parsed information, resulting in extremely low parsing efficiency. Furthermore, because these technologies perform complete parsing of each layer of the data packet, the overall parsing time is excessively long.

[0059] Based on this, embodiments of this disclosure provide a data parsing method that eliminates the need to parse every layer of the data packet. By parsing the physical layer and the MAC layer in the data link layer, the parsing time is reduced. Furthermore, the target data information can be obtained based on the parsed MAC information without manual calculation, thus improving the parsing efficiency of the data packet.

[0060] Figure 2 This is a flowchart illustrating a data parsing method according to an exemplary embodiment, such as... Figure 2 As shown, it includes the following steps.

[0061] In step S11, the data packet to be parsed is obtained.

[0062] The data packets to be parsed differ depending on the parsing scenario.

[0063] For example, in a scenario where the parsing needs to obtain the activation or sleep data of a wireless device, the data packet to be parsed should be a data packet that includes at least the activation or sleep data of the wireless device.

[0064] For example, if the parsing scenario is one that needs to measure the current space-time transmission performance of a wireless device, the data packet to be parsed should include at least the frame length, transmission rate, retransmission time, number of retransmissions, and retransmission rate of the wireless device when transmitting data frames.

[0065] In step S12, the physical layer of the data packet to be parsed is parsed to determine the data packet format.

[0066] The data packet format to be parsed can be an empty data packet format, a wired data packet format, or other data packet formats.

[0067] Among them, the space-time data packet format represents wireless data packets transmitted wirelessly, while the wired data packet format represents data packets transmitted in a data cable.

[0068] In one implementation, the physical layer of the data packet to be parsed is parsed to obtain the header of the data packet to be parsed, and the data packet format of the data packet to be parsed is determined based on the header of the data packet to be parsed.

[0069] For example, if the header of the data packet to be parsed is an IEEE 80211 message, then the data packet format of the data packet to be parsed is determined to be empty data.

[0070] In step S13, if it is determined that the parsed data packet format is the target data packet format, then the MAC layer of the data packet to be parsed is parsed to obtain the MAC layer information included in the data to be parsed.

[0071] The MAC layer is a sublayer of the data link layer. In this embodiment of the disclosure, the MAC layer is mainly parsed when parsing the data link layer.

[0072] In one implementation, the target data packet format can be either an empty time data packet format or a wired data packet format.

[0073] In step S14, the target data information included in the data packet to be parsed is determined based on the MAC layer information.

[0074] The target data information differs depending on the parsing scenario. The target data information can be manually specified, and even within the same application scenario, the target data information can vary.

[0075] For example, if the application scenario is that the first device instructs the second device to enter a sleep state or an active state, then the target data information shall include at least one of the following: the planned activation time of the second device, the planned sleep time, the actual activation time, the actual sleep time, the actual activation time, the actual sleep time, etc.

[0076] In this embodiment, by parsing the physical layer and MAC layer of the data packet, it is not necessary to perform complete parsing of each layer of the data packet, thus shortening the data parsing time. Furthermore, the technical solution provided in this disclosure can obtain the target data information included in the data packet to be parsed based on the MAC layer information, eliminating the need for manual calculation of the MAC layer information and improving the parsing efficiency.

[0077] In some embodiments, the MAC layer information includes at least the packet type.

[0078] In one implementation, the data packet type is determined based on the frame type within the data packet.

[0079] For example, if the frame type of the data packet is a NullData frame, then the data packet type is NullData.

[0080] In other embodiments, the MAC layer information may also include the source address and the destination address.

[0081] Wherein, the source address is the address of the sender of the data packet to be parsed, and the destination address is the address of the receiver of the data packet to be parsed.

[0082] In one implementation, if the MAC information includes packet type, source address, and destination address, step S13 can be specifically implemented as steps S21-S23, such as... Figure 3 As shown:

[0083] In step S21, if the source address in the MAC information matches the preset source address and the destination address in the MAC information matches the preset destination address, then the data packet type of the data packet to be parsed is determined.

[0084] Specifically, by determining whether the source address matches the preset source address, it can be determined whether the sender of the data packet to be parsed is the sender of the preset source address; by determining whether the destination address matches the preset destination address, it can be determined whether the receiver of the data packet to be parsed is the receiver of the preset destination address, thereby determining whether the data packet to be parsed is a data packet capable of obtaining target data information.

[0085] In step S22, if the data packet type is a preset data packet type, then the key information of the data packet to be parsed is obtained.

[0086] Among them, the preset data packet type is determined based on the target data information that needs to be obtained.

[0087] For example, if the target data information to be obtained is the activation data or sleep data of a wireless device, since the frame type for sending activation data or sleep data in actual application scenarios is a NullData frame, the default data packet type is NullData.

[0088] The key information includes the data encapsulated in the data packet to be parsed.

[0089] For example, the data information encapsulated in the data packet to be parsed includes information such as the transmission time, retransmission information, frame length, and transmission rate of the message carried in the data packet to be parsed.

[0090] It should be understood that the key information obtained from the data packet to be parsed differs depending on the data packet type. In step S23, based on the key information, the target data information included in the data packet to be parsed is determined.

[0091] In this embodiment of the disclosure, since the same transmission frequency band includes data packets to be parsed and other data packets, it is necessary to determine whether the source address matches the preset source address and whether the destination address matches the preset destination address in order to determine whether the data packet currently being parsed is the specified data packet to be parsed, so as to accurately parse the target data information.

[0092] In another implementation, if the MAC layer information includes the data packet type, step S13 can be specifically implemented as steps S31-S32, such as... Figure 4 As shown:

[0093] In step S31, if the data packet type is a preset data packet type, then the key information of the data packet to be parsed is obtained.

[0094] The key information includes the data encapsulated in the data packet to be parsed.

[0095] In step S32, the target data information included in the data packet to be parsed is determined based on the key information.

[0096] In this embodiment, it is not necessary to determine whether the source address matches a preset source address or whether the destination address matches a preset destination address. That is, it is not necessary to determine whether the currently parsed data packet is the specified data packet to be parsed. The subsequent parsing process is executed directly, without concern for whether the desired target data information can be parsed. Of course, the parsing efficiency of this embodiment is lower than that of the previous embodiment.

[0097] In some embodiments, the key information includes at least the transmission type of the data packet to be parsed, which includes retransmission type and non-retransmission type.

[0098] In one implementation, there is a correspondence between the data packets to be parsed of different transmission types and the target data information.

[0099] For example, when the target data information to be obtained is the activation time or sleep time of a wireless device, if the transmission type of the data packet to be parsed is retransmission, the corresponding target data information is the actual activation time or actual sleep time; if the transmission type of the data packet to be parsed is non-retransmission, the corresponding target data information is the planned sleep time, actual sleep time, planned activation time, or actual activation time of the previous cycle.

[0100] In another implementation, there is a correspondence between different frame information of the data packets to be parsed of the same transmission type and the target data information. The frame information of the data packets to be parsed is used to indicate the function of the data frames included in the data packets to be parsed.

[0101] For example, when the target data information to be obtained is the activation time or sleep time of a wireless device.

[0102] When the transmission type of the data packets to be parsed is non-retransmission, if the frame information of the data packet indicates that the function of the data frame included in the data packet is to instruct the wireless device to enter a sleep state, then the corresponding target data information is the actual sleep entry time. If the frame information of the data packet indicates that the function of the data frame included in the data packet is to instruct the wireless device to enter an active state, then the corresponding target data information is the actual activation entry time.

[0103] In this embodiment of the disclosure, there is a correspondence between the data packets to be parsed of different transmission types and the target data information. Therefore, the correspondence between the data packets to be parsed and the target data information is determined based on the transmission type of the data packets to be parsed, which enables more accurate acquisition of the target data information.

[0104] In some embodiments, step S14 may be specifically implemented as steps S41-S43, such as... Figure 5 As shown:

[0105] In step S41, the transmission type of the data to be parsed is determined based on the key information.

[0106] In step S42, the target correspondence triggered by the transmission type of the data to be parsed is determined based on the transmission type of the data to be parsed.

[0107] In step S43, the target data information included in the data packet to be parsed is determined based on the target correspondence.

[0108] In this embodiment of the disclosure, the correspondence between the data packet to be parsed and the target data information is determined by the transmission type of the data packet, thereby obtaining the target data information more accurately.

[0109] In some embodiments, when the data packet to be parsed meets a preset rule, a new data packet to be parsed is obtained;

[0110] The preset rules include at least one of the following:

[0111] The data format of the data packet to be parsed does not belong to the target data packet format;

[0112] The source address of the data packet to be parsed does not match the preset source address, and / or the destination address does not match the preset destination address;

[0113] The data packet type to be parsed does not belong to the preset data packet type.

[0114] In other embodiments, after the target data information of the data packet to be parsed has been obtained, a new data packet to be parsed is also obtained. In some embodiments, after obtaining the target data information, the target data information is output in a visual form for a more intuitive understanding.

[0115] To more clearly illustrate the data parsing method proposed in the embodiments of this disclosure, the data parsing method proposed in the embodiments of this disclosure will be described in more detail below in the form of exemplary embodiments.

[0116] In one exemplary embodiment, taking the first device instructing the second device to enter an active or dormant state as an example, the target data information includes the planned activation time of the second device, or the planned dormant time, or the actual activation time, or the actual dormant time, or the actual activation time, or the actual dormant time, etc.

[0117] like Figure 6As shown, the first device sends a NullData PS=0 message (data packet type is NullData, frame information is 0, frame information is manually set or device default; different frame information is used to indicate different states for the second device; in this embodiment, frame information 0 indicates the second device is in an active state, and frame information 1 indicates the second device is in an active state) to notify the second device to enter the active state. The time when the NullData PS=0 message is sent is the planned time for the second device to enter the active state. However, due to certain factors (such as data packet loss), the second device may not receive the NullData PS=0 message, resulting in a NullData PS=0 message retransmission event. The time of the last retransmission of the NullData PS=0 message in the current cycle is the actual time the second device enters the active state. The first device then sends a NullData PS=1 message to notify the second device to enter a sleep state. The time when the NullData PS=1 message is sent is the planned time for the second device to enter the sleep state. However, NullData PS=1 messages may be retransmitted. Therefore, the time of the last retransmission of a NullData PS=1 message in the current cycle is the actual time the second device enters sleep mode. The planned activation time of the second device is determined based on the time difference between the planned activation time and the planned sleep time. The actual activation time of the second device is determined based on the time difference between the actual activation time and the actual sleep time. The planned sleep time of the second device is determined based on the time difference between the planned sleep time and the planned activation time. The actual sleep time of the second device is determined based on the time difference between the actual sleep time and the actual activation time.

[0118] At this point, the data packet to be parsed consists of a message sent by the first device when instructing the second device to enter an active or dormant state. For example... Figure 7 As shown, the physical layer of the data packet to be parsed is analyzed. When it is determined that the data packet format is IEEE 80211, the MAC layer of the data packet is analyzed to obtain the source address, destination address, and data packet type. When it is determined that the data packet format is not IEEE 80211, the parsing of the currently parsed data packet is abandoned, and a new data packet to be parsed is obtained.

[0119] When the source address of the data packet to be parsed matches the preset source address and the destination address matches the preset destination address, it is determined whether the data packet type of the data packet to be parsed is a data packet type that includes NullData frames. If the data packet type of the data packet to be parsed is a data packet type that includes NullData frames, then key information such as the current timestamp and transmission type of the data packet to be parsed is recorded. When the source address of the data packet to be parsed does not match the preset source address and / or the destination address does not match the preset destination address and / or the data packet type of the data packet to be parsed does not belong to the data packet type that includes NullData frames, the parsing of the currently parsed data packet is abandoned, and a new data packet to be parsed is obtained.

[0120] The triggering correspondence is determined based on key information. If the data packet to be parsed includes the first NullDataPS=0 data frame, the determined target data information is the planned activation time and actual activation time of the previous cycle. If the data packet to be parsed includes a non-first NullDataPS=0 data frame, the determined target data information is the actual activation time, and the parsing of the data packet to be parsed ends. If the data packet to be parsed includes the first NullDataPS=1 data frame, the determined target data information is the planned sleep time and actual sleep time of the previous cycle. If the data packet to be parsed includes a non-first NullDataPS=1 data frame, the determined target data information is the actual sleep time, the parsing of the data packet to be parsed ends, and a new data packet to be parsed is obtained.

[0121] In another exemplary embodiment, taking a parsing scenario where it is necessary to measure the performance of a wireless device in transmitting data packets under the current space-time conditions as an example, the target data information includes: frame length: the frame length of the data packet; transmission rate: the transmission rate used by the data packet; timestamp: the transmission time of the data packet; sequence number: the sequence number of the data packet; session information: the transmission session identifier; retransmission calculation timing: retransmission calculation is triggered when two consecutive data packets with the same session identifier and the same sequence number are used; retransmission time: the current retransmission time of data packets with the same sequence number minus the transmission time of the first frame; number of retransmissions: the number of data packets with the same sequence number minus 1; retransmission rate: the transmission rate used by data packets with the same sequence number; retransmission space-time occupancy: the sum of the frame lengths of data packets with the same sequence number; total data length: the sum of the frame lengths of data packets with the same session identifier.

[0122] When parsing a data packet, the physical layer of the packet is parsed first. If the packet format is determined to be IEEE 80211, the MAC layer is parsed to obtain the source address, destination address, and packet type. If the packet format is determined to be different from IEEE 80211, the parsing of the currently parsed packet is abandoned, and a new packet is obtained.

[0123] When the source address of the data packet to be parsed matches the preset source address and the destination address matches the preset destination address, it is determined whether the data packet type of the data packet to be parsed is a data packet type that includes QoS Data frames. If the data packet type of the data packet to be parsed is a data packet type that includes QoS Data frames, then the current timestamp, session identifier, sequence number, transmission rate, and other key information of the data packet to be parsed are recorded. When the source address of the data packet to be parsed does not match the preset source address and / or the destination address does not match the preset destination address and / or the data packet type of the data packet to be parsed does not belong to the data packet type that includes QoS Data frames, the parsing of the currently parsed data packet is abandoned, and a new data packet to be parsed is obtained.

[0124] The key information determines the correspondence between the triggered and target data information. If the key information determines that the data packet to be parsed is a retransmission data packet, the determined target data information is the frame length of the data packet, transmission rate, timestamp, session identifier, current session identifier, retransmission time / retransmission rate / retransmission count, and retransmission time occupation of the current sequence number, and the parsing of the data packet to be parsed ends. If the key information determines that the data packet to be parsed is a non-retransmission data packet, the determined target data information is the frame length of the data packet and the total data length of the current session identifier, and the parsing of the data packet to be parsed ends.

[0125] As can be seen from the above exemplary embodiments, the data parsing method provided in this disclosure shortens the data parsing time by parsing the physical layer and MAC layer of the data packet, eliminating the need for complete parsing of each layer. Furthermore, the technical solution provided in this disclosure can directly obtain the target data information included in the data packet to be parsed based on the MAC layer information, without requiring manual calculation of the MAC layer information, thus improving the parsing efficiency.

[0126] Experiments have shown that the data parsing method provided in this disclosure is 300% more efficient than the data parsing methods in related technologies. Of course, the processor performance of different devices used to execute this data parsing method is different, and the parsing efficiency of the data parsing method provided in this disclosure will also vary.

[0127] Based on the same concept, embodiments of this disclosure also provide a data parsing apparatus.

[0128] It is understood that the data parsing apparatus provided in this disclosure includes hardware structures and / or software modules corresponding to each function in order to achieve the above-mentioned functions. In conjunction with the units and algorithm steps of the various examples disclosed in this disclosure, this disclosure can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the technical solutions of this disclosure.

[0129] Figure 8 This is a block diagram illustrating a data parsing apparatus according to an exemplary embodiment. (Refer to...) Figure 8 The device includes an acquisition module 101 and a parsing module 102.

[0130] The acquisition module 101 is configured to acquire data packets to be parsed;

[0131] The parsing module 102 is configured to parse the physical layer of the data packet to be parsed in order to determine the data packet format of the data packet to be parsed; if the parsed data packet format is determined to be the target data packet format, the MAC layer of the data packet to be parsed is parsed to obtain the MAC layer information included in the data to be parsed; based on the MAC layer information, the target data information included in the data packet to be parsed is determined.

[0132] In one implementation, the MAC layer information includes at least the data packet type.

[0133] In one embodiment, the parsing module 102 is configured to determine the data packet type of the data packet to be parsed if the source address in the MAC information matches a preset source address and the destination address in the MAC information matches a preset destination address; if the data packet type is a preset data packet type, then obtain key information of the data packet to be parsed, including the data information encapsulated in the data packet to be parsed; and based on the key information, determine the target data information included in the data packet to be parsed.

[0134] In one implementation, the key information includes at least the transmission type of the data packet to be parsed, and the transmission type includes retransmission type and non-retransmission type.

[0135] There is a correspondence between the data packets to be parsed of different transmission types and the target data information, and / or, there is a correspondence between the different frame information of the data packets to be parsed of the same transmission type and the target data information. The frame information of the data packets to be parsed is used to indicate the function of the data frames included in the data packets to be parsed.

[0136] In one embodiment, the parsing module 102 is configured to determine the transmission type of the data to be parsed based on key information; determine the target correspondence triggered by the transmission type of the data to be parsed based on the transmission type of the data to be parsed; and determine the target data information included in the parsed data packet based on the target correspondence.

[0137] In one embodiment, the acquisition module 101 is used to acquire a new data packet to be parsed when a preset rule is met;

[0138] The preset rules include at least one of the following:

[0139] The data format of the data packet to be parsed does not belong to the target data packet format;

[0140] The source address of the data packet to be parsed does not match the preset source address, and / or the destination address does not match the preset destination address;

[0141] The data packet type to be parsed does not belong to the preset data packet type.

[0142] In one embodiment, the device further includes an output module 103. The output module 103 is configured to output target data information in a visual form.

[0143] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0144] Figure 9 This is a block diagram illustrating an apparatus 200 for data parsing according to an exemplary embodiment. For example, apparatus 200 may be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.

[0145] Reference Figure 9 The device 200 may include one or more of the following components: processing component 202, memory 204, power component 206, multimedia component 208, audio component 210, input / output (I / O) interface 212, sensor component 214, and communication component 216.

[0146] Processing component 202 typically controls the overall operation of device 200, such as operations associated with display, telephone calls, data communication, camera operation, and recording. Processing component 202 may include one or more processors 220 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 202 may include one or more modules to facilitate interaction between processing component 202 and other components. For example, processing component 202 may include a multimedia module to facilitate interaction between multimedia component 208 and processing component 202.

[0147] Memory 204 is configured to store various types of data to support the operation of device 200. Examples of such data include instructions for any application or method operating on device 200, contact data, phonebook data, messages, pictures, videos, etc. Memory 204 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0148] The power supply component 206 provides power to the various components of the device 200. The power supply component 206 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power to the device 200.

[0149] Multimedia component 208 includes a screen that provides an output interface between the device 200 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 208 includes a front-facing camera and / or a rear-facing camera. When the device 200 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.

[0150] Audio component 210 is configured to output and / or input audio signals. For example, audio component 210 includes a microphone (MIC) configured to receive external audio signals when device 200 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 204 or transmitted via communication component 216. In some embodiments, audio component 210 also includes a speaker for outputting audio signals.

[0151] I / O interface 212 provides an interface between processing component 202 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.

[0152] Sensor assembly 214 includes one or more sensors for providing status assessments of various aspects of device 200. For example, sensor assembly 214 may detect the on / off state of device 200, the relative positioning of components such as the display and keypad of device 200, changes in the position of device 200 or a component of device 200, the presence or absence of user contact with device 200, the orientation or acceleration / deceleration of device 200, and temperature changes of device 200. Sensor assembly 214 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 214 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 214 may also include an accelerometer, a gyroscope, a magnetometer, a pressure sensor, or a temperature sensor.

[0153] Communication component 216 is configured to facilitate wired or wireless communication between device 200 and other devices. Device 200 can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, communication component 216 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 216 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0154] In an exemplary embodiment, the apparatus 200 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.

[0155] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 204 including instructions, which can be executed by a processor 220 of the device 200 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0156] It is understood that in this disclosure, "multiple" refers to two or more, and other quantifiers are similar. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. The singular forms "a," "the," and "the" are also intended to include the plural forms unless the context clearly indicates otherwise.

[0157] It is further understood that the terms "first," "second," etc., are used to describe various types of information, but this information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another, and do not indicate a specific order or degree of importance. In fact, the expressions "first," "second," etc., are completely interchangeable. For example, without departing from the scope of this disclosure, first information can also be referred to as second information, and similarly, second information can also be referred to as first information.

[0158] It can be further understood that, unless otherwise specified, "connection" includes both direct connections where no other components exist between the two parties and indirect connections where other components exist between them.

[0159] It is further understood that although operations are described in a specific order in the accompanying drawings in the embodiments of this disclosure, this should not be construed as requiring these operations to be performed in the specific order or serial order shown, or requiring all of the shown operations to be performed to obtain the desired result. In certain environments, multitasking and parallel processing may be advantageous.

[0160] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein.

[0161] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A data parsing method, characterized in that, The method includes: Obtain the data packet to be parsed; The physical layer of the data packet to be parsed is parsed to determine the data packet format of the data packet to be parsed; If it is determined that the format of the parsed data packet is the target data packet format, then the Media Access Control (MAC) layer of the data packet to be parsed is parsed to obtain the MAC layer information included in the data to be parsed. Based on the MAC layer information, the target data information included in the data packet to be parsed is determined; The step of determining the target data information included in the data packet to be parsed based on the MAC layer information includes: If the source address in the MAC layer information matches a preset source address, and the destination address in the MAC layer information matches a preset destination address, then the data packet type of the data packet to be parsed is determined. If the data packet type is a preset data packet type, then the key information of the data packet to be parsed is obtained, and the key information includes the data information encapsulated in the data packet to be parsed; Based on the aforementioned key information, the target data information included in the data packet to be parsed is determined.

2. The method according to claim 1, characterized in that, The MAC layer information includes at least the data packet type.

3. The method according to claim 1, characterized in that, The key information includes at least the transmission type of the data packet to be parsed, and the transmission type includes retransmission type and non-retransmission type; There is a correspondence between the data packets to be parsed of different transmission types and the target data information, and / or, there is a correspondence between the different frame information of the data packets to be parsed of the same transmission type and the target data information. The frame information of the data packets to be parsed is used to indicate the function of the data frames included in the data packets to be parsed.

4. The method according to claim 3, characterized in that, The step of determining the target data information included in the data packet to be parsed based on the key information includes: Based on the key information, the transmission type of the data to be parsed is determined; Based on the transmission type of the data to be parsed, determine the target correspondence triggered by the transmission type of the data to be parsed; Based on the target correspondence, the target data information included in the data packet to be parsed is determined.

5. The method according to any one of claims 1 to 4, characterized in that, The method further includes: When the data packet to be parsed meets the preset rules, the step of obtaining the data packet to be parsed is executed; The preset rules include at least one of the following: The data format of the data packet to be parsed does not belong to the target data packet format; The source address of the data packet to be parsed does not match the preset source address, and / or the destination address does not match the preset destination address; The data packet type to be parsed does not belong to the preset data packet type.

6. The method according to claim 1, characterized in that, The method further includes: The target data information is output in a visual form.

7. A data parsing device, characterized in that, The device includes: The acquisition module is used to acquire the data packet to be parsed; The parsing module is used to parse the physical layer of the data packet to be parsed in order to determine the data packet format of the data packet to be parsed; if it is determined that the parsed data packet format is the target data packet format, then the MAC layer of the data packet to be parsed is parsed to obtain the MAC layer information included in the data to be parsed; based on the MAC layer information, the target data information included in the data packet to be parsed is determined. Specifically, based on the MAC layer information, the target data information included in the data packet to be parsed is determined as follows: If the source address in the MAC layer information matches a preset source address, and the destination address in the MAC layer information matches a preset destination address, then the data packet type of the data packet to be parsed is determined; if the data packet type is a preset data packet type, then the key information of the data packet to be parsed is obtained, the key information including the data information encapsulated in the data packet to be parsed; based on the key information, the target data information included in the data packet to be parsed is determined.

8. The apparatus according to claim 7, characterized in that, The MAC layer information includes at least the data packet type.

9. The apparatus according to claim 7, characterized in that, The key information includes at least the transmission type of the data packet to be parsed, and the transmission type includes retransmission type and non-retransmission type; There is a correspondence between the data packets to be parsed of different transmission types and the target data information, and / or, there is a correspondence between the different frame information of the data packets to be parsed of the same transmission type and the target data information. The frame information of the data packets to be parsed is used to indicate the function of the data frames included in the data packets to be parsed.

10. The apparatus according to claim 9, characterized in that, The parsing module is used to determine the transmission type of the data to be parsed based on the key information; Based on the transmission type of the data to be parsed, determine the target correspondence triggered by the transmission type of the data to be parsed; Based on the target correspondence, the target data information included in the data packet to be parsed is determined.

11. The apparatus according to any one of claims 7 to 10, characterized in that, The acquisition module is used to acquire a new data packet to be parsed when the data packet to be parsed meets the preset rules; The preset rules include at least one of the following: The data format of the data packet to be parsed does not belong to the target data packet format; The source address of the data packet to be parsed does not match the preset source address, and / or the destination address does not match the preset destination address; The data packet type to be parsed does not belong to the preset data packet type.

12. A data parsing device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to execute the data parsing method as described in any one of claims 1-6.

13. A non-transitory computer-readable storage medium, characterized in that, When the instructions in the storage medium are executed by the terminal's processor, the terminal is able to perform the data parsing method as described in any one of claims 1-6.