CN115567121A - Data transmission method, system, medium and ultrasonic sensor - Google Patents

Data transmission method, system, medium and ultrasonic sensor Download PDF

Info

Publication number
CN115567121A
CN115567121A CN202211275350.XA CN202211275350A CN115567121A CN 115567121 A CN115567121 A CN 115567121A CN 202211275350 A CN202211275350 A CN 202211275350A CN 115567121 A CN115567121 A CN 115567121A
Authority
CN
China
Prior art keywords
byte
value
data
difference
type
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211275350.XA
Other languages
Chinese (zh)
Inventor
张广涛
刘巍
陈栋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zongmu Technology Shanghai Co Ltd
Original Assignee
Zongmu Technology Shanghai Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zongmu Technology Shanghai Co Ltd filed Critical Zongmu Technology Shanghai Co Ltd
Priority to CN202211275350.XA priority Critical patent/CN115567121A/en
Publication of CN115567121A publication Critical patent/CN115567121A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B11/00Transmission systems employing sonic, ultrasonic or infrasonic waves
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W28/00Network traffic management; Network resource management
    • H04W28/02Traffic management, e.g. flow control or congestion control
    • H04W28/06Optimizing the usage of the radio link, e.g. header compression, information sizing, discarding information

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

The invention provides a data transmission method, a data transmission system, a data transmission medium and an ultrasonic sensor; the method comprises the following steps: acquiring original data to be output; compressing the original data to be output to obtain compressed data to be output; sending the compressed data to be output; the invention provides a method for compressing data in an ultrasonic sensor, which can reduce the data quantity required to be output by the ultrasonic sensor by further compressing the data in the ultrasonic sensor, limit the data quantity within an interface bandwidth and realize stable output of sensing data under the existing DSI3 bandwidth.

Description

