Data decryption method and device, electronic equipment and storage medium

By directly extracting the target field from the original signal and using the mapping relationship for decryption in wireless short-range communication and acoustic near-field transmission, the problem of high computational load and power consumption in the existing technology is solved, and efficient data decryption is achieved.

CN123184931APending Publication Date: 2026-11-27LANGYUAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611414009.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-11
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

In wireless short-range communication and acoustic near-field transmission scenarios, the fields of the data frames in the existing MFSK short frame transmission scheme are encoded in a fixed order, which results in high computational load and power consumption and poor efficiency when the receiver decodes.

Method used

By responding to the target field decryption command, the target field is extracted from the original signal. Using the preset mapping relationship between the field and the transmission unit and frequency point, the position and frequency point index information of the target field are directly located, energy detection and demodulation processing are performed, a decryption key stream is generated and decryption is performed, avoiding frequency point processing of non-target fields.

Benefits of technology

It reduces the power consumption of the receiver, improves the data decryption efficiency, reduces the computational overhead caused by irrelevant fields, and enables independent decryption of the target field.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123184931A_ABST
    Figure CN123184931A_ABST
Patent Text Reader

Abstract

The present disclosure provides a data decryption method and device, electronic equipment and storage medium; wherein the method comprises: in response to a target field decryption instruction, extracting at least one target field from an original signal; determining the transmission unit position and frequency point index information corresponding to the target field according to the preset mapping relationship between the field and the transmission unit and the frequency point; performing energy detection and demodulation processing on the target frequency point indicated by the frequency point index information to recover the ciphertext data of the target field from the original signal; for each first field of the recovered ciphertext data in the target field, generating a decryption key stream of the first field according to the field identifier of the first field and / or the position offset information of the first field in the data frame; and decrypting the ciphertext data of the first field through the decryption key stream to obtain the plaintext data of the first field. The present disclosure can improve the efficiency of data decryption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] In short-range wireless communication and near-field acoustic transmission scenarios, Multiple Frequency Shift Keying (MFSK) modulation is widely used. The transmitting end maps the data to be transmitted to multiple frequency points for transmission, and the receiving end recovers the original data from each candidate frequency point. In existing MFSK short-frame transmission schemes, the fields of the data frame are encoded in a fixed order, and the position of each field in the data frame is predetermined. During decoding, the receiving end recovers the entire data frame completely before extracting the required data, resulting in high computational complexity and power consumption, and thus poor performance. Summary of the Invention

[0003] In view of this, the purpose of this disclosure is to provide a data decryption method, apparatus, electronic device, and storage medium to improve the efficiency of data decryption.

[0004] In a first aspect, embodiments of this disclosure provide a data decryption method, the method comprising: extracting at least one target field from an original signal in response to a target field decryption instruction; wherein the target field decryption instruction includes: field mask information for identifying the target field, the target field being carried by a data frame; determining the transmission unit location and frequency point index information corresponding to the target field according to a preset mapping relationship between fields, transmission units, and frequency points; performing energy detection and demodulation processing on the target frequency point indicated by the frequency point index information to recover the ciphertext data of the target field from the original signal; for each first field in the target field whose ciphertext data has been recovered, generating a decryption key stream for the first field according to the field identifier of the first field and / or the position offset information of the first field within the data frame; and decrypting the ciphertext data of the first field using the decryption key stream to obtain the plaintext data of the first field.

[0005] Secondly, embodiments of this disclosure provide a data decryption apparatus, comprising: a response module, configured to extract at least one target field from an original signal in response to a target field decryption instruction; wherein the target field decryption instruction includes: field mask information for identifying the target field, the target field being carried by a data frame; a determination module, configured to determine the transmission unit position and frequency point index information corresponding to the target field according to a preset mapping relationship between fields, transmission units, and frequency points; a recovery module, configured to perform energy detection and demodulation processing on the target frequency point indicated by the frequency point index information to recover the ciphertext data of the target field from the original signal; a generation module, configured to generate a decryption key stream for each first field of the recovered ciphertext data in the target field, based on the field identifier of the first field and / or the position offset information of the first field within the data frame; and a decryption module, configured to decrypt the ciphertext data of the first field using the decryption key stream to obtain the plaintext data of the first field.

[0006] Thirdly, embodiments of this disclosure provide an electronic device, including a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the aforementioned data decryption method.

[0007] Fourthly, embodiments of this disclosure provide a computer-readable storage medium storing computer-executable instructions. When the computer-executable instructions are invoked and executed by a processor, the computer-executable instructions cause the processor to implement the aforementioned data decryption method.

[0008] The embodiments disclosed herein bring the following beneficial effects: The aforementioned data decryption method, apparatus, electronic device, and storage medium determine the target field to be extracted based on the field mask information in the target field decryption instruction specified by the service layer. Based on the preset mapping relationship between fields, transmission units, and frequency points, the location of the transmission unit and the frequency point index information corresponding to the target field are directly located. This allows the receiving end to abandon the operation of energy detection and demodulation of non-target field frequency points and only process the target frequency point to recover the ciphertext data of the target field, thereby avoiding all computational overhead caused by irrelevant fields. At the same time, for each target field of the recovered ciphertext, a decryption key stream is independently generated and decrypted based on its field identifier and / or position offset information. This makes the decryption of each target field independent of each other, eliminating the need to sequentially decrypt from the beginning of the data frame to obtain the plaintext of the target field. This further eliminates the additional computation caused by the need to process non-target field ciphertext due to decryption order dependence. Thus, while ensuring the correct acquisition of the required data, the power consumption of the receiving end is reduced and the data decryption efficiency is improved.

[0009] Other features and advantages of this disclosure will be set forth in the following description and will be apparent in part from the description or may be learned by practicing the disclosure. The objects and other advantages of this disclosure are realized and obtained through the structures particularly pointed out in the description, claims and drawings.

[0010] To make the above-mentioned objects, features and advantages of this disclosure more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0011] To more clearly illustrate the technical solutions in the specific embodiments of this disclosure or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0012] Figure 1 This is a flowchart of one embodiment of the data decryption method in this disclosure; Figure 2 A schematic diagram of a data decryption device provided in an embodiment of this disclosure; Figure 3 This is a schematic diagram of an electronic device provided in an embodiment of the present disclosure. Detailed Implementation

[0013] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0014] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in this disclosure, claims, and accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” or “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0015] For ease of understanding, the specific process of the embodiments of this disclosure is described below. Please refer to [link / reference]. Figure 1 One embodiment of the data decryption method in this disclosure includes: Step S10: In response to the target field decryption instruction, extract at least one target field from the original signal; wherein, the target field decryption instruction includes: field mask information for identifying the target field, and the target field is carried by the data frame; The target field decryption command, initiated by the business layer or upper-layer application to the decoder, is a request command indicating the data field to be retrieved. The initiator of this command can be a business logic unit such as the device discovery module, network management module, or connection establishment module, and the transmission method can be inter-process communication, function call, message queue, or interface call. The target field decryption command can be triggered by user operations (such as clicking the screen mirroring button), changes in network status (such as establishing a WiFi connection), scheduled scanning tasks, or business logic judgments of upper-layer applications.

[0016] The target field decryption instruction includes field mask information to identify the target field. This field mask information identifies one or more target fields, indicating to the decoder the specific fields to be extracted in this decryption operation. The field mask information can be in the form of a bitmask, where each bit corresponds to a field in the data frame, and a set bit indicates that the corresponding field is a target field. Alternatively, the field mask information can be in the form of a list of field identifiers, directly listing the names or numbers of the fields to be extracted. The field mask information can also be other data structures such as sets, arrays, or bitmaps; specific limitations are not specified here.

