METHOD FOR ENCODING AND DECODING DATA

Information

  • Patent Application
  • 20250094361
  • Publication Number
    20250094361
  • Date Filed
    January 27, 2023
    2 years ago
  • Date Published
    March 20, 2025
    a month ago
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.
Description
FIELD

The present invention relates to a method for encoding data and to a method for decoding data, in particular data which have been encoded by means of the method for encoding data.


BACKGROUND INFORMATION

In the related art, for transferring information, e.g., from sensors, measurement data of different types are transmitted via digital interfaces to data processing computer units. In such a transmission, the respective resolutions and value ranges of the data to be transmitted play an essential role.


For a given static digital encoding, the required resolution and the required value range result in a requirement for the data transmission rate that must be provided as a minimum for transmitting measurement data. Requirements in this respect are defined, for example, in the PSI specification for peripheral crash sensors, the SPI specification for inertial sensors, and the SENT specification for pressure sensors, etc.


High requirements for the resolution of measurement data in combination with a large value range to be represented of such measurement data lead to particularly high requirements for a data transmission rate for known static definitions of digital encoding. However, a resulting high data transmission rate is not necessarily required in all transmission situations. For example, measured values in certain operating states of a system are often in a relatively small value range but are required with high absolute accuracy in this range (e.g., pressure values in a brake system of a vehicle are very low during most of the operating time, but a low pressure is to be detected in order to recognize a braking request of a driver). However, if the system is in operating conditions in which a larger value range is required, it may happen that measured values with the same absolute accuracy are no longer required and that an equivalent relative resolution is sufficient.


SUMMARY

According to a first aspect of the present invention, a method for encoding data is provided, which can be used particularly advantageously, but not exclusively, for encoding measured values from sensors, e.g., from sensors of vehicles, industrial plants, home automation systems, etc.


According to an example embodiment of the present invention, the method is, for example, performed by means of an evaluation unit, which is advantageously designed as an ASIC, FPGA, processor, digital signal processor, microcontroller, or similar. The method is implemented, for example, as a computer program, which is stored in a storage unit connected to the evaluation unit by information technology and/or in a storage unit integrated in the evaluation unit and can be executed by the evaluation unit.


In a first step of the method according to an example embodiment of the present invention, a datum (which originates, for example, from a sensor, a storage unit, a computer register, etc.), which represents a numerical value from a predefined maximum value range, is received. It should be pointed out that the maximum value range may be a limited value range in comparison to a value range of originally generated (sensor) data. This may be useful if a resolution of data to be encoded is to be higher than is required in a downstream processing chain of these data. By reducing the original value range of the data to the maximum value range used for the method, an amount of data generated by the data can already be reduced initially.


In a second step of the method according to an example embodiment of the present invention, a suitable encoding rule for the datum is selected 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 the lower limit of the maximum value range and whose upper limit corresponds to a binary number that is at least one binary position (or number of bits) smaller than a binary number used for the binary representation of the upper limit of the maximum value range.


In addition, 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 the 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. In other words, the first encoding rule and the second encoding rule respectively encode different value ranges. The predefined encoding rules are stored, for example, in the aforementioned storage unit or in a different storage unit.


When selecting the encoding rule, the encoding rule whose value range contains the numerical value of the datum is always selected, wherein, in a case in which the numerical value is contained in the value ranges of a plurality of encoding rules (since the value ranges overlap, for example), the encoding rule that has the smallest lower value range limit is selected. This ensures that a numerical value currently to be encoded is always encoded with the highest possible resolution so that a total error generated by the encoding according to the present invention is kept as low as possible.


In a third step of the method according to an example embodiment of the present invention, the numerical value of the datum is encoded on the basis of the selected encoding rule by omitting all binary positions of the numerical value considered as a binary number that are of lower significance than the binary position used for the binary representation of the lower limit of the value range of the selected encoding rule (i.e., the so-called “least significant bits,” LSBs for short) and by omitting all binary positions of the numerical value considered as a binary number that are of higher significance than the binary position used for the binary representation of the upper limit of the value range of the selected encoding rule (i.e., the so-called “most significant bits,” MSBs for short). The binary positions of low significance are preferably omitted by shifting the binary positions of the numerical value to be encoded by a corresponding number of binary positions in the direction of the LSB (i.e., to the right).