Data transmission method, system, medium and ultrasonic sensor
Technical Field
The invention belongs to the technical field of ultrasonic sensors, and particularly relates to a data transmission method, a data transmission system, a data transmission medium and an ultrasonic sensor.
Background
The ultrasonic sensor is a sensor which transmits mechanical waves with vibration frequency higher than 20kHz through an ultrasonic device, receives echoes and generates signals after the mechanical waves are reflected by an object, and outputs perception information after internal processing of an IC. The ultrasonic sensor processes the received echo signal in the IC to obtain the information of the barrier and then outputs the information to the ECU through a communication interface of the IC so as to realize the perception and the output of the environmental information; the ultrasonic wave is not influenced by the color or transparency of an object, so that the cost is low, and the ultrasonic wave is widely applied to a reversing radar and a parking system.
In the communication interface of the existing vehicle-mounted ultrasonic sensor IC, the maximum bit rate from the ECU to the ultrasonic sensor is 125kbps, and the maximum bit rate from the ultrasonic sensor to the ECU is 444kbps; the maximum data transmission rate of the existing ultrasonic sensor IC communication interface is 444kbps of DSI3, and compared with other common automobile data buses, the existing ultrasonic sensor IC communication interface belongs to a medium-speed interface; when the obstacle information that the ultrasonic sensor needs to output in unit time exceeds the bandwidth of the DSI3 interface, that is, when the throughput of the ultrasonic sensor exceeds the maximum transmission rate 444kbps of the DSI3, the existing data processing method in the ultrasonic sensor IC cannot meet the requirement.
Disclosure of Invention
In view of the above-mentioned drawbacks of the prior art, an object of the present invention is to provide a data transmission method, system, medium, and ultrasonic sensor, which can stably output sensing data in the existing DSI3 bandwidth by reducing the amount of data that the ultrasonic sensor needs to output and limiting the amount of data within the interface bandwidth.
In order to achieve the above and other related objects, the present invention provides a data transmission method applied to an ultrasonic sensor, including the steps of: acquiring original data to be output; compressing the original data to be output to obtain compressed data to be output; and sending the compressed data to be output.
In an embodiment of the present invention, the original data to be outputted includes a plurality of bytes of data; the data of a plurality of bytes are sequentially arranged in a front-back order, and in the data of the plurality of bytes, each continuous preset data of the plurality of bytes forms a numerical value, and the data of the plurality of bytes forms n numerical values; the step of compressing the original data to be output and acquiring the compressed data to be output comprises the following steps: reducing the most front numerical value to zero to obtain the first compressed data; respectively solving the difference value of two adjacent values in the n values to obtain n-1 compressed data; and the first compressed data and the n-1 compressed data form the compressed data to be output.
In an embodiment of the present invention, the reducing the top value to zero to obtain the first compressed data includes the following steps: subtracting zero from the most front value to generate first difference data; obtaining the first compressed data based on the first difference data; the step of calculating the difference value of two adjacent values in the n values to obtain n-1 compressed data comprises the following steps: respectively calculating the difference between two adjacent values in the n values to generate n-1 difference data from the 2 nd to the nth values; the n-1 compressed data are obtained based on the n-1 difference data.
In an embodiment of the present invention, the calculating the difference between two adjacent values of the n values respectively includes the following steps: judging whether the (i + 1) th numerical value is larger than the ith numerical value in the n numerical values; i is more than or equal to 1 and less than or equal to n-1; if the (i + 1) th numerical value is larger than the ith numerical value, subtracting the ith numerical value from the (i + 1) th numerical value to generate a first numerical value difference value; the first numerical difference is used as the (i + 1) th difference data; if the (i + 1) th numerical value is not larger than the (i) th numerical value, subtracting the (i + 1) th numerical value from the (i) th numerical value to generate a second numerical value difference value; the second numerical difference is taken as the i +1 th difference data.
In an embodiment of the present invention, the obtaining the n-1 compressed data based on the n-1 difference data includes the following steps: judging whether the first numerical difference is not less than a preset value; if the first numerical difference is not smaller than the preset value, the (i + 1) th compressed data occupies two bytes, each byte comprises two parts, one part is of a byte type, and the other part is of a byte value; the byte type of the byte is a first type, and the value of the byte is the difference value of the first numerical value minus the preset value plus one; the byte type of the other byte is a second type, and the value of the byte is the preset value minus one; if the first value difference is smaller than the preset value, the (i + 1) th compressed data occupies one byte, and the byte comprises two parts, wherein one part is of a byte type, and the other part is a byte value; the byte type is a second type, and the value of the byte is the first numerical difference; and/or the obtaining the n-1 compressed data based on the n-1 difference data comprises the following steps: judging whether the second numerical difference is not less than the preset value; if the second value difference is not smaller than the preset value, the (i + 1) th compressed data occupies two bytes, and each byte comprises two parts, one part is of a byte type, and the other part is a byte value; the byte type of one byte is a third type, and the value of the byte is the difference value of the second numerical value minus the preset value plus one; the byte type of another byte is a fourth type, and the value of the byte is the preset value minus one; if the second numerical difference is smaller than the preset value, the (i + 1) th compressed data occupies one byte, and the byte comprises two parts, one part is of a byte type, and the other part is a value of the byte; the byte type is a fourth type, and the value of the byte is the second numerical difference; said obtaining said first compressed data based on said first difference data comprises the steps of: judging whether the first difference data is not less than the preset value; if the first difference data is not smaller than the preset value, the first compressed data occupies two bytes, each byte comprises two parts, one part is of a byte type, and the other part is of a byte value; wherein the byte type of the byte is the first type, and the value of the byte is the first difference data minus the preset value plus one; the byte type of the other byte is the second type, and the value of the byte is the preset value minus one; if the first difference data is smaller than the preset value, the first compressed data occupies one byte, and the byte comprises two parts, wherein one part is a byte type, and the other part is a byte value; wherein the byte type is the second type, and the value of the byte is the first difference data.
The invention provides a data transmission system, which is applied to an ultrasonic sensor and comprises: the device comprises an acquisition module, a compression module and a sending module; the acquisition module is used for acquiring original data to be output; the compression module is used for compressing the original data to be output and acquiring the compressed data to be output; the sending module is used for sending the compressed data to be output.
The present invention provides a storage medium having stored thereon a computer program which, when executed by a processor, implements the above-described data transmission method.
The present invention provides an ultrasonic sensor comprising: a processor and a memory; the memory is used for storing a computer program; the processor is configured to execute the computer program stored in the memory to cause the ultrasonic sensor to perform the data transmission method described above.
The present invention provides a data transmission system, comprising: an ultrasonic device, a control unit and the ultrasonic sensor; the ultrasonic sensor is connected with the ultrasonic device and used for acquiring original data to be output generated by the ultrasonic device from the ultrasonic device; the ultrasonic sensor is also connected with the control unit and used for sending the compressed data to be output to the control unit.
In an embodiment of the invention, the control unit includes an ECU.
As described above, the data transmission method, system, medium and ultrasonic sensor according to the present invention have the following advantages:
(1) Compared with the prior art, the invention provides a method for compressing data in the ultrasonic sensor, which can reduce the data quantity required to be output by the ultrasonic sensor by further compressing the data in the ultrasonic sensor, limit the data quantity within the interface bandwidth and realize stable output of sensing data under the existing DSI3 bandwidth.
(2) The invention compresses the internal data of the ultrasonic sensor and then transmits the compressed data instead of transmitting the original data, thereby greatly reducing the data volume to be transmitted and the occupation of bandwidth, outputting the information exceeding the bandwidth limit under the communication interface of the existing vehicle-mounted sensor, being beneficial to improving the performance of the sensor and saving the cost.
Drawings
Fig. 1 is a flowchart illustrating a data transmission method according to an embodiment of the invention.
Fig. 2 is a flowchart illustrating compressing original data to be output and acquiring the compressed data to be output according to an embodiment of the present invention.
FIG. 3 is a flow chart illustrating the present invention for reducing the top value to zero to obtain the first compressed data.
FIG. 4 is a flow chart illustrating the operation of obtaining n-1 compressed data by differencing two adjacent n values according to an embodiment of the present invention.
Fig. 5 is a schematic structural diagram of a data transmission system according to an embodiment of the invention.
Fig. 6 is a schematic structural diagram of a data transmission system according to another embodiment of the invention.
Description of the reference symbols
51. Acquisition module
52. Compression module
53. Transmission module
61. Ultrasonic device
62. Control unit
63. Ultrasonic sensor
S1 to S3
S21 to S22
S211 to S212
S221 to S222
Detailed Description
The following description of the embodiments of the present invention is provided by way of specific examples, and other advantages and effects of the present invention will be readily apparent to those skilled in the art from the disclosure herein. The invention is capable of other and different embodiments and of being practiced or of being carried out in various ways, and its several details are capable of modification in various respects, all without departing from the spirit and scope of the present invention. It is to be noted that the features in the following embodiments and examples may be combined with each other without conflict.
It should be noted that the drawings provided in the following embodiments are only for illustrating the basic idea of the present invention, and the drawings only show the components related to the present invention rather than the number, shape and size of the components in actual implementation, and the type, quantity and proportion of the components in actual implementation may be changed freely, and the layout of the components may be more complicated.
Compared with the prior art, the data transmission method, the data transmission system, the medium and the ultrasonic sensor provided by the invention have the advantages that the data compression method in the ultrasonic sensor is provided, the data volume required to be output by the ultrasonic sensor is reduced by further compressing the data in the ultrasonic sensor, the data volume output through a DSI3 interface is limited within the interface bandwidth, and the sensing data can be stably output under the existing DSI3 bandwidth; the invention compresses the internal data of the ultrasonic sensor and then transmits the compressed data instead of transmitting the original data, thereby greatly reducing the data volume to be transmitted and the occupation of bandwidth, outputting the information exceeding the bandwidth limit under the communication interface of the existing vehicle-mounted sensor, being beneficial to improving the performance of the sensor and saving the cost.
The storage medium of the present invention stores thereon a computer program that realizes the data transmission method described below when executed by a processor. The storage medium includes: a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, a usb disk, a Memory card, or an optical disk, which can store program codes.
Any combination of one or more storage media may be employed. The storage medium may be a computer-readable signal medium or a computer-readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a RAM, a ROM, an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The present invention is described below with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the computer program instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable medium that can direct a computer, other programmable data processing apparatus, or other devices to function in a particular manner, such that the instructions stored in the computer-readable medium produce an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
The ultrasonic sensor of the invention comprises a processor and a memory.
The memory is used for storing a computer program; preferably, the memory comprises: various media that can store program codes, such as ROM, RAM, magnetic disk, U-disk, memory card, or optical disk.
The processor is coupled to the memory and is configured to execute the computer program stored in the memory to cause the ultrasonic sensor to perform the data transmission method described below.
Preferably, the Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, or discrete hardware components.
In one embodiment, the processor includes an IC chip.
As shown in fig. 1, in one embodiment, the data transmission method of the present invention is applied to the ultrasonic sensor; specifically, the data transmission method includes the following steps:
s1, acquiring original data to be output.
It should be noted that, the ultrasonic device emits mechanical waves with a vibration frequency higher than 20kHz, and after being reflected by an object, the ultrasonic device receives an echo and generates an echo signal; the ultrasonic sensor acquires the echo signal from the ultrasonic device, and outputs sensing information (including but not limited to whether an obstacle exists or not and the distance between the current position and the obstacle) after the echo signal is processed by an internal processor of the ultrasonic sensor, wherein the sensing information is the original data to be output.
In one embodiment, the original data to be output includes a plurality of bytes of data; the data of a plurality of bytes are arranged in sequence from front to back, and in the data of a plurality of bytes, every continuous preset data of a plurality of bytes forms a numerical value, and the data of a plurality of bytes forms n numerical values.
It should be noted that the preset value is a fixed value, and specifically how many the preset value is, depending on the actual application scenario, each numerical value to be transmitted occupies several bytes; for example, if in an actual application scenario, each to-be-transmitted data occupies two bytes, that is, a 16-bit data, then data of every two consecutive bytes in the original to-be-output data constitutes a value; assuming that the original data to be outputted includes 2m bytes, the original data to be outputted includes m (corresponding to the n values mentioned above) values.
Furthermore, the numerical values contained in the original data to be output can occupy the same byte, and can also occupy different bytes; depending on the established communication protocol.
And S2, compressing the original data to be output to obtain the compressed data to be output.
As shown in fig. 2, in an embodiment, the compressing the original data to be output and acquiring the compressed data to be output includes the following steps:
and S21, reducing the value at the top to zero to obtain the first compressed data.
As shown in fig. 3, in one embodiment, the step of reducing the most advanced value to zero to obtain the first compressed data includes the following steps:
and S211, reducing the value at the top to zero to generate first difference data.
Step S212, obtaining the first compressed data based on the first difference data.
And S22, respectively calculating the difference between two adjacent values in the n values to obtain n-1 compressed data.
It should be noted that the first compressed data and the n-1 compressed data constitute the compressed data to be output.
As shown in fig. 4, in an embodiment, the step of obtaining n-1 compressed data by subtracting two adjacent values of the n values includes the following steps:
step S221, respectively calculating the difference between two adjacent values in the n values to generate the 2 nd to nth difference data with the total number of n-1.
In an embodiment, the step of calculating the difference between two adjacent values of the n values respectively comprises the following steps: judging whether the (i + 1) th numerical value is larger than the ith numerical value in the n numerical values; i is more than or equal to 1 and less than or equal to n-1.
Specifically, if the (i + 1) th numerical value is greater than the (i) th numerical value, subtracting the (i) th numerical value from the (i + 1) th numerical value to generate a first numerical value difference; the first numerical difference is used as the (i + 1) th difference data; if the (i + 1) th numerical value is not larger than the (i) th numerical value, subtracting the (i + 1) th numerical value from the (i) th numerical value to generate a second numerical value difference value; the second numerical difference is taken as the i +1 th difference data.
And step S222, acquiring the n-1 compressed data based on the n-1 difference data.
In one embodiment, the obtaining the n-1 compressed data based on the n-1 difference data comprises the following steps: and judging whether the first numerical difference is not less than a preset value.
Specifically, if the first value difference is not less than the preset value, the (i + 1) th compressed data occupies two bytes, and each byte includes two parts, one part is a byte type, and the other part is a value of a byte; the byte type of the byte is a first type, and the value of the byte is the difference value of the first numerical value minus the preset value plus one; the byte type of the other byte is a second type, and the value of the byte is the preset value minus one; if the first value difference is smaller than the preset value, the (i + 1) th compressed data occupies one byte, and the byte comprises two parts, wherein one part is of a byte type, and the other part is a value of the byte; the byte type is a second type, and the value of the byte is the first numerical difference.
In one embodiment, the obtaining the n-1 compressed data based on the n-1 difference data comprises the following steps: and judging whether the second numerical difference is not less than the preset value.
Specifically, if the second value difference is not smaller than the preset value, the (i + 1) th compressed data occupies two bytes, and each of the bytes includes two parts, one part is a byte type, and the other part is a value of a byte; the byte type of one byte is a third type, and the value of the byte is the difference value of the second numerical value minus the preset value plus one; the byte type of the other byte is a fourth type, and the value of the byte is the preset value minus one; if the second numerical difference is smaller than the preset value, the (i + 1) th compressed data occupies one byte, and the byte comprises two parts, one part is of a byte type, and the other part is a value of the byte; and the byte type is a fourth type, and the value of the byte is the second numerical difference.
In one embodiment, the obtaining the first compressed data based on the first difference data comprises: and judging whether the first difference data is not less than the preset value.
Specifically, if the first difference data is not less than the preset value, the first compressed data occupies two bytes, and each of the bytes includes two parts, one part is of a byte type, and the other part is a value of a byte; the byte type of one byte is the first type, and the value of the byte is the sum of one and the first difference data minus the preset value; the byte type of the other byte is the second type, and the value of the byte is the preset value minus one; if the first difference data is smaller than the preset value, the first compressed data occupies one byte, and the byte comprises two parts, wherein one part is a byte type, and the other part is a byte value; wherein the byte type is the second type, and the value of the byte is the first difference data.
It should be noted that the preset value is set according to an actual application scenario, and is not limited to be set specifically.
And S3, sending the compressed data to be output.
In one embodiment, the ultrasonic sensor sends the compressed data to be output to the ECU.
It should be noted that, after the compression processing in step S2, the compressed data to be output may obtain the value that the ultrasound sensor actually wants to transmit in step S1 according to the first compressed data and the byte types and byte values of the data from the 2 nd to the nth compressed data according to the rule of the established communication protocol.
Further, the first type, the second type, the third type and the fourth type are predefined in a communication protocol, and the ECU can determine a specific parsing rule after determining a byte type of each byte in the compressed data to be output, so as to sequentially obtain values included in the original data to be output.
It should be noted that the protection scope of the data transmission method according to the present invention is not limited to the execution sequence of the steps listed in this embodiment, and all the solutions implemented by adding, subtracting, and replacing steps in the prior art according to the principle of the present invention are included in the protection scope of the present invention.
The data transmission method of the present invention is further explained below by way of specific examples.
In one embodiment, the data transmission method of the present invention is applied to a vehicle-mounted ultrasonic sensor; specifically, in the present embodiment, the raw data to be output to be transmitted by the ultrasonic sensor has 2n bytes, and each two bytes constitutes a value representing a numerical value, as shown in table 1 below.
TABLE 1
Figure BDA0003896318780000091
It should be noted that, because the 2n bytes of data need to be output in sequence, the output data amount is too large, and the bandwidth of DSI3 cannot meet the requirement; by using the data transmission method of the invention, n values which originally need 2n bytes to be expressed are compressed, and the data volume is reduced and then output.
It should be noted that, after compression, in the compressed data to be output, each byte is composed of two parts: byte type and value of the byte.
The byte types are four, the second type and the fourth type of the byte type occupy 2 bits, and the byte value occupies 6 bits; the "byte type" of the first type and the third type occupies 3 bits, and the "value of the byte" occupies 5 bits.
Further, the principle of restoring the original data to be output according to the compressed data to be output is as follows:
after receiving the compressed data to be output, the ECU analyzes the compressed data to be output according to a formulated communication protocol, sequentially determines the byte type and the value of each byte in the compressed data to be output according to the front-back sequence, and determines the numerical value contained in the original data to be output according to the byte type, the value of the byte and a preset value.
It should be noted that, since the most advanced value (i.e., the first value) is reduced to zero, the first difference data is the first value.
The first value may occupy one byte or two bytes.
Specifically, the byte type of the first byte in the compressed data to be output is determined, and if the byte type is the second type, the first numerical value in the original data to be output is the value of the byte, that is, the first difference data; if the byte type of the first byte in the compressed data to be output is the first type, the first numerical value (first difference data) in the original data to be output occupies two bytes of the compressed data to be output, wherein the byte type of the first byte is the first type, and the value of the byte is the first difference data minus a preset value plus one; the byte type of the second byte is the second type, and the value of the byte is the preset value minus one; finally, the first value in the original data to be output, which is determined according to the first byte and the second byte, is: the value of the byte of the first byte is added to the value of the byte of the second byte, i.e., the first difference data.
The subsequent 2 nd to nth numerical values in the original data to be output are obtained according to the same principle as the first numerical value; here, taking the second numerical value as an example, the following is specific:
according to the above, it is determined that the first value (i.e., the first difference data) occupies several bytes (1 or 2) first, and thus it is determined whether the second value starts from the second byte or from the third byte.
(1) If the first value occupies 1 byte, the acquisition of the second value starts from the second byte; specifically, the method comprises the following steps:
(11) If the byte type of the second byte is the first type, it means that the second difference data occupies two bytes (i.e. the second byte and the third byte), wherein the byte type of the second byte is the first type, and the value of the byte is the second difference data minus the predetermined value, plus one; the byte type of the third byte is the second type, and the value of the byte is the preset value minus one; finally, the second value is the second difference data plus the first value, and the second difference data determined from the second byte and the third byte is the product of the value of the byte of the second byte and the predetermined value, plus the value of the byte of the third byte (i.e., the value of the byte of the second byte x the predetermined value + the value of the byte of the third byte).
(12) If the byte type of the second byte is the second type, it means that the second difference data occupies one byte (i.e. the second byte), at this time, the second value is the first value plus the second difference data, and the second difference data is the value of the byte of the second byte.
(13) If the byte type of the second byte is a third type, it indicates that the second difference data occupies two bytes (i.e. the second byte and the third byte), wherein the byte type of the second byte is the third type, and the value of the byte is the second difference data minus the predetermined value, plus one; the byte type of the third byte is a fourth type, and the value of the byte is the preset value minus one; finally, the second value is the first value minus the second difference data, and the second difference data determined from the second byte and the third byte is the product of the value of the byte of the second byte and the predetermined value, plus the value of the byte of the third byte (i.e., the value of the byte of the second byte x the predetermined value + the value of the byte of the third byte).
(14) If the byte type of the second byte is the fourth type, it means that the second difference data occupies one byte (i.e. the second byte), and at this time, the second value is the first value minus the second difference data, and the second difference data is the value of the byte of the second byte.
(2) If the first numerical value occupies 2 bytes, the second numerical value is obtained from the third byte; specifically, the method comprises the following steps:
(21) If the byte type of the third byte is the first type, it indicates that the second difference data occupies two bytes (i.e. the third byte and the fourth byte), wherein the byte type of the third byte is the first type, and the value of the byte is the second difference data minus a preset value, plus one; the byte type of the fourth byte is a second type, and the value of the byte is the preset value minus one; finally, the second value is the second difference data plus the first value, and the second difference data determined from the third byte and the fourth byte is the product of the value of the byte of the third byte and the predetermined value, plus the value of the byte of the fourth byte (i.e., the value of the byte of the third byte x the predetermined value + the value of the byte of the fourth byte).
(22) If the byte type of the third byte is the second type, it means that the second difference data occupies one byte (i.e. the third byte), at this time, the second value is the first value plus the second difference data, and the second difference data is the value of the byte of the third byte.
(23) If the byte type of the third byte is a third type, it indicates that the second difference data occupies two bytes (i.e. the second byte and the third byte), wherein the byte type of the third byte is the third type, and the value of the byte is the second difference data minus a preset value, plus one; the byte type of the fourth byte is a fourth type, and the value of the byte is the preset value minus one; finally, the second value is the first value minus the second difference data, and the second difference data determined from the third byte and the fourth byte is the product of the value of the byte of the third byte and the predetermined value, plus the value of the byte of the fourth byte (i.e., the value of the byte of the third byte x the predetermined value + the value of the byte of the fourth byte).
(24) If the byte type of the third byte is the fourth type, it indicates that the second difference data occupies one byte (i.e. the third byte), and at this time, the second value is the value obtained by subtracting the second difference data from the first value, and the second difference data is the value of the byte of the third byte.
In one embodiment, the default value is set to 64, i.e. each difference data to be obtained is compared with 64, and the byte type and byte value of the compressed data are determined according to the comparison result.
It should be noted that, by calculating a difference between two adjacent values in the original data to be output, and transmitting the difference through the communication interface, the data receiving end receives and restores the original data to be output, thereby implementing compressed transmission of the data.
As shown in fig. 5, in an embodiment, the data transmission system of the invention is applied to an ultrasonic sensor, and includes an obtaining module 51, a compressing module 52 and a sending module 53.
The obtaining module 51 is configured to obtain original data to be output.
The compression module 52 is configured to compress the original data to be output, and obtain the compressed data to be output.
The sending module 53 is configured to send the compressed data to be output.
It should be noted that the structures and principles of the obtaining module 51, the compressing module 52 and the sending module 53 correspond to the steps (step S1 to step S3) in the data transmission method one by one, and therefore, the description thereof is omitted.
It should be noted that the division of the modules of the above system is only a logical division, and all or part of the actual implementation may be integrated into one physical entity or may be physically separated. And these modules can be realized in the form of software called by processing element; or may be implemented entirely in hardware; and part of the modules can be realized in the form of calling software by the processing element, and part of the modules can be realized in the form of hardware. For example, the x module may be a processing element that is set up separately, or may be implemented by being integrated in a chip of the system, or may be stored in a memory of the system in the form of program code, and the function of the x module may be called and executed by a processing element of the system. Other modules are implemented similarly. In addition, all or part of the modules can be integrated together or can be independently realized. The processing element described herein may be an integrated circuit having signal processing capabilities. In implementation, each step of the above method or each module above may be implemented by an integrated logic circuit of hardware in a processor element or an instruction in the form of software.
For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as: one or more Application Specific Integrated Circuits (ASICs), or one or more Digital Signal Processors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs), etc. For another example, when one of the above modules is implemented in the form of a Processing element scheduler code, the Processing element may be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. For another example, these modules may be integrated together and implemented in the form of a System-On-a-Chip (SOC).
As shown in fig. 6, in an embodiment, the data transmission system of the present invention includes an ultrasonic device 61, a control unit 62 and the ultrasonic sensor 63.
Specifically, the ultrasonic sensor 63 is connected to the ultrasonic device 61, and is used for acquiring raw data to be output generated by the ultrasonic device 61 from the ultrasonic device 61; the ultrasonic sensor 63 is further connected to the control unit 62, and is configured to send the compressed data to be output to the control unit 62.
In one embodiment, the control unit 62 includes an ECU.
It should be noted that the working principle of the data transmission system is the same as that of the data transmission method, and therefore, detailed description thereof is omitted.
It should be noted that the data transmission system of the present invention can implement the data transmission method of the present invention, but the implementation device of the data transmission method of the present invention includes, but is not limited to, the structure of the data transmission system illustrated in the present embodiment, and all the structural modifications and substitutions of the prior art made according to the principle of the present invention are included in the protection scope of the present invention.
In summary, compared with the prior art, the data transmission method, the data transmission system, the medium and the ultrasonic sensor of the present invention provide a method for data compression inside the ultrasonic sensor, which can reduce the data volume required to be output by the ultrasonic sensor by further compressing the data inside the ultrasonic sensor, and limit the data volume output through the DSI3 interface within the interface bandwidth, thereby realizing stable output of the sensing data under the existing DSI3 bandwidth; according to the invention, the data in the ultrasonic sensor is compressed and then transmitted instead of transmitting the original data, so that the data volume to be transmitted and the occupation of bandwidth are greatly reduced, information exceeding the bandwidth limit can be output under the communication interface of the conventional vehicle-mounted sensor, the performance of the sensor is improved, and the cost is saved; therefore, the invention effectively overcomes various defects in the prior art and has high industrial utilization value.
The foregoing embodiments are merely illustrative of the principles and utilities of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or change the above-mentioned embodiments without departing from the spirit and scope of the present invention. Accordingly, it is intended that all equivalent modifications or changes which can be made by those skilled in the art without departing from the spirit and technical spirit of the present invention be covered by the claims of the present invention.