[0017] The raw signal is the physical layer input signal that carries the data frame. The specific form of the raw signal can vary depending on the application scenario: in acoustic communication, the raw signal can be acoustic sampling data collected by a microphone; in radio frequency communication, the raw signal can be the baseband signal received by an antenna and converted from analog to digital; in wired communication, the raw signal can be the electrical signal received by the interface. The raw signal can be acquired in real-time or read from a cache or storage medium, depending on the device's receiving architecture and deployment requirements.

[0018] A data frame is a data structure organized according to a predetermined protocol format within the original signal. The format of a data frame can be a short frame format with fixed field order encoding (i.e., fields in the data frame are arranged at predetermined offset positions, allowing for field location without additional parsing), or an extended format containing a directory header or field block bitmap (i.e., the position of each field in the data frame is dynamically indicated by the directory header, requiring parsing of the directory header before field location). A data frame contains multiple fields, each carrying specific business data. In this embodiment, the target field is the portion of data content in the data frame that corresponds to the business requirement in terms of location.

[0019] When extracting at least one target field from a raw signal, the target field data can be directly located and obtained from the raw signal without first decoding the entire data frame and then filtering it. This extraction process utilizes the known relationship that the raw signal carries data frames and that the data frames contain the target field, obtaining it by directly locating the target field's position in the raw signal. The object extracted is the target field itself (i.e., specific field data), not the complete data frame. Specifically, extraction can be performed by directly reading based on a preset field position mapping, or by parsing the organizational structure of the data frame.

[0020] For example, on a smart TV with near-ultrasonic communication capabilities, the TV continuously broadcasts short frames containing device information via its speaker using multi-frequency MFSK modulation. These short frames are 15-byte v2 format data frames, with the casting code field located at byte offsets 2 to 5 and the IP address field located at byte offsets 6 to 9. When a user opens the casting application on their mobile phone and enters the device search interface, the phone's application layer (i.e., the business layer) sends a target field decryption command to the decoder. The field mask information in this command is a mask value (e.g., binary 0001) that only identifies the casting code field. After receiving this command, the decoder identifies the data frame boundary from the raw signal continuously collected by the microphone through frame synchronization detection. Then, according to the preset field position mapping relationship (the casting code is located in bytes 2 to 5), it directly reads the 4 bytes of data from the received data frame as the ciphertext data of the target field (this data is plaintext when the casting code is not encrypted), without needing to decode other fields such as the IP address and P2P digest besides the casting code. Once the phone receives the screen mirroring code, it will display the device in the device list for the user to select. At this time, the user only needs to preview the candidate devices and does not need to establish an actual connection.

[0021] In this embodiment, since the decoder only extracts the projection code field and does not process other fields, the computational load for energy detection and demodulation is significantly reduced, thereby reducing the phone's power consumption and accelerating device discovery response speed. In this scenario, the target field decryption command is triggered when the user clicks the search button, and the extraction method is direct reading based on a fixed field offset.

[0022] Step S20: Determine the transmission unit location and frequency index information corresponding to the target field according to the preset mapping relationship between the field and the transmission unit and frequency point; In this embodiment, the preset mapping relationship between fields, transmission units, and frequency points is a pre-established and stored rule used to associate each field in a data frame with its corresponding physical layer bearer resource. Specifically, the above mapping relationship includes: a first mapping relationship between fields and transmission units, a second mapping relationship between transmission units and frequency points, and a third mapping relationship between nibbles and frequency points. Here, a nibble is a data unit in a computer representing 4 binary bits, equivalent to half a byte, and can store a hexadecimal number (0-15).

[0023] A transmission unit is the basic physical unit carrying data in the original signal, and its specific form depends on the modulation method and communication protocol. In MFSK modulation, a transmission unit can be a set of frequency signals transmitted within one symbol period, used to carry a predetermined number of bytes of data. In other modulation methods (such as Orthogonal Frequency Division Multiplexing, OFDM), a transmission unit can be a time-frequency resource block, a subcarrier group, or a time slot. The initial mapping relationship between fields and transmission units can be calculated by dividing the field's byte offset in the data frame by the number of bytes carried by each transmission unit, or it can be achieved through a lookup table; the specific method is not limited here.

[0024] The second mapping between transmission units and frequency points indicates the specific frequency point location corresponding to each data bit or nibble within each transmission unit. In MFSK modulation, each byte is split into a low nibble and a high nibble, with each nibble mapped to a frequency group. Each frequency group contains multiple candidate frequency points, and each candidate frequency point corresponds to a possible nibble value. The frequency point index information indicates the specific location of the target frequency point within the overall frequency point set, enabling the decoder to accurately perform energy detection and demodulation on these frequency points in subsequent steps without traversing all frequency points. The frequency point index information can be a set of frequency point numbers or index parameters used to calculate the frequency point numbers.

[0025] The third mapping between nibble and frequency point indicates the candidate frequency point index corresponding to each nibble of data within its respective frequency group. Specifically, each frequency group contains 16 candidate frequency points, corresponding to 16 possible nibble values ​​(0 to 15). When a nibble needs to be recovered, the decoder selects the candidate frequency point with the highest energy from the 16 candidate frequency points in the frequency group to which the nibble belongs, based on energy decision. The index value of this candidate frequency point within the frequency group is the nibble data it carries. Therefore, the lower nibble frequency group index corresponding to the byte offset indicates the frequency group carrying the lower 4 bits of the byte, and the higher nibble frequency group index indicates the frequency group carrying the higher 4 bits of the byte.

[0026] When determining the transmission unit location and frequency index information corresponding to a target field based on the preset mapping relationship between fields, transmission units, and frequency points, the corresponding field's bearer location in the physical layer can be derived step by step from the field identifier of the target field, according to the preset mapping relationship. For a one-byte target field, first determine the transmission unit index (i.e., transmission unit location) based on the corresponding byte offset, then determine the lower nibble frequency group index and the higher nibble frequency group index based on the position of the byte offset within the transmission unit, and finally determine the specific frequency point index information based on the frequency group index. For multi-byte target fields, the above determination process is performed byte by byte, which will not be elaborated here.

[0027] Step S30: Perform energy detection and demodulation processing on the target frequency indicated by the frequency index information to recover the ciphertext data of the target field from the original signal; This step uses a decoder to perform signal detection and data recovery operations on specific frequency points carrying the target field in the original signal based on frequency index information. In this embodiment, energy detection specifically involves measuring and evaluating the signal strength or power of the target frequency point. In multi-frequency MFSK modulation, the transmitter carries data by sending signals at different frequency points, and the receiver needs to measure the energy of each candidate frequency point to determine the actual frequency point transmitted by the transmitter. Specifically, energy detection can be performed through frequency domain transformation (performing a fast Fourier transform or Goertzel algorithm on the time-domain sampled signal to obtain the spectral amplitude or power spectral density of each frequency point), filtering (using a bandpass filter bank to separate the signals at each frequency point and then measuring their energy), or time domain correlation (performing correlation operations between the received signal and the reference signals of each candidate frequency point to obtain the energy value), without specific limitations here. The result of energy detection is the energy value of each frequency point, which is used for subsequent frequency point selection decisions.

[0028] Demodulation involves recovering the data carried by a frequency from its energy detection results. The decoder selects the candidate frequency with the highest energy value within the same frequency group as the actual frequency used by the transmitter. Since each candidate frequency in a frequency group is pre-associated with a specific nibble value (in the case of 16 candidate frequencies, each candidate frequency corresponds to a value between 0 and 15), the index value of the selected frequency within the frequency group is the nibble data carried by that frequency group. After the lower and higher nibbles of the same byte are recovered from two different frequency groups, the lower nibble is combined as the lower 4 bits of the byte, and the higher nibble is combined as the higher 4 bits of the byte to recover the data of that byte. For multiple bytes, the above process is repeated and combined sequentially to recover the data of the entire target field.