In a fourth step of the method according to an example embodiment of the present invention, the binary number of the encoded numerical value is extended at a predefined position by predefined encoding information, which uniquely identifies the particular encoding rule used. The number of binary positions required for the encoding information depends on the number of encoding rules used for the method and can accordingly occupy one or more binary positions in the final encoded numerical value.


It should be pointed out in general that the method according to the present invention can also be performed without a binary representation and/or processing at the binary level and that the description given here on the basis of the binary representation serves only as a simplified explanation. Accordingly, the method can also be carried out in a decimal, hexadecimal, octal, or a different number system by using equivalent arithmetic operations.


It is furthermore understood that any existing encoding of the received datum, whose numerical value is to be encoded by means of the method according to the present invention, which is unsuitable for the omission according to the present invention of binary positions and/or for other processing steps of the method according to the present invention (e.g., a two's complement encoding of negative numerical values) is initially partially or completely decoded before processing by the method according to the present invention.


The method according to the present invention inter alia offers an advantage that a reduction of a required amount of data can be achieved, while smaller numerical values, which often have to be available with a particularly high accuracy, can be encoded in their original (high) resolution or with only a slight loss of resolution. The reduction according to the present invention of the required amount of data makes it possible, for example, to reduce a required storage requirement and/or a required data transmission rate and/or to accelerate a data transmission.


Preferred developments and example embodiments of the present invention are disclosed herein.


In a particularly advantageous embodiment of the present invention, a number of bits used for encoding the value ranges of the respective encoding rules is uniform for all encoding rules. This offers the advantage that, for example in connection with a transmission of the data encoded according to the present invention, a constant bit rate and/or a real-time-capable transmission can be achieved since the number of bits per numerical value to be encoded does not vary.


In a further advantageous embodiment of the present invention, at least a third encoding rule is additionally used in the present method and 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. In addition, it is advantageously possible to use fourth, fifth or more encoding rules, each with corresponding value ranges that differ from one another.


A number of binary positions located between respective binary representations of the lower limits of the respective value ranges is advantageously identical or substantially identical. “Substantially identical” refers to cases in which an identical number of binary positions is not possible due to a total number of binary positions that is provided for the encoded numerical value, and a number of encoding rules used. Accordingly, an approximately identical number of binary positions is to be included here. Alternatively, it is possible that a relevant number of binary positions located between the lower limits is higher, the higher the numerical values of the lower limits of the respective value ranges are. In this way, it is possible to achieve a correspondingly higher resolution for lower numerical values.


Advantageously, according to an example embodiment of the present invention, the respective lower and/or upper limits of the respective value ranges are dynamically adjusted depending on current boundary conditions. Possible boundary conditions with regard to a vehicle that uses the method according to the present invention include, for example, existing environmental conditions and/or recognized critical driving situations and/or a current speed of the vehicle, etc. This makes it possible in each case to adjust the method according to the present invention to the respective boundary conditions in an optimized manner. By adjusting the lower and/or upper limit, shifts in the value ranges for the respective encoding rules on the one hand and the scope of the respective value ranges can be optimally adjusted. Such a dynamic adjustment can be uniquely identified, for example, by adding an additional identifier to the encoded numerical value so that correct decoding is made possible. Alternatively or additionally, it is particularly advantageously possible to store information about such a dynamic adjustment in a separate datum, which is transmitted, for example, to a receiver of the encoded numerical value before the encoded numerical value is transmitted. For example, this information is only ever sent (e.g., via a separate transmission frame) to a receiver when the dynamic adjustments of the value ranges change, so that the receiver can in each case decode received encoded numerical values on the basis of the last information received.


Preferably, according to an example embodiment of the present invention, negative numerical values to be encoded are identified by means of a sign bit by which the encoded numerical value is extended at a predefined position. The position for the sign bit as well as the position for the encoding information and positions of any other information can basically be defined as desired.


The method according to the present invention is particularly preferably used for encoding measured values from sensors and/or for transmitting data between a transmitter and a receiver, in particular in a vehicle or in a home automation system. Possible sensors include radar sensors and/or lidar sensors and/or ultrasonic sensors and/or speed sensors and/or acceleration sensors and/or position sensors and/or temperature sensors and/or pressure sensors and/or other sensors.


Further preferably, according to an example embodiment of the present invention, each encoded numerical value is transmitted in a single transmission frame (also referred to as a frame) during a data transmission. This makes it possible to transmit with a particularly low time delay, which may play an important role, in particular in time-critical applications. Of course, this does not exclude the possibility that numerical values encoded according to the present invention can also be transmitted in segmented form between a transmitter and a receiver.


According to a second aspect of the present invention, a method for decoding data is provided, wherein the data to be decoded are preferably data that have been encoded by means of a method for encoding data according to the above-described embodiments of the present invention.


In a first step of the method according to an example embodiment of the present invention, a datum comprising an encoded numerical value and encoding information corresponding to the encoded numerical value is received. The process of receiving and the further processing described below take place, for example, by means of an evaluation unit, which is preferably designed similarly or identically to an evaluation unit described above for encoding data.


In a second step of the method according to an example embodiment of the present invention, a predefined decoding rule for decoding the encoded numerical value is selected, depending on the encoding information, from at least a first predefined decoding rule and a second predefined decoding rule. Advantageously, the encoding rules are stored in a storage unit connected to the evaluation unit by information technology. Preferably, respective decoding rules of the method according to the second aspect of the present invention correspond to respective encoding rules of the method according to the first aspect of the present invention in such a way that numerical values encoded by means of the respective encoding rules can be reconstructed by the respective decoding rules completely or with a resolution error introduced by the encoding.


In a third step of the method according to an example embodiment of the present invention, in order to generate a decoded binary number, the encoded numerical value considered as a binary number is shifted in the direction of binary positions of a higher significance by a number of binary positions that is defined by the selected decoding rule. 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 means of the decoded binary number. In addition, binary positions of the decoded binary number that are of higher significance than the highest binary position occupied by the shifted binary number are assigned values of 0, and binary positions of the decoded binary number that are of lower significance than the lowest binary position occupied by the shifted binary number are assigned predefined replacement values. Preferably, the replacement values are selected in such a way that an average error in the reconstruction of the decoded numerical values with respect to the originally encoded numerical values is minimized as far as possible, without necessarily requiring such a minimization.


When defining the replacement values, it is provided, for example, to assign values of 0 to each binary position of the decoded binary number to be filled by means of the replacement values, or to assign values of 1 to each binary position of the decoded binary number to be filled by means of the replacement values. It is also particularly advantageously possible to assign a value of 1 to the most significant binary position of the binary positions of the decoded binary number to be assigned replacement values and to assign a value of 0 to the other binary positions to be assigned replacement values, or to assign a value of 0 to the most significant binary position of the binary positions of the decoded binary number to be assigned replacement values and to assign a value of 1 to the other binary positions to be assigned replacement values.





BRIEF DESCRIPTION OF THE DRAWINGS

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



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



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


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.


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.


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.


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.


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


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.


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.


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.


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).


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


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.


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.


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.


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.


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.


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.



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.


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.


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.


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

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, andomitting 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; andextending 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, andwhose 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, orhigher, 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/ortransmit 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, andbinary 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, andthat 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, orthat values of 1 are assigned to each binary position of the decoded binary number to be filled by the replacement values, orthat 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, orthat 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.
Priority Claims (1)
Number Date Country Kind
10 2022 200 893.6 Jan 2022 DE national
PCT Information
Filing Document Filing Date Country Kind
PCT/EP2023/051965 1/27/2023 WO