Claims (10)

1. A data transmission method is applied to an ultrasonic sensor and is characterized by comprising the following steps:
acquiring original data to be output;
compressing the original data to be output to obtain compressed data to be output;
and sending the compressed data to be output.
2. The data transmission method according to claim 1, wherein the original data to be output includes a plurality of bytes of data; the data of a plurality of bytes are sequentially arranged in a front-back order, and in the data of the plurality of bytes, each continuous preset data of the plurality of bytes forms a numerical value, and the data of the plurality of bytes forms n numerical values; the step of compressing the original data to be output and acquiring the compressed data to be output comprises the following steps:
reducing the value at the top to zero to obtain the first compressed data;
respectively solving the difference value of two adjacent values in the n values to obtain n-1 compressed data; and the first compressed data and the n-1 compressed data form the compressed data to be output.
3. The method of claim 2, wherein the step of reducing the first value to zero to obtain the first compressed data comprises the steps of:
subtracting zero from the most front value to generate first difference data;
obtaining the first compressed data based on the first difference data;
the step of calculating the difference value of two adjacent values in the n values to obtain n-1 compressed data comprises the following steps:
respectively calculating the difference value of two adjacent numerical values in the n numerical values to generate the 2 nd to nth difference value data, wherein the n-1 difference value data is total;
the n-1 compressed data are obtained based on the n-1 difference data.
4. The data transmission method according to claim 3, wherein said calculating the difference between two adjacent values of the n values respectively comprises the steps of:
judging whether the (i + 1) th numerical value is larger than the ith numerical value in the n numerical values; i is more than or equal to 1 and less than or equal to n-1;
if the (i + 1) th numerical value is larger than the ith numerical value, subtracting the ith numerical value from the (i + 1) th numerical value to generate a first numerical value difference value; the first numerical difference is used as the (i + 1) th difference data; if the (i + 1) th numerical value is not larger than the (i) th numerical value, subtracting the (i + 1) th numerical value from the (i) th numerical value to generate a second numerical value difference value; the second numerical difference is taken as the i +1 th difference data.
5. The method according to claim 4, wherein the step of obtaining the n-1 compressed data based on the n-1 difference data comprises the steps of:
judging whether the first numerical value difference is not less than a preset value;
if the first numerical difference is not smaller than the preset value, the (i + 1) th compressed data occupies two bytes, each byte comprises two parts, one part is of a byte type, and the other part is of a byte value; the byte type of one byte is a first type, and the value of the byte is the difference value of the first numerical value minus the preset value plus one; the byte type of the other byte is a second type, and the value of the byte is the preset value minus one; if the first value difference is smaller than the preset value, the (i + 1) th compressed data occupies one byte, and the byte comprises two parts, wherein one part is of a byte type, and the other part is a value of the byte; the byte type is a second type, and the value of the byte is the first numerical difference; and/or
The obtaining the n-1 compressed data based on the n-1 difference data comprises the following steps: judging whether the second numerical difference is not less than the preset value;
if the second value difference is not smaller than the preset value, the (i + 1) th compressed data occupies two bytes, and each byte comprises two parts, one part is of a byte type, and the other part is a byte value; the byte type is a third type, and the value of the byte is the difference value of the second numerical value minus the preset value plus one; the byte type of the other byte is a fourth type, and the value of the byte is the preset value minus one; if the second numerical difference is smaller than the preset value, the (i + 1) th compressed data occupies one byte, and the byte comprises two parts, one part is of a byte type, and the other part is a value of the byte; the byte type is a fourth type, and the value of the byte is the second numerical difference;
said obtaining said first compressed data based on said first difference data comprises the steps of:
judging whether the first difference data is not less than the preset value or not;
if the first difference data is not smaller than the preset value, the first compressed data occupies two bytes, each byte comprises two parts, one part is of a byte type, and the other part is of a byte value; wherein the byte type of the byte is the first type, and the value of the byte is the first difference data minus the preset value plus one; the byte type of the other byte is the second type, and the value of the byte is the preset value minus one; if the first difference data is smaller than the preset value, the first compressed data occupies one byte, and the byte comprises two parts, one part is of a byte type, and the other part is of a byte value; wherein the byte type is the second type, and the value of the byte is the first difference data.
6. A data transmission system applied to an ultrasonic sensor is characterized by comprising: the device comprises an acquisition module, a compression module and a sending module;
the acquisition module is used for acquiring original data to be output;
the compression module is used for compressing the original data to be output and acquiring the compressed data to be output;
the sending module is used for sending the compressed data to be output.
7. A storage medium on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the data transmission method of any one of claims 1 to 5.
8. An ultrasonic sensor, comprising: a processor and a memory;
the memory is used for storing a computer program;
the processor is configured to execute the computer program stored in the memory to cause the ultrasonic sensor to perform the data transmission method of any one of claims 1 to 5.
9. A data transmission system, comprising: an ultrasonic device, a control unit and the ultrasonic sensor described in claim 8;
the ultrasonic sensor is connected with the ultrasonic device and used for acquiring original data to be output generated by the ultrasonic device from the ultrasonic device;
the ultrasonic sensor is also connected with the control unit and used for sending the compressed data to be output to the control unit.
10. The data transmission system of claim 9, wherein the control unit comprises an ECU.
CN202211275350.XA 2022-10-18 2022-10-18 Data transmission method, system, medium and ultrasonic sensor Pending CN115567121A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211275350.XA CN115567121A (en) 2022-10-18 2022-10-18 Data transmission method, system, medium and ultrasonic sensor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211275350.XA CN115567121A (en) 2022-10-18 2022-10-18 Data transmission method, system, medium and ultrasonic sensor