[0029] In one implementation, energy detection and demodulation processing can be performed simultaneously or in stages, depending on the decoder's implementation architecture. When performed simultaneously, the energy detection results are directly used for frequency point determination in demodulation processing, and both are completed within the same processing flow. When performed in stages, energy detection for all target frequencies is completed first, and the energy values ​​are stored. Then, frequency point determination and data recovery are performed uniformly; the specifics are not limited here.

[0030] A target frequency point is a frequency point that carries the target field data. There can be one or more such frequency points, the specific number depending on the byte length of the target field and the number of bytes carried by each transmission unit. For example, one byte corresponds to two half-bytes, and each half-byte corresponds to a frequency point within a frequency group (this frequency point is one of 16 candidate frequency points). Therefore, a one-byte target field corresponds to two target frequency points. For multi-byte target fields, the number of target frequency points is twice the number of bytes. Each target frequency point may be located in a different frequency group or in a different candidate position within the same frequency group.

[0031] Step S40: For each first field of the recovered ciphertext data in the target field, generate a decryption key stream for the first field based on the field identifier of the first field and / or the position offset information of the first field within the data frame; This implementation generates a keystream for decryption based on field identifiers and / or position offset information using a predetermined key derivation algorithm. The keystream is a key sequence of the same length as the ciphertext data, used for byte-by-byte or bit-by-bit decryption. The generation method can be based on an extension of a pseudo-random function (i.e., generating a pseudo-random sequence of arbitrary length using a seed value), a keystream mode based on block ciphers (such as counter mode CTR), or key derivation based on a hash function.

[0032] Understandably, because different fields have different identifiers, and the position offset of the same field can differ in different data frames, the keystreams of different fields, as well as the keystreams of the same field across different data frames, can be independent of each other. This independence allows the keystream of each field to be generated independently during decryption without relying on other fields, thus enabling the ciphertext data of each field to be decrypted independently without relying on other fields.

[0033] Specifically, even within the same data frame, the field identifier of the projection code field differs from that of the IP address field. Therefore, the keystreams generated by the two fields will be different even under the same other conditions. It should be noted that when generating the keystream, only the field identifier, only the position offset information, or both can be used, depending on the design of the key derivation algorithm.

[0034] Position offset information indicates the position of a target field or its internal bytes within a data frame. Specifically, it can be the offset of the field's starting byte within the data frame, the offset of each byte within the field relative to the field's starting position, or the field's sequence number within the data frame. Even if the identifier for the same field is the same in different data frames, the position offsets of the field can be the same or different across data frames. Therefore, when position offset information is incorporated into keystream generation, the keystreams for the same field in different data frames will differ due to the varying overall positions of the data frames.

[0035] Step S50: Decrypt the ciphertext data of the first field using the decryption key stream to obtain the plaintext data of the first field.

[0036] This implementation method decrypts the recovered ciphertext data of the first field by decrypting the key stream to restore the original plaintext data. The plaintext data is the actual data content of the target field, which can be directly used by the business layer, such as the plaintext string of the screen projection code, the four-byte value of the IP address, or other business data, which are not limited here.

[0037] Encryption and decryption can be performed using symmetric key algorithms (i.e., encryption and decryption use the same or mutually derivable keys) or asymmetric key algorithms (i.e., encryption and decryption use different key pairs). In one application scenario, a symmetric key algorithm is used, where the sender and receiver share the same key K. The sender uses this key for encryption, and the receiver uses the decryption key stream derived from this key for decryption.

[0038] In this embodiment, the decryption of each first field depends only on the decryption key stream generated in the previous step corresponding to that field, and does not depend on the ciphertext data, plaintext data, or decryption status of any other field. Therefore, the decryption process of multiple first fields can be executed in any order or in parallel, and the decryption operation of any field does not need to wait for the decryption completion or decryption status information of other fields. This independence makes the decryption status of the ciphertext non-cumulative; the decryption result of the preceding ciphertext is not a prerequisite for the decryption of the subsequent ciphertext. The decryption of each field is self-contained; given the ciphertext data and decryption key stream of that field, decryption can be completed without any external state.

[0039] The decryption in this step can be either full decryption (i.e., performing decryption operations on all bytes of the ciphertext data) or partial decryption (i.e., performing decryption operations on only a portion of the ciphertext data). Full decryption is suitable for scenarios that require the complete field data, while partial decryption is suitable for scenarios that only require a specific portion of the field data.

[0040] The data decryption method provided in the above embodiments determines the target field to be extracted based on the field mask information in the target field decryption instruction specified by the service layer. Based on the preset mapping relationship between fields, transmission units, and frequency points, it directly locates the transmission unit position and frequency point index information corresponding to the target field. This allows the receiving end to abandon the operation of energy detection and demodulation of non-target field frequency points and only process the target frequency point to recover the ciphertext data of the target field, thereby avoiding all computational overhead caused by irrelevant fields. At the same time, for each target field of the recovered ciphertext, a decryption key stream is independently generated and decrypted based on its field identifier and / or position offset information. This makes the decryption of each target field independent of each other. It is not necessary to sequentially decrypt from the beginning of the data frame to obtain the plaintext of the target field. This further eliminates the extra computation caused by the need to process non-target field ciphertext due to decryption order dependence. Thus, while ensuring that the required data can be obtained correctly, the power consumption of the receiving end is reduced and the data decryption efficiency is improved.

[0041] Next, we will explain the specific decryption method for the data.

[0042] In one embodiment, the step of extracting at least one target field from an original signal in response to a target field decryption command includes: parsing a directory header of a data frame to be extracted from the original signal in response to the target field decryption command; wherein the directory header contains version information of the data frame and a field block bitmap, the field block bitmap being used to indicate the position of each field block in the data frame to be extracted; determining the data organization format of the data frame to be extracted based on the version information; if the data organization format is a first format, determining the position of the field block corresponding to each target field in the data frame to be extracted based on the field block bitmap; if the data organization format is a second format, determining the position of each target field in the data frame to be extracted based on a preset fixed field position index; and extracting the data frame and at least one target field carried by the data frame from the original signal based on the determined position.

[0043] In this embodiment, the directory header is a data structure located at the beginning of the data frame, used to indicate the organization of the data frame and the position information of each component. The decoder can determine the structure of the data frame by parsing the directory header. The directory header contains version information of the data frame (indicating the protocol specification used by the corresponding data frame) and a field block bitmap (indicating the position of each field block in the data frame). The existence of the directory header makes the organization of the data frame dynamic and flexible, because the sending end can record the actual position of each field block in the directory header without having to arrange them according to a fixed offset.

[0044] The version information in the header identifies the protocol version or format type that the data frame conforms to. This version information can be a version number (e.g., "v2", "v3") or a format type identifier (e.g., "fixed" for a fixed format, "extended" for an extended format). The version information indicates the data organization format of the data frame, enabling the decoder to select the correct parsing strategy. The format of a data frame may change as the protocol evolves; the version information allows the same decoder to handle multiple versions of the frame format.

[0045] A field block bitmap is used to indicate the location of each field block in a data frame. Specifically, it can take the form of a bitmap, where each bit corresponds to a field block, and the value of any bit indicates whether the corresponding field block exists in the data frame and its position offset. Alternatively, the field block bitmap can be in the form of an offset table, which records the starting offset and length of each field block in sequence. It can also be in the form of a field block descriptor list, where each field block is described by a field identifier, starting offset, and length. The field block bitmap enables the decoder to quickly locate the target field block without having to traverse the entire data frame byte by byte.

