METHOD FOR ENCODING AND DECODING DATA

20250094361 ยท 2025-03-20

    Inventors

    Cpc classification

    International classification

    Abstract

    Methods for encoding and decoding data. The encoding includes: receiving a datum representing a numerical value from a predefined maximum value range; selecting an encoding rule for the datum; encoding the numerical value of the datum based on the selected encoding rule by omitting all binary positions of the numerical value considered as a binary number that are of lower significance than a binary position used for the binary representation of a lower limit of a value range of the selected encoding rule, and all binary positions of the numerical value considered as a binary number that are of higher significance than a binary position used for the binary representation of an upper limit of the value range of the selected encoding rule; and extending the binary number of the encoded numerical value at a predefined position by predefined encoding information which uniquely identifies the encoding rule used.

    Claims

    1-10 (canceled).

    11. A method for encoding data, comprising the following steps: receiving a datum representing a numerical value from a predefined maximum value range; selecting a suitable encoding rule for the datum from at least a first predefined encoding rule and a second predefined encoding rule, wherein: the first encoding rule is provided for encoding a first value range whose lower limit corresponds to a lower limit of the maximum value range and whose upper limit corresponds to a binary number that is at least one binary position smaller than a binary number used for a binary representation of an upper limit of the maximum value range, the second encoding rule is provided for encoding a second value range whose lower limit corresponds to a binary number that is at least one binary position larger than a binary number used for a binary representation of the lower limit of the maximum value range, and whose upper limit corresponds to the upper limit of the maximum value range, an encoding rule of the first and second encoding rules whose value range contains the numerical value of the datum is selected, wherein, in a case in which the numerical value is contained in the first and second value ranges of a plurality of the first and second encoding rules, the encoding rule that has the smallest lower value range limit is selected, encoding the numerical value of the datum based on the selected encoding rule including: omitting all binary positions of the numerical value of the datum considered as a binary number that are of lower significance than a binary position used for the binary representation of the lower limit of the value range of the selected encoding rule, and omitting all binary positions of the numerical value of the datum considered as a binary number that are of higher significance than the binary position used for a binary representation of the upper limit of the value range of the selected encoding rule; and extending a binary number of the encoded numerical value at a predefined position by predefined encoding information, which uniquely identifies the selected encoding rule used in each case.

    12. The method according to claim 11, wherein a number of bits used for encoding the first and second value ranges of the respective first and second encoding rules is uniform for all encoding rules.

    13. The method according to claim 11, wherein at least a third encoding rule is additionally used, which is provided for encoding a third value range: whose lower limit corresponds to a binary number that is at least one binary position larger than a binary number used for the binary representation of the lower limit of the first value range, and whose upper limit corresponds to a binary number that is at least one binary position smaller than a binary number used for the binary representation of the upper limit of the second value range.

    14. The method according to claim 13, wherein a number of binary positions located between respective binary representations of the lower limits of the first, second, and third value ranges is: identical or substantially identical, or higher, the higher the numerical values of the lower limits of the respective first, second, and third value ranges are.

    15. The method according to claim 11, wherein respective lower and/or upper limits of the respective first and second value ranges are dynamically adjusted depending on current boundary conditions.

    16. The method according to claim 11, wherein negative numerical values to be encoded are identified by a sign bit by which the encoded numerical value is extended at a predefined position.

    17. The method according to claim 11, wherein the method is used to: encode measured values from sensors, and/or transmit data between a transmitter and a receiver, in a vehicle or in a home automation system.

    18. The method according to claim 17, wherein each encoded numerical value is transmitted in a single transmission frame during a data transmission.

    19. A method for decoding data, comprising the following steps: receiving a datum including an encoded numerical value and encoding information corresponding to the encoded numerical value; selecting, depending on the encoding information, a predefined decoding rule for decoding the encoded numerical value from at least a first predefined decoding rule and a second predefined decoding rule; shifting the encoded numerical value considered as a binary number in a direction of binary positions of higher significance by a number of binary positions defined by the selected decoding rule, to generate a decoded binary number; wherein the decoded binary number has a predefined number of target binary positions that is at least large enough that a predefined maximum value range used in the encoding of the numerical value can be represented by the decoded binary number, and binary positions of the decoded binary number: that are of higher significance than a highest binary position occupied by the shifted binary number are assigned values of zero, and that are of lower significance than a lowest binary position occupied by the shifted binary number are assigned predefined replacement values.

    20. The method according to claim 19, wherein, it is provided for the replacement values: that values of 0 are assigned to each binary position of the decoded binary number to be filled by the replacement values, or that values of 1 are assigned to each binary position of the decoded binary number to be filled by the replacement values, or that a value of 1 is assigned to the most significant binary position of the binary positions of the decoded binary number to be assigned replacement values and that a value of 0 is assigned to the other binary positions to be assigned replacement values, or that a value of 0 is assigned to the most significant binary position of the binary positions of the decoded binary number to be assigned replacement values and that a value of 1 is assigned to the other binary positions to be assigned replacement values.

    Description

    BRIEF DESCRIPTION OF THE DRAWINGS

    [0029] Exemplary embodiments of the present invention are described in detail below with reference to the figures.

    [0030] FIG. 1 shows a first exemplary embodiment of predefined encoding rules according to the present invention and of predefined decoding rules corresponding thereto.

    [0031] FIG. 2 shows a second exemplary embodiment of predefined encoding rules according to the present invention and of predefined decoding rules corresponding thereto.

    DETAILED DESCRIPTION OF EXAMPLE EMBODIMENTS

    [0032] FIG. 1 shows a first exemplary embodiment of encoding rules c1, c2 according to the present invention and of decoding rules d1, d2 corresponding thereto.

    [0033] It should be pointed out that a representation (in particular a data representation, e.g., in a storage unit) of the respective encoding rules c1, c2 and the decoding rules d1, d2 respectively corresponding thereto can be identical. In the example shown here, all information required for encoding and decoding numerical values is provided in the same table, wherein use of separate encoding rules c1, c2 and decoding rules d1, d2, each of which contains only the information required for encoding or decoding, is also explicitly possible.

    [0034] It should furthermore be pointed out that encoding according to the present invention of numerical values and decoding according to the present invention of numerical values can always be carried out independently of one another, regardless of a common or a separate representation of the encoding/decoding rules.

    [0035] In its first column from the left, the table shown in FIG. 1 has a consecutive number, which represents the respective bits or binary positions of a maximum value range w_max, wherein the maximum value range w_max relates here, for reasons of representation, to an amount, i.e., a range of positive numerical values, and a sign bit SIGN is provided as an additional 20th bit to represent both positive and negative numerical values. In this context, it should be explicitly pointed out that the method according to the present invention can also be carried out with maximum value ranges w_max that do not have negative numerical values (e.g., pressure, temperature, distance). In such cases, the 20th bit is preferably used additionally to represent the positive value range.

    [0036] In its second column from the left, the table shown in FIG. 1 has the respective lower limits of the respective encoding/decoding rules.

    [0037] The third column from the left represents the first encoding rule c1 and the first decoding rule d1 with a value range w1, while the fourth column from the left represents the second encoding rule c2 and the second decoding rule d2 with a value range w2.

    [0038] A numerical value that is to be encoded by means of the method according to the present invention and whose amount is within the maximum value range w max is received as a datum by an evaluation unit.

    [0039] On the basis of the magnitude of the numerical value, the evaluation unit selects the encoding rule c1, c2 for encoding the numerical value in whose value range w1, w2 the numerical value falls, wherein, in a case in which the numerical value is contained in the value ranges w1, w2 of a plurality of encoding rules c1, c2, the encoding rule c1, c2 that has the smallest lower value range limit is always selected.

    [0040] In a specific example, a numerical value of 2000 is encoded, which is contained in the value ranges w1, w2 of both encoding rules c1, c2. According to the specification described above, the first encoding rule cl is accordingly selected to encode the numerical value, and the amount of the numerical value is encoded with 14 bits (c1_bit1 to c1_bit14).

    [0041] The sign bit SIGN, which here represents a positive value, is now added as the 15th bit to the encoded numerical value.

    [0042] Additional encoding information c0, which here indicates the use of the first encoding rule c1, is added as the 16th bit to the encoded numerical value.

    [0043] In the case of a numerical value of, for example, 55555 to be encoded, the second encoding rule c2 is accordingly used for encoding. The LSBs, i.e., bits 1 to 5 in the fourth column from the left, are omitted so that, due to an associated reduction in resolution, a corresponding error is introduced when using the second encoding rule c2.

    [0044] Since the number of bits provided for encoding is here defined identically in the respective encoding rules c1, c2, encoded numerical values are generated accordingly with a uniform bit length, which allows a constant data rate to be achieved when transmitting the numerical values encoded in this way.

    [0045] In addition, it is possible, for example, to adjust the respective limits of the value ranges w1, w2 depending on current boundary conditions and to transmit relevant information about the adjustments from a transmitter, which is configured to carry out the encoding of numerical values, to a receiver, which is configured to carry out the decoding of numerical values, by means of additional transmission frames from the transmitter to the receiver so that correct decoding of transmitted data on the basis of this information is ensured at all times.

    [0046] The method according to the present invention can be used particularly advantageously for encoding measured values from sensors of a vehicle, which are encoded, for example, by the sensors themselves and are subsequently transmitted to a control device of the vehicle which corresponds to the sensors and in which decoding of the measured values from the sensors takes place. Particularly preferably, each encoded measured value is transmitted in a single transmission frame.

    [0047] In order to decode the encoded numerical value, the binary positions of the encoded numerical value are first shifted, depending on the encoding rule c1, c2 used, to the position at which they were before encoding. MSBs omitted during encoding are filled with values of 0 during decoding by means of the first decoding rule d1, while LSBs are filled with replacement values during decoding by means of the second decoding rule d2, which are defined with respect to bits 1 to 5 in the fourth column from the left in the table.

    [0048] FIG. 2 shows a second exemplary embodiment of encoding rules c1, c2, c3 predefined according to the present invention and of decoding rules d1, d2, d3 corresponding thereto. Due to numerous matches between the table in FIG. 1 and the table in FIG. 2, only the differences between the two tables are described below to avoid repetitions.

    [0049] In FIG. 2, the maximum value range w max including the sign bit SIGN corresponds to only 16 bits. In addition, a third encoding rule c3 and a third decoding rule d3 with a third value range w3 are provided. The lower limits of the value ranges w1, w2, w3 are each defined in such a way that the distance between the lower limits and higher values increases. This results in a correspondingly smaller error when encoding smaller values than when encoding larger values.

    [0050] For uniquely identifying the encoding rule c1, c2, c3 used in each case, two bits are required in the encoding information co to be held available.

    [0051] In addition, partially different replacement values are defined here in comparison to the table in FIG. 1.