Publications (1)

Publication Number Publication Date
CN115567121A true CN115567121A (en) 2023-01-03

Family

ID=84767398

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211275350.XA Pending CN115567121A (en) 2022-10-18 2022-10-18 Data transmission method, system, medium and ultrasonic sensor

Country Status (1)

Country Link
CN (1) CN115567121A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110535869A (en) * 2019-09-05 2019-12-03 厦门市美亚柏科信息股份有限公司 A kind of data transmission method based on compression algorithm, terminal device and storage medium
US20200169382A1 (en) * 2018-11-26 2020-05-28 International Business Machines Corporation Encrypted and Compressed Data Transmission with Padding
CN112202623A (en) * 2020-12-03 2021-01-08 北京和利时系统工程有限公司 Data processing method and device
CN114039973A (en) * 2021-12-14 2022-02-11 中国建设银行股份有限公司 File transmission method, device and storage medium
CN114467260A (en) * 2019-09-24 2022-05-10 康蒂-特米克微电子有限公司 Lossy compressed advanced driver assistance system sensor data processing for driver assistance systems

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200169382A1 (en) * 2018-11-26 2020-05-28 International Business Machines Corporation Encrypted and Compressed Data Transmission with Padding
CN110535869A (en) * 2019-09-05 2019-12-03 厦门市美亚柏科信息股份有限公司 A kind of data transmission method based on compression algorithm, terminal device and storage medium
CN114467260A (en) * 2019-09-24 2022-05-10 康蒂-特米克微电子有限公司 Lossy compressed advanced driver assistance system sensor data processing for driver assistance systems
CN112202623A (en) * 2020-12-03 2021-01-08 北京和利时系统工程有限公司 Data processing method and device
CN114039973A (en) * 2021-12-14 2022-02-11 中国建设银行股份有限公司 File transmission method, device and storage medium