[0046] In this embodiment, the data organization format of the data frame is identified by version information as belonging to either the first format or the second format, thereby determining the position of the target field in the data frame. The first format is a dynamically addressable data organization format, where the position of the fields is not predetermined but dynamically indicated by the field block bitmap in the directory header. The second format, on the other hand, is a fixed-position data organization format, where the position of each field in the data frame is predetermined and does not depend on the dynamic indication from the directory header.

[0047] Specifically, in the first format, the data frame is organized into multiple field blocks (i.e., each field is stored independently as a field block). Each field block contains a field block header, field ciphertext, and field tag. The field block header contains a field identifier (used to identify the field to which the corresponding field block belongs) and field length information (used to indicate the length of the field data). The field block bitmap is used to indicate the starting position of each field block in the data frame. The decoder can first parse the directory header to obtain the field block bitmap, and then find the field block position corresponding to the target field identifier based on the field block bitmap. The first format is suitable for scenarios where the types and lengths of fields change dynamically and has good scalability.

[0048] In the second format, the byte offset and length of each field in the data frame are fixed during the protocol design phase and stored in the decoder's preset fixed field position index. The decoder can directly locate each field based on this index without parsing the directory header. The second format has the advantages of low processing overhead and fast parsing speed.

[0049] Taking the first format as an example, in one application scenario, the TV organizes each field into a data frame as field blocks. The data frame begins with a directory header, followed by the field blocks. Each field block contains a field block header, field ciphertext, and field tag. The field block header contains a field identifier (used to identify which field the field block belongs to) and field length information. After receiving the target field decryption instruction (e.g., needing to extract the casting code field), the decoder on the mobile phone locates the start of the data frame from the raw signal captured by the microphone and first reads the directory header data from the raw signal. The directory header is of fixed length (e.g., 8 bytes) and contains version information (2 bytes) and a field block bitmap (6 bytes).

[0050] Next, the decoder parses the version information (0x03) from the directory header, indicating that the data frame uses the first format. The decoder continues to parse the field block bitmap, which stores the start offset and length information of each field block in the form of an offset table. The decoder searches the field block position corresponding to the casting code field (field identifier 0x01) in the field block bitmap, finding that the start offset of the casting code field block is 24 bytes and its length is 20 bytes (including the field block header, field ciphertext, and field tag, where the field ciphertext is 4 bytes). Based on the determined start offset (24 bytes) and length (20 bytes), the decoder directly reads the complete data of this field block from the original signal. Then, the decoder parses the specific position of the field ciphertext from the field block header (after the field block header and before the field tag), and extracts the 4-byte ciphertext data of the casting code from that position.

[0051] In this embodiment, the decoder only parses the directory header and extracts the casting code field block, without extracting other field blocks such as the IP address field block and the peer-to-peer (P2P) digest field block, thus achieving on-demand extraction. Furthermore, since the decoder dynamically locates the field blocks through the directory header, the order of the field blocks in the data frame can be arbitrary and does not affect the decoder's extraction operation.

[0052] In one embodiment, the step of determining the transmission unit location and frequency point index information corresponding to a target field based on a preset mapping relationship between fields, transmission units, and frequency points includes: determining the transmission unit index corresponding to the target field based on the byte offset of the target field in the data frame; wherein the transmission unit index is used to indicate the transmission unit location of the corresponding target field, each transmission unit carries a predetermined number of bytes, and the transmission unit index is obtained by dividing the byte offset by the predetermined number; determining the lower nibble frequency group index and the higher nibble frequency group index corresponding to the target field based on the position of the byte offset within its respective transmission unit; wherein the lower nibble frequency group index is obtained by taking the byte offset modulo the predetermined number and multiplying by 2, and the higher nibble frequency group index is the lower nibble frequency group index plus 1; and determining the frequency point index information corresponding to the target field based on the lower nibble frequency group index and the higher nibble frequency group index.

[0053] This implementation determines the transmission unit index and the half-byte frequency group index by dividing and moduloing the byte offset. The transmission unit index is obtained by dividing the byte offset by a predetermined number, the lower half-byte frequency group index is obtained by taking the byte offset modulo the predetermined number and multiplying by 2, and the higher half-byte frequency group index is the lower half-byte frequency group index plus 1, thereby determining the position of each byte in the target field at the physical layer.

[0054] Byte offset is the position number of a byte in the target field within the data frame. The byte offset is counted starting from the beginning of the data frame (offset 0), and increments sequentially for each byte. For example, in a 15-byte data frame, the first byte has an offset of 0, the second byte has an offset of 1, the starting byte offset of the casting code field is 2, and the offsets of subsequent bytes are 3, 4, and 5 respectively, without further specific limitations.

[0055] The transmission unit index uniquely identifies the sequential position of a transmission unit within a data frame. In multi-frequency MFSK modulation, each transmission unit (i.e., payload symbol) carries 3 bytes of data. Transmission units in a data frame are arranged sequentially in chronological order, with indices starting from 0. Determining the transmission unit index allows the decoder to locate the specific transmission unit carrying a particular byte of the target field, i.e., the transmission unit position. The transmission unit index is calculated by dividing the byte offset by the number of bytes carried by each transmission unit.

[0056] The predetermined number equals the number of bytes carried by each transmission unit, and depends on the specific modulation scheme and protocol design. For example, in MFSK modulation, each symbol can carry 2, 3, 4, or more bytes, depending on the number of frequency groups contained in each symbol and the number of candidate frequency points in each frequency group. In OFDM modulation, the number of bytes carried by each resource block depends on the number of subcarriers and the modulation order. The value of the predetermined number is pre-defined by the protocol, and the decoder performs correct calculations based on this value.

[0057] The low-nibble frequency group index and the high-nibble frequency group index are the index numbers of the two frequency groups that carry the low nibble (lower 4 bits) and high nibble (higher 4 bits) of a byte, respectively. For example, in MFSK modulation, each byte is split into two nibbles, and each nibble is mapped to a frequency group for transmission. A frequency group contains 16 candidate frequency points, corresponding to 16 possible nibble values ​​(0 to 15). The low-nibble frequency group index and the high-nibble frequency group index are adjacent; the high-nibble frequency group index is equal to the low-nibble frequency group index plus 1. The low-nibble frequency group index is obtained by taking the byte offset modulo a predetermined number and multiplying it by 2.

[0058] Frequency point index information is the specific location identifier of the target frequency point in the frequency point space, determined by the lower nibble frequency group index and the higher nibble frequency group index. For example, in MFSK modulation, each frequency group contains 16 candidate frequency points. The frequency group index is used to locate the frequency group, and the candidate frequency point offset (0-15) is used to locate the specific frequency point within that frequency group. Frequency point index information can be composed of both the frequency group index and the candidate frequency point offset, or it can be composed of absolute frequency point numbers.

[0059] In one implementation, when the target field is a continuous byte range (e.g., the projection code byte offset 2-5), the position information of all bytes within the range can be calculated in batches by the decoder, instead of iteratively calculating byte by byte. The decoder first determines the starting offset (2) and length (4) of the range, then calculates the transmission unit index of the starting byte and the transmission unit index of the ending byte, and then determines the frequency group range to be processed within each transmission unit. This batch calculation method further improves the calculation efficiency.

[0060] In one implementation, the step of performing energy detection and demodulation processing on the target frequency point indicated by the frequency point index information to recover the ciphertext data of the target field from the original signal includes: obtaining the frequency group where the target frequency point indicated by the frequency point index information is located; wherein, each frequency group contains multiple candidate frequency points, and the target frequency point is one of the candidate frequency points in its frequency group; performing frequency domain transformation or filtering processing on the target frequency point to obtain the energy value of the target frequency point, and obtaining the energy values ​​of each candidate frequency point in the frequency group where the target frequency point is located; for each target frequency point, performing energy detection and demodulation processing on multiple candidate frequency points in the frequency group where the target frequency point is located. Among the candidate frequency points, the first frequency point with the highest energy is selected, and the index value of the first frequency point in its respective frequency group is determined as the half-byte data carried by the corresponding frequency group; for the first frequency group carrying the lower half-byte data of the same byte and the second frequency group carrying the higher half-byte data of the corresponding byte, the lower half-byte data recovered from the target frequency point in the first frequency group and the higher half-byte data recovered from the target frequency point in the second frequency group are combined to obtain the ciphertext data of the corresponding byte; the ciphertext data of all bytes of the same target field are combined in sequence to obtain the ciphertext data of the target field.

[0061] This implementation starts by obtaining the frequency group where the target frequency point is located, and obtains the energy value through frequency domain transformation, compares the energy within the frequency group and makes half-byte decisions, then combines two half-bytes of the same byte into a complete byte, and then combines all the bytes of the same target field into field data in sequence, thus forming a recovery link from the physical layer frequency point to the data layer field. This enables the decoder to accurately recover the target field data at the half-byte granularity, reducing the amount of computation and improving data processing efficiency while ensuring recovery accuracy.

[0062] In this embodiment, a frequency group is a set of candidate frequency points that are adjacent in the frequency domain or classified according to protocol rules. Each frequency group contains multiple candidate frequency points, and each candidate frequency point corresponds to a specific frequency position. In multi-frequency MFSK modulation, each frequency group contains 16 candidate frequency points, corresponding to 16 possible half-byte values ​​(0 to 15). The energy of all candidate frequency points within the same frequency group is measured by a decoder, and then the candidate frequency point actually transmitted by the transmitter is determined based on the energy distribution. The division of frequency groups is predetermined during the protocol design phase, and the number of frequency groups depends on the number of bytes carried by each transmission unit multiplied by 2 (each byte corresponds to 2 frequency groups).

[0063] In MFSK modulation, when transmitting a half-byte, the transmitter selects one of 16 candidate frequencies from the frequency group to which the half-byte belongs. Specifically, when the transmitter needs to send a half-byte of data with a value of n (n ranging from 0 to 15), it transmits signal energy on the nth candidate frequency in the frequency group. Therefore, the index value of the candidate frequency in the frequency group directly corresponds to the half-byte data value it carries. The correspondence between candidate frequencies and half-byte values ​​is predetermined; for example, a candidate frequency with an index of 0 corresponds to a half-byte value of 0, a candidate frequency with an index of 1 corresponds to a half-byte value of 1, and so on. This correspondence allows the frequency selection result after energy detection to be directly mapped to half-byte data without the need for an additional symbol mapping table.

[0064] The target frequency is a specific frequency carrying the target field data. The lower and higher nibble frequency group indices corresponding to each byte of the target field are determined by integer division and modulo operations performed by the decoder. The candidate frequencies within the frequency groups indicated by these indices are the target frequencies. The target frequency is a subset of the candidate frequencies; specifically, each target frequency belongs to a frequency group and is one of 16 candidate frequencies within that group. Since the decoder does not know which candidate frequency the transmitter is sending before energy detection, processing the target frequency essentially processes the entire frequency group it belongs to. The decoder detects all candidate frequencies within the group and then selects the one with the highest energy. The target frequency is specifically represented as a frequency number in the frequency point index information (determined by the frequency group index `lane` and the candidate frequency offset `n`), and the energy detection process targets these frequencies.

[0065] The energy value is a quantized measure of signal strength or power at a candidate frequency. The calculation method depends on the specific signal processing algorithm. For example, in frequency domain transformation, the energy value is the spectral amplitude or power spectral density; in the Goertzel algorithm, the energy value is the square of the amplitude of that frequency component. The range and unit of the energy value depend on the specific implementation of the algorithm and the quantization method. The energy value is used to compare multiple candidate frequencies within a frequency group; a higher energy value indicates a greater likelihood that the transmitter will send a signal at that frequency.

[0066] The index value of the first frequency point within its respective frequency group is its sequence number within that group. For a frequency group containing 16 candidate frequency points, the index value ranges from 0 to 15. The index value directly corresponds to the half-byte of data it carries: index 0 corresponds to binary 0000 (decimal 0), index 1 corresponds to binary 0001 (decimal 1), and so on, with index 15 corresponding to binary 1111 (decimal 15). Therefore, determining the index value of the first frequency point within its respective frequency group as the half-byte of data carried by that frequency group is a direct mapping from energy detection results to data demodulation.

[0067] In this embodiment, a byte is split into a low nibble (lower 4 bits) and a high nibble (higher 4 bits), each carried by two different frequency groups. The first frequency group carries the low nibble data, and the second frequency group carries the high nibble data. The indices of the two frequency groups are adjacent, with the high nibble frequency group index being the low nibble frequency group index plus 1. The low nibble data recovered from the first frequency group is combined with the high nibble data recovered from the second frequency group, for example, by merging the low nibble as the lower 4 bits of the byte and the high nibble as the higher 4 bits of the byte, forming a complete 8-bit byte data. The combination order of the nibble data is determined by the MFSK modulation protocol.

[0068] In one implementation, FFT energy detection is performed using a decoder. The decoder performs a 64-point or 128-point FFT on the time-domain sampled data corresponding to transmission unit 0 to obtain complete spectral information. Then, the decoder reads the amplitude values ​​of frequency points 64 to 79 (frequency group 4) and frequency points 80 to 95 (frequency group 5) from the spectrum as energy values, and then performs the same intra-frequency group energy comparison, half-byte decision, and byte combination operations. The computational cost of FFT for detecting a single transmission unit may be higher than performing the Goertzel algorithm on only 16 candidate frequency points, but the FFT method is more advantageous for detecting multiple frequency groups simultaneously, especially when there are many target frequency groups to be detected, where the overall efficiency of FFT is higher.

[0069] In one implementation, when performing energy comparison within a frequency group, the decoder not only compares the maximum energy with the second-largest energy, but also further analyzes the difference between the two to assess the reliability of the demodulation result. Taking frequency group 4 as an example, assuming the decoder obtains a maximum energy value of 0.85 and a second-largest energy value of 0.72, the energy difference between the two is 0.13. If the preset confidence threshold is 0.2, then 0.13 is lower than the threshold value. The decoder determines that the demodulation result of this half-byte is unreliable and marks the ciphertext data recovery of the target field as failed, and does not pass unreliable data to subsequent decryption steps. The confidence assessment enables the decoder to avoid erroneous half-byte decisions caused by noise interference.

[0070] In one implementation, the step of generating a decryption key stream for each first field of the recovered ciphertext data in the target field, based on the field identifier of the first field and / or the position offset information of the first field within the data frame, includes: for each first field of the recovered ciphertext data in the target field, inputting a random number in the data frame, the field identifier of the first field, and the byte offset of the first field within the data frame into a preset pseudo-random function to obtain a key stream corresponding to the first field; wherein the input parameters of the pseudo-random function are different for different field identifiers.

[0071] This implementation eliminates the order dependency of decryption between fields by inputting random numbers, field identifiers, and byte offsets into a pseudo-random function to generate decryption key streams for each field independently. This enables random access decryption of target fields in encrypted scenarios, allowing the decoder to directly decrypt target fields without processing any irrelevant fields, significantly improving the processing efficiency when extracting data on demand in encrypted scenarios.

[0072] A random number is a value randomly or pseudo-randomly generated by the sending end when generating a data frame. This ensures that even if two transmissions have identical field identifiers and byte offsets, the generated keystreams will differ due to the different random numbers, thus preventing keystream reuse attacks. The random number can be included in the directory header or frame header of the data frame and sent to the receiving end along with the data frame. The receiving end obtains the random number by parsing the directory header or frame header of the data frame. The length of the random number can be configured according to security requirements, typically 8 bytes (64 bits) or 16 bytes (128 bits). Longer random numbers provide higher security but increase the length of the data frame.

[0073] Byte offsets can be the starting byte offset of a field (i.e., the offset position of the first byte of the field in the data frame) or an independent byte offset for each byte within the field (i.e., the starting offset of the field plus the byte sequence number within the field). When using the starting byte offset of the field, the entire field uses the same underlying keystream (which can be extended to the field length); when using the independent byte offset for each byte within the field, each byte within the field uses an independently generated keystream byte.

[0074] The preset pseudo-random function can be any function capable of mapping an input of arbitrary length to a fixed-length or variable-length output sequence. It takes a key and one or more parameters as input and outputs a pseudo-random sequence. Specifically, the pseudo-random function can be a hash-based message authentication code (HMAC), a key derivation function based on block ciphers (such as keystream generation in AES-CTR mode), or a function based on a dedicated pseudo-random number generator, etc., without further limitation here.

[0075] In one implementation, the step of decrypting the ciphertext data of the first field using a decryption key stream to obtain the plaintext data of the first field includes: performing a bitwise XOR operation on each byte of the ciphertext data of the first field with the corresponding key stream byte in the decryption key stream to obtain the plaintext data of the first field.

[0076] This implementation method achieves independent decryption of field-level data with extremely low computational overhead by using a byte-by-byte bitwise XOR decryption method. The decryption of each byte does not affect each other, can be performed in parallel or partially, further reducing unnecessary computational overhead and improving the overall data decryption efficiency.

[0077] This implementation performs an XOR operation on each byte of the ciphertext data one by one, rather than treating the ciphertext data as a whole for block or group operations. In other words, the decryption of each byte is independent; the decryption result of the i-th byte depends only on the ciphertext data of the i-th byte and the keystream byte of the i-th byte, and not on the decryption results of the (i-1)-th or (i+1)-th bytes. This byte-by-byte independence allows decryption operations to be performed in parallel at the byte level, and also allows decryption to begin from any byte position, without needing to start from the beginning of the field.

[0078] In this embodiment, each byte of the ciphertext data in the first field is XORed with the corresponding byte in the decryption key stream. That is, the first byte (position 0) of the ciphertext data is XORed with the first byte (position 0) of the decryption key stream, the second byte (position 1) of the ciphertext data is XORed with the second byte (position 1) of the decryption key stream, and so on.

[0079] In one implementation, after decrypting the ciphertext data of the first field using a decryption key stream to obtain the plaintext data of the first field, the method further includes: obtaining an integrity tag associated with the first field; wherein the integrity tag is obtained from the field block corresponding to the first field in the data frame; calculating verification information based on a random number in the data frame, the ciphertext data of the first field, the field identifier of the first field, and the length of the first field; comparing the calculated verification information with the integrity tag; if they match, confirming that the integrity verification of the first field has passed, and outputting the plaintext data of the first field.

[0080] This implementation obtains the integrity tag associated with the first field, recalculates the verification information based on the random number in the data frame, the ciphertext data of the first field, the field identifier, and the field length, and compares the calculated verification information with the integrity tag to confirm whether the integrity verification of the first field has passed. Only after successful verification is the plaintext data output to the business layer. This implementation, through the field-level independent integrity tag verification mechanism, ensures that selectively extracted field data can also obtain independent integrity protection. Compared with the verification method that relies on the entire frame CRC, it achieves field-level integrity verification in on-demand extraction scenarios, avoids the security risk of outputting local errors as legitimate fields, and improves the overall reliability and security of data decryption.

[0081] Integrity tags are verification information generated independently by the sender for each field, used to verify whether the data in that field has been tampered with or corrupted during transmission. Before sending a data frame, the sender calculates the integrity tag using a preset integrity verification algorithm based on the field's ciphertext (or plaintext) data, field identifier, field length, and a random number in the data frame. The integrity tag is then sent to the receiver along with the corresponding field block. The integrity tag is encapsulated within the field block along with the ciphertext data, and the receiver can retrieve the integrity tag for that field simultaneously when extracting the ciphertext data. The algorithm for generating the integrity tag can be a key-based Message Authentication Code (MAC), a keyed hash function, a digital signature, or other verification algorithms capable of detecting data tampering; specific algorithms are not limited here.

[0082] When calculating the verification information, the same integrity verification algorithm as the sending end is used. A new verification value is calculated for the same objects (the random number in the data frame, the ciphertext data of the first field, the field identifier of the first field, and the length of the first field). When the verification information calculated by the receiving end matches the integrity tag, it proves that the ciphertext data of that field has not been tampered with or damaged during transmission, and that all associated information (random number, field identifier, field length) is consistent with that of the sending end. Therefore, the decrypted plaintext data can be securely output to the business layer. Conversely, if the two are inconsistent, it indicates that the ciphertext data may have been tampered with or damaged during transmission, or that the associated information has deviated. In this case, the plaintext data should not be output to the business layer.

[0083] In one implementation, when the integrity verification of the first field fails, the decoder, in addition to not outputting the data for that field, also attempts to re-extract and decrypt the field from the next repeating frame of the current data frame. In an acoustic transmission system, the symbols of each data frame are sent multiple times in repeating frames (e.g., each symbol repeats 6 frames). After a single verification failure, the decoder can wait for the next repeating frame to arrive and retry extracting and decrypting the target field. If verification still fails after multiple retries, the decoder can switch to full decoding mode, fully decode the entire data frame, and then use the full-frame CRC for verification.

[0084] In one implementation, the length of the integrity tag is variable, determined by the verification level parameter indicated in the directory header of the data frame. For example, when the verification level is Level 1 (candidate preview), the tag length is 8 bits (1 byte), resulting in lower verification strength but less bandwidth usage; when the verification level is Level 2 (formal connection), the tag length is 32 bits (4 bytes), resulting in higher verification strength but more bandwidth usage. Verification information of a corresponding length is truncated according to the tag length indicated in the directory header for comparison, thus achieving a balance between different security levels and transmission bandwidth.

[0085] In one implementation, the step of confirming the integrity verification of the first field is passed and outputting the plaintext data of the first field if they match includes: confirming the integrity verification of the first field is passed if they match; if the verification level information in the target field decryption instruction indicates that the verification level is the first level, then outputting the plaintext data of the first field; if the verification level information in the target field decryption instruction indicates that the verification level is the second level, then performing integrity verification on the data frame; if the integrity verification of the data frame is passed, then outputting the plaintext data of the first field.

[0086] This implementation determines whether to output plaintext data immediately (Level 1) or wait for the entire frame integrity check to pass before outputting plaintext data (Level 2) based on the verification level information in the target field decryption command. This implementation uses a tiered verification level control strategy to allow the decoder to flexibly balance response speed and data reliability according to the security requirements of the business scenario. Level 1 enables rapid output in low-security scenarios, while Level 2 enables reliable output in high-security scenarios, thus improving the system's overall adaptability to different business scenarios.

[0087] The business layer can configure verification level information through the target field decryption command to specify the verification level as either Level 1 or Level 2. Level 1 is suitable for business scenarios with high requirements for response speed and relatively low requirements for data reliability. For example, in a candidate preview scenario, only the projection code is needed for displaying the device list. In this case, even if there are very small errors in the data (such as incorrect characters in the projection code), users can usually correct them by visual inspection or by re-searching. Therefore, the requirements for data integrity are low, but the requirements for response speed are high.

[0088] The second level is suitable for business scenarios with high requirements for data reliability and relatively low requirements for response speed. For example, in formal connection scenarios, a screen mirroring code and IP address are required to establish an actual screen mirroring session. In this case, any data error may lead to connection failure or security issues, so the highest level of data integrity verification is required.

[0089] In one implementation, when the verification level is Level 1 and all target fields have passed field-level integrity verification, the decoder not only immediately outputs plaintext data but also stops further parsing of the current data frame. For example, since the service layer only needs the projection code for device discovery, and the projection code has passed field-level verification, the decoder does not need to continue decoding other fields in the data frame (such as IP address, P2P digest, etc.) nor wait for the reception and verification of these fields. The decoder redirects processing resources to the synchronous search of the next data frame, thereby further reducing power consumption and processing latency, minimizing unnecessary processing while ensuring necessary data output.

[0090] In one implementation, if integrity verification fails (e.g., the total tag is inconsistent with the recalculated verification information), the decoder will not output any plaintext data for any target field, even if field-level verification of all target fields has passed. A frame-wide verification failure indicates that the data frame may have been interfered with or tampered with during transmission. While individual fields may have passed their own integrity tag verification, the relationships between fields may have been disrupted (e.g., the position indicated by the field block bitmap does not correspond to the actual data, or some field blocks have been replaced). The decoder can mark the current data frame as invalid, wait for the next repeating frame to retry, or switch to full decoding mode.

[0091] For the corresponding method embodiments described above, see [link to relevant documentation]. Figure 2 The diagram illustrates a data decryption device, comprising: a response module 20, configured to extract at least one target field from the original signal in response to a target field decryption command; wherein the target field decryption command includes: field mask information for identifying the target field, the target field being carried by a data frame; a determination module 22, configured to determine the transmission unit position and frequency index information corresponding to the target field based on a preset mapping relationship between fields, transmission units, and frequency points; a recovery module 24, configured to perform energy detection and demodulation processing on the target frequency point indicated by the frequency index information to recover the ciphertext data of the target field from the original signal; a generation module 26, configured to generate a decryption key stream for each first field of the recovered ciphertext data in the target field, based on the field identifier of the first field and / or the position offset information of the first field within the data frame; and a decryption module 28, configured to decrypt the ciphertext data of the first field using the decryption key stream to obtain the plaintext data of the first field.

[0092] The decryption device for the aforementioned data determines the target field to be extracted based on the field mask information in the target field decryption instruction specified by the service layer. Based on the preset mapping relationship between fields, transmission units, and frequencies, it directly locates the transmission unit position and frequency index information corresponding to the target field. This allows the receiving end to eliminate the need for energy detection and demodulation operations on frequencies other than the target field, and only processes the target frequency to recover the ciphertext data of the target field, thus avoiding all computational overhead caused by irrelevant fields. At the same time, for each target field of the recovered ciphertext, a decryption key stream is independently generated and decrypted based on its field identifier and / or position offset information. This ensures that the decryption of each target field is independent of each other, and it is not necessary to sequentially decrypt from the beginning of the data frame to obtain the plaintext of the target field. This further eliminates the additional computation caused by the need to process the ciphertext of non-target fields due to decryption order dependence. Thus, while ensuring the correct acquisition of the required data, it reduces the power consumption of the receiving end and improves the efficiency of data decryption.

[0093] Optionally, the response module 20 is specifically configured to: in response to a target field decryption command, parse the directory header of the data frame to be extracted from the original signal; wherein the directory header contains version information and a field block bitmap of the data frame, the field block bitmap being used to indicate the position of each field block in the data frame to be extracted; determine the data organization format of the data frame to be extracted based on the version information; if the data organization format is a first format, determine the position of the field block corresponding to each target field in the data frame to be extracted based on the field block bitmap; if the data organization format is a second format, determine the position of each target field in the data frame to be extracted based on a preset fixed field position index; and extract the data frame and at least one target field carried by the data frame from the original signal based on the determined position.

[0094] Optionally, the determining module 22 is specifically used for: determining the transmission unit index corresponding to the target field based on the byte offset of the target field in the data frame; wherein, the transmission unit index is used to indicate the transmission unit position of the corresponding target field, each transmission unit carries a predetermined number of bytes, and the transmission unit index is obtained by dividing the byte offset by the predetermined number; determining the low nibble frequency group index and the high nibble frequency group index corresponding to the target field based on the position of the byte offset within its respective transmission unit; wherein, the low nibble frequency group index is obtained by taking the byte offset modulo the predetermined number and multiplying by 2, and the high nibble frequency group index is the low nibble frequency group index plus 1; and determining the frequency point index information corresponding to the target field based on the low nibble frequency group index and the high nibble frequency group index.

[0095] Optionally, the recovery module 24 is specifically used for: obtaining the frequency group where the target frequency point indicated by the frequency point index information is located; wherein, each frequency group contains multiple candidate frequency points, and the target frequency point is one of the candidate frequency points in its frequency group; performing frequency domain transformation or filtering on the target frequency point to obtain the energy value of the target frequency point, and obtaining the energy values ​​of each candidate frequency point in the frequency group where the target frequency point is located; for each target frequency point, selecting the first frequency point with the highest energy among the multiple candidate frequency points in the frequency group where the target frequency point is located, and determining the index value of the first frequency point in its frequency group as the half-byte data carried by the corresponding frequency group; for the first frequency group carrying the lower half-byte data of the same byte and the second frequency group carrying the higher half-byte data of the corresponding byte, combining the lower half-byte data recovered from the target frequency point in the first frequency group with the higher half-byte data recovered from the target frequency point in the second frequency group to obtain the ciphertext data of the corresponding byte; and combining the ciphertext data of all bytes of the same target field in sequence to obtain the ciphertext data of the target field.

[0096] Optionally, the generation module 26 is specifically used to: for each first field of the recovered ciphertext data in the target field, input the random number in the data frame, the field identifier of the first field, and the byte offset of the first field in the data frame into a preset pseudo-random function to obtain a key stream corresponding to the first field; wherein, the pseudo-random function input parameters are different for different field identifiers.

[0097] Optionally, the decryption module 28 is specifically used to: perform a bitwise XOR operation on each byte of the ciphertext data of the first field with the corresponding key stream byte in the decryption key stream to obtain the plaintext data of the first field.

[0098] Optionally, the apparatus further includes: an acquisition module, configured to acquire an integrity tag associated with the first field; wherein the integrity tag is acquired from a field block in the data frame corresponding to the first field; a calculation module, configured to calculate verification information based on a random number in the data frame, the encrypted data of the first field, the field identifier of the first field, and the length of the first field; a comparison module, configured to compare the calculated verification information with the integrity tag; and an output module, configured to, if they match, confirm that the integrity verification of the first field has passed and output the plaintext data of the first field.

[0099] Optionally, the output module is specifically used for: if they match, confirming that the integrity verification of the first field has passed; if the verification level information in the target field decryption instruction indicates that the verification level is the first level, then outputting the plaintext data of the first field; if the verification level information in the target field decryption instruction indicates that the verification level is the second level, then performing integrity verification on the data frame; if the integrity verification of the data frame passes, then outputting the plaintext data of the first field.

[0100] This embodiment also provides an electronic device, including a processor and a memory. The memory stores machine-executable instructions that can be executed by the processor. The processor executes the machine-executable instructions to implement the aforementioned data decryption method. This electronic device can be a server or a terminal device.

[0101] See Figure 3 As shown, the electronic device includes a processor 100 and a memory 101. The memory 101 stores machine-executable instructions that can be executed by the processor 100. The processor 100 executes the machine-executable instructions to implement the aforementioned data decryption method.

[0102] Furthermore, Figure 3The electronic device shown also includes a bus 102 and a communication interface 103, with the processor 100, the communication interface 103 and the memory 101 connected via the bus 102.

[0103] The memory 101 may include high-speed random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 103 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc. The bus 102 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 3 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0104] The processor 100 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 100 or by instructions in software form. The processor 100 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this disclosure. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this disclosure can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a readily available storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 101, and the processor 100 reads the information from memory 101 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.

[0105] This embodiment also provides a computer-readable storage medium storing computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions cause the processor to implement the above-mentioned data decryption method.

[0106] The data decryption method, apparatus, electronic device, and storage medium computer program product provided in the embodiments of this disclosure include a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments. For specific implementation details, please refer to the method embodiments, which will not be repeated here.

[0107] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system and apparatus described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0108] Furthermore, in the description of the embodiments of this disclosure, unless otherwise expressly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this disclosure based on the specific circumstances.

[0109] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0110] In the description of this disclosure, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, and are only for the convenience of describing this disclosure and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this disclosure. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0111] Finally, it should be noted that the above embodiments are merely specific implementations of this disclosure, used to illustrate the technical solutions of this disclosure, and not to limit it. The protection scope of this disclosure is not limited thereto. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this disclosure. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this disclosure, and should all be covered within the protection scope of this disclosure. Therefore, the protection scope of this disclosure should be determined by the protection scope of the claims.

Claims

1. A data decryption method, characterized in that, The method includes: In response to a target field decryption instruction, at least one target field is extracted from the original signal; wherein the target field decryption instruction includes: field mask information for identifying the target field, the target field being carried by a data frame; Based on the preset mapping relationship between fields and transmission units and frequency points, determine the transmission unit location and frequency point index information corresponding to the target field; Energy detection and demodulation are performed on the target frequency indicated by the frequency index information to recover the ciphertext data of the target field from the original signal; For each first field in the target field where the ciphertext data has been recovered, a decryption key stream for the first field is generated based on the field identifier of the first field and / or the position offset information of the first field within the data frame. The ciphertext data of the first field is decrypted using the decryption key stream to obtain the plaintext data of the first field.

2. The method according to claim 1, characterized in that, The step of extracting at least one target field from the original signal in response to a target field decryption command includes: In response to a target field decryption command, the directory header of the data frame to be extracted is parsed from the original signal; wherein the directory header contains version information of the data frame and a field block bitmap, the field block bitmap being used to indicate the position of each field block in the data frame to be extracted; Based on the version information, determine the data organization format of the data frame to be extracted; If the data organization format is the first format, then the position of the field block corresponding to each target field in the data frame to be extracted is determined according to the field block bitmap; If the data organization format is the second format, the position of each target field in the data frame to be extracted is determined according to the preset fixed field position index; Based on the determined location, a data frame and at least one target field carried by the data frame are extracted from the original signal.

3. The method according to claim 1, characterized in that, The step of determining the transmission unit location and frequency index information corresponding to the target field based on the preset mapping relationship between fields, transmission units, and frequency points includes: Based on the byte offset of the target field in the data frame, the transmission unit index corresponding to the target field is determined; wherein, the transmission unit index is used to indicate the transmission unit position of the corresponding target field, each transmission unit carries a predetermined number of bytes, and the transmission unit index is obtained by dividing the byte offset by the predetermined number; Based on the position of the byte offset within its respective transmission unit, the low nibble frequency group index and the high nibble frequency group index corresponding to the target field are determined; wherein, the low nibble frequency group index is obtained by taking the byte offset modulo the predetermined number and multiplying it by 2, and the high nibble frequency group index is the low nibble frequency group index plus 1; Based on the lower nibble frequency group index and the higher nibble frequency group index, determine the frequency point index information corresponding to the target field.

4. The method according to claim 1, characterized in that, The step of performing energy detection and demodulation processing on the target frequency indicated by the frequency index information to recover the ciphertext data of the target field from the original signal includes: Obtain the frequency group where the target frequency point indicated by the frequency point index information is located; wherein, each frequency group contains multiple candidate frequency points, and the target frequency point is one of the candidate frequency points in its frequency group; The target frequency point is subjected to frequency domain transformation or filtering to obtain the energy value of the target frequency point, and the energy values ​​of each candidate frequency point in the frequency group where the target frequency point is located are obtained. For each target frequency point, among multiple candidate frequency points in the frequency group where the target frequency point is located, the first frequency point with the highest energy is selected, and the index value of the first frequency point in its frequency group is determined as the half-byte data carried by the corresponding frequency group; For a first frequency group carrying the lower half-byte data of the same byte and a second frequency group carrying the higher half-byte data of the corresponding byte, the lower half-byte data recovered from the target frequency point in the first frequency group and the higher half-byte data recovered from the target frequency point in the second frequency group are combined to obtain the ciphertext data of the corresponding byte. The ciphertext data of the target field is obtained by sequentially combining all bytes of the ciphertext data of the same target field.

5. The method according to claim 1, characterized in that, For each first field of the recovered ciphertext data in the target field, the step of generating a decryption key stream for the first field based on the field identifier of the first field and / or the position offset information of the first field within the data frame includes: For each first field of the recovered ciphertext data in the target field, the random number in the data frame, the field identifier of the first field, and the byte offset of the first field in the data frame are input together into a preset pseudo-random function to obtain a key stream corresponding to the first field; wherein, the input parameters of the pseudo-random function are different for different field identifiers.

6. The method according to claim 1, characterized in that, The step of decrypting the ciphertext data of the first field using the decryption key stream to obtain the plaintext data of the first field includes: Perform a bitwise XOR operation between each byte of the ciphertext data of the first field and the corresponding byte of the key stream in the decryption key stream to obtain the plaintext data of the first field.

7. The method according to claim 1, characterized in that, After the step of decrypting the ciphertext data of the first field using the decryption key stream to obtain the plaintext data of the first field, the method further includes: Obtain the integrity label associated with the first field; wherein the integrity label is obtained from the field block corresponding to the first field in the data frame; The verification information is calculated based on the random number in the data frame, the encrypted data of the first field, the field identifier of the first field, and the length of the first field. The calculated verification information is compared with the integrity label; If they match, the integrity verification of the first field is confirmed to be successful, and the plaintext data of the first field is output.

8. The method according to claim 7, characterized in that, If they match, the steps to confirm that the integrity verification of the first field has passed and output the plaintext data of the first field include: If they match, then the integrity verification of the first field is confirmed to have passed; If the verification level information in the target field decryption instruction indicates that the verification level is the first level, then the plaintext data of the first field is output; If the verification level information in the target field decryption instruction indicates that the verification level is level two, then the data frame is subjected to integrity verification. If the integrity check of the data frame passes, the plaintext data of the first field is output.

9. A data decryption device, characterized in that, The device includes: A response module is configured to extract at least one target field from the original signal in response to a target field decryption instruction; wherein the target field decryption instruction includes: field mask information for identifying the target field, and the target field is carried by a data frame; The determination module is used to determine the transmission unit location and frequency index information corresponding to the target field based on the preset mapping relationship between the field and the transmission unit and frequency point; The recovery module is used to perform energy detection and demodulation processing on the target frequency indicated by the frequency index information in order to recover the ciphertext data of the target field from the original signal; The generation module is used to generate a decryption key stream for each first field of the recovered ciphertext data in the target field, based on the field identifier of the first field and / or the position offset information of the first field within the data frame. The decryption module is used to decrypt the ciphertext data of the first field using the decryption key stream to obtain the plaintext data of the first field.

10. An electronic device, characterized in that, The device includes a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the data decryption method according to any one of claims 1-8.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the data decryption method according to any one of claims 1-8.