Similar Documents

Publication Publication Date Title
US20220130074A1 (en) Method, device, and storage medium for data encoding/decoding
CN108363737B (en) Data format conversion method, device and equipment
CN115208414B (en) Data compression method, data compression device, computer device and storage medium
CN113852563A (en) Message data transmission method and device, terminal equipment and readable storage medium
CN113872967A (en) Vehicle information transmission method and device, electronic equipment and storage medium
CN109299173B (en) Data transmission method, device and storage medium
CN115567121A (en) Data transmission method, system, medium and ultrasonic sensor
CN111414383B (en) Data request method, data processing system and computing device
CN102751963B (en) Based on configurable wavelet transform circuit and its implementation of multiply-accumulator ring
EP4344069A2 (en) Data compression method and apparatus and data decompression method and apparatus
CN114900796B (en) Longitude and latitude coordinate compression method based on Beidou short message transmission
CN112187369B (en) Sensor data encoding method and apparatus, electronic device, and storage medium
CN113315793A (en) Data transmission method, device, equipment and medium based on intelligent compression
CN116431585A (en) File compression method and device, and file decompression method and device
CN111385578B (en) Data decompression method applied to FPGA, imaging device and automobile
US10491241B1 (en) Data compression scheme utilizing a repetitive value within the data stream
CN104657009A (en) touch device and data processing method thereof
CN116016724B (en) Message parsing method, device, equipment and medium
WO2023070455A1 (en) Data processing method and radar chip
WO2023116731A1 (en) Method, apparatus, and medium for point cloud coding
WO2023198168A1 (en) Method, apparatus, and medium for point cloud coding
Furmanski et al. Controller area network implementation in microwave systems
CN114466088B (en) Data transmission method and device of sweeping robot, storage medium and terminal
CN113742537B (en) Construction method and device based on product tree
CN112445772A (en) Apparatus and method for data compression and decompression

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination