[go: up one dir, main page]

CN114039591B - Impedance adaptive method, device and computer readable storage medium - Google Patents

Impedance adaptive method, device and computer readable storage medium Download PDF

Info

Publication number
CN114039591B
CN114039591B CN202111227772.5A CN202111227772A CN114039591B CN 114039591 B CN114039591 B CN 114039591B CN 202111227772 A CN202111227772 A CN 202111227772A CN 114039591 B CN114039591 B CN 114039591B
Authority
CN
China
Prior art keywords
impedance
vehicle
protocol
processor
setting module
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.)
Active
Application number
CN202111227772.5A
Other languages
Chinese (zh)
Other versions
CN114039591A (en
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.)
Shenzhen Xhorse Electronics Co Ltd
Original Assignee
Shenzhen Xhorse Electronics 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 Shenzhen Xhorse Electronics Co Ltd filed Critical Shenzhen Xhorse Electronics Co Ltd
Priority to CN202111227772.5A priority Critical patent/CN114039591B/en
Publication of CN114039591A publication Critical patent/CN114039591A/en
Application granted granted Critical
Publication of CN114039591B publication Critical patent/CN114039591B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03KPULSE TECHNIQUE
    • H03K19/00Logic circuits, i.e. having at least two inputs acting on one output; Inverting circuits
    • H03K19/0175Coupling arrangements; Interface arrangements
    • H03K19/017545Coupling arrangements; Impedance matching circuits
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40215Controller Area Network CAN

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Logic Circuits (AREA)
  • Small-Scale Networks (AREA)

Abstract

本发明提供了一种阻抗自适应方法、装置和计算机可读存储介质。所述方法包括:按照CAN协议解析数字信号,获得解析结果;所述数字信号是信号采集模块采集输出信号,且将所述输出信号转换得到的;所述输出信号是车辆或车辆诊断仪发出的且经过阻抗设置模块所得到的;所述阻抗设置模块接在车辆或者车辆诊断仪的管脚之间;当所述解析结果不符合所述CAN协议时,发出控制信号以控制阻抗设置模块切换阻抗,直至所述解析结果符合所述CAN协议时,获得适配于所述管脚的目标阻抗。采用本申请的方法能够适配于多种与车辆相关的CAN总线。

The present invention provides an impedance adaptive method, device and computer-readable storage medium. The method comprises: parsing a digital signal according to the CAN protocol to obtain an analysis result; the digital signal is obtained by collecting an output signal by a signal acquisition module and converting the output signal; the output signal is emitted by a vehicle or a vehicle diagnostic instrument and obtained by an impedance setting module; the impedance setting module is connected between the pins of the vehicle or the vehicle diagnostic instrument; when the analysis result does not conform to the CAN protocol, a control signal is issued to control the impedance setting module to switch the impedance until the analysis result conforms to the CAN protocol, and a target impedance adapted to the pin is obtained. The method of the present application can be adapted to a variety of vehicle-related CAN buses.

Description

Impedance adaptation method, apparatus, and computer-readable storage medium
Technical Field
The present invention relates to the field of signal processing technologies, and in particular, to an impedance adaptive method, an impedance adaptive device, and a computer readable storage medium.
Background
In many situations, a CAN (Controller Area Network ) bus is used as a communication mode, and the specific use scene of the CAN bus is divided into a single-wire CAN, a low-speed CAN and a high-speed CAN, and the impedance modes of the three different types of CAN are different. According to the protocol of the CAN bus, the CAN bus is required to be provided with proper matching resistors at two ends so as to normally communicate. Under the condition of the known high-speed CAN, the conventional mode respectively adjusts potentiometers to realize impedance matching for CANH and CANL voltage acquisition acquired voltage values in a CAN bus network. However, the conventional impedance adaptation method is only adapted to one CAN bus, and cannot simultaneously adapt to a plurality of CAN buses.
Disclosure of Invention
In view of the foregoing, it is necessary to provide an impedance adaptive method capable of adapting to a plurality of CAN buses.
A method of impedance adaptation, the method comprising:
analyzing a digital signal according to a CAN protocol to obtain an analysis result, wherein the digital signal is obtained by acquiring an output signal by a signal acquisition module and converting the output signal, and the output signal is sent by a vehicle or a vehicle diagnostic instrument and is obtained by an impedance setting module;
and when the analysis result does not accord with the CAN protocol, a control signal is sent out to control the impedance setting module to switch the impedance until the analysis result accords with the CAN protocol, and the target impedance suitable for the vehicle or the vehicle diagnostic instrument is obtained.
The impedance self-adaptive device comprises an impedance setting module, a signal acquisition module and a processor which are sequentially connected, wherein the impedance setting module is connected between pins of a vehicle or a vehicle diagnostic instrument;
the vehicle or the vehicle diagnostic apparatus is used for sending an output signal passing through the impedance setting module to the signal acquisition module;
The signal acquisition module is used for converting the output signal into a digital signal;
The processor is used for analyzing the digital signals according to a CAN protocol to obtain analysis results;
And the processor is used for sending out a control signal to control the impedance setting module to switch the impedance when the analysis result does not accord with the CAN protocol until the analysis result accords with the CAN protocol, and obtaining the target impedance suitable for the vehicle or the vehicle diagnostic instrument.
A computer readable storage medium having stored thereon a computer program, characterized in that the computer program when executed by a processor realizes the steps of the methods in the embodiments of the application.
According to the impedance self-adaption method, the device and the computer readable storage medium, the digital signal is analyzed according to the CAN protocol to obtain the analysis result, when the analysis result does not accord with the CAN protocol, a control signal is sent to control the impedance setting module to switch the impedance, whether the impedance is matched with the pins of the vehicle or the vehicle diagnostic instrument is verified through the switching impedance, the impedance self-adaption of various CAN buses under the vehicle scene CAN be realized, and the target impedance is obtained through the actual verification rather than the voltage value, so that the accuracy is high.
Drawings
FIG. 1 is a diagram of an application environment of an impedance adaption method according to one embodiment;
FIG. 2 is a flow chart of an impedance adaption method according to an embodiment;
FIG. 3 is a diagram showing an application environment of an impedance adapting method according to another embodiment;
Fig. 4 is a flow chart of an impedance adapting method according to another embodiment.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without any inventive effort, are intended to be within the scope of the invention.
It should be noted that, in the embodiments of the present invention, all directional indicators (such as up, down, left, right, front, and rear are used only to explain the relative positional relationship, movement conditions, and the like between the components in a specific posture (as shown in the drawings), and if the specific posture is changed, the directional indicators correspondingly change, and the connection may be a direct connection or an indirect connection.
Furthermore, descriptions such as those referred to as "first," "second," and the like, are provided for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implying an order of magnitude of the indicated technical features in the present disclosure. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In addition, the technical solutions of the embodiments may be combined with each other, but it is necessary to base that the technical solutions can be realized by those skilled in the art, and when the technical solutions are contradictory or cannot be realized, the combination of the technical solutions should be considered to be absent and not within the scope of protection claimed in the present invention.
In one embodiment, as shown in fig. 1, an application environment diagram of the impedance adapting method in one embodiment is shown. The impedance setting module 120 is connected between pins of the vehicle 110 or the vehicle diagnostic apparatus 110.
The vehicle may be any vehicle and the signal acquisition module 130 may specifically be coupled between pins of an instrument panel of the vehicle. Or the signal acquisition module 130 accesses pins of an OBD (On Board Diagnostics, on-board self-diagnostic system). The signal acquisition module 130 may be an ADC (Analog to Digital Converter, analog-to-digital converter), etc.
A CAN controller and microprocessor unit (Microcontroller Unit, MCU) may be included in the processor 140. The CAN controller is used for analyzing the digital signals according to the CAN protocol to obtain an analysis result. The processor 140 may be a micro control unit (Microcontroller Unit, MCU) or the like.
The two ends of the impedance setting module 120 are respectively connected between two pins of the vehicle or between two pins of the vehicle diagnostic apparatus. The impedance setting module 120 may include different impedances. For example, the impedance setting module 120 includes an impedance adapted to the low-speed CAN bus, an impedance adapted to the high-speed CAN bus, and an impedance adapted to the single-wire CAN bus. Because the impedance setting module comprises different impedances which are already adapted to the CAN bus of the vehicle, the impedance which is adapted to the vehicle or the vehicle diagnostic instrument CAN be obtained rapidly through switching, and the impedance self-adaptation efficiency is improved.
It is understood that the impedance adapted to the low speed CAN bus, the impedance adapted to the high speed CAN bus, and the impedance adapted to the single wire CAN bus may each comprise an impedance within a range. For example, the impedance adapted to the high speed CAN bus may include resistances of 100 ohms, 110 ohms, 120 ohms, 130 ohms, 140 ohms, and 150 ohms, the impedance adapted to the low speed CAN bus may include pull-up resistances of 450 ohms, 460 ohms, 500 ohms, 510 ohms, etc., and the impedance adapted to the single wire CAN bus may be a resistance of 50 ohms, 100 ohms, or 150 ohms to ground, etc. The switching of each impedance in the impedance setting module 120 may be implemented by a switch or a MOS (Metal Oxide Semiconductor FIELD EFFECT Transistor, metal-oxide-semiconductor field effect Transistor) tube, or the like. In vehicle diagnosis, a 120 ohm resistor is usually added to a high-speed CAN bus communication CANH and a CANL bus, a low-speed CAN is connected with a 510 ohm resistor to be pulled up to 5V, a CANL is connected with the 510 ohm resistor to be grounded, and a single-wire CAN bus is connected with a 100 ohm resistor to be grounded. The architecture in fig. 1 is suitable for various vehicles and vehicle diagnostic apparatuses, and has strong versatility.
In one embodiment, as shown in fig. 2, a flow chart of an impedance adapting method in one embodiment includes:
Step 202, analyzing a digital signal according to a CAN protocol to obtain an analysis result, wherein the digital signal is obtained by collecting an output signal by a signal collecting module and converting the output signal, the output signal is sent by a vehicle or a vehicle diagnostic instrument and is obtained by an impedance setting module, and the impedance setting module is connected between pins of the vehicle or the vehicle diagnostic instrument.
The analysis result includes an arbitration section, a control section, a data section, a CRC (Cyclic Redundancy Check ) separator, and the like. The output signal is in particular an analog signal. The impedance setting module is connected between pins of the vehicle or between pins of a diagnostic apparatus of the vehicle.
The signal acquisition module acquires an output signal of the impedance setting module and converts the output signal into a digital signal under the condition that the impedance setting module sets the current set impedance. The processor receives the digital signal sent by the signal acquisition module, analyzes the data according to the CAN protocol, and obtains an analysis result.
And 204, when the analysis result does not accord with the CAN protocol, sending a control signal to control the impedance setting module to switch the impedance until the analysis result accords with the CAN protocol, and obtaining the target impedance adapted to the pin.
Specifically, when the analysis result cannot pass the CRC of the CAN protocol, the processor sends out a control signal to control the impedance setting module to switch from the current impedance to another impedance. And the processor returns to execute the step of acquiring an analysis result obtained by the CAN controller analyzing the digital signal according to the CAN protocol, and takes the impedance when the analysis result accords with the CAN protocol as the target impedance of the pin of the vehicle or the vehicle diagnostic instrument.
According to the impedance self-adaption method, the digital signal is analyzed according to the CAN protocol to obtain the analysis result, when the analysis result does not accord with the CAN protocol, a control signal is sent to control the impedance setting module to switch the impedance, whether the impedance is matched with the pins of the vehicle or the vehicle diagnostic instrument is verified through the switching impedance, the impedance self-adaption of various CAN buses related to the vehicle in a vehicle scene CAN be realized, and the target impedance is not only determined through a voltage value, but also obtained through actual verification, so that the accuracy is high.
In one embodiment, the impedance self-adaption method further comprises the step of reserving the current set impedance in the impedance setting module as the target impedance adapted to the pin when the analysis result accords with the CAN protocol.
Specifically, the processor CAN controller analyzes the digital signal according to the CAN protocol, and when the analysis result accords with the CAN protocol, the processor reserves the current set impedance in the impedance setting module as the target impedance of the pin which is adapted to the vehicle or the vehicle diagnostic instrument. In this embodiment, when the analysis result directly accords with the CAN protocol, the current set impedance in the impedance setting module is reserved, the target impedance is obtained without switching, and the switching efficiency is improved.
In one embodiment, analyzing the digital signal according to the CAN protocol to obtain an analysis result comprises verifying according to the voltage value and the waveform of the output signal acquired by the signal acquisition module, and analyzing the digital signal according to the CAN protocol to obtain the analysis result when the voltage value and the waveform of the output signal accord with the CAN waveform characteristics.
Specifically, the processor is connected with the signal acquisition module. CAN waveforms transmitted over the CAN bus have certain characteristics. For example, the high level of the electric signal is 2.5v to 5v, the low level of the electric signal is 0 to 1v, etc., and the waveform has square wave characteristics, differential signal characteristics, etc. The processor verifies according to the voltage value and the waveform of the output signal obtained by the signal acquisition module, and when the voltage value and the waveform of the output signal accord with the CAN waveform characteristics, the digital signal is analyzed according to the CAN protocol, and an analysis result is obtained. Optionally, the processor may verify based on the voltage difference and the waveform of the output signal obtained by the signal acquisition module.
In this embodiment, verification is performed according to the voltage value and the waveform of the output signal, and when the voltage value and the waveform of the output signal meet the characteristics of the CAN waveform, the control signal acquisition module transmits the digital signal to the CAN controller, so that some waveforms which do not meet the requirements CAN be filtered, frequent impedance switching is avoided, and switching accuracy is improved.
In one embodiment, after obtaining the target impedance adapted to the pin, the impedance adaptation method further comprises:
And sending the confirmation character to the CAN transceiver, so that the CAN transceiver sends the confirmation character to the vehicle or the vehicle diagnostic instrument, and the vehicle or the vehicle diagnostic instrument stops sending data according to the confirmation character.
Wherein the acknowledgement character (Acknowledge Character, ACK) is a transmission type control character that the receiving station sends to the transmitting station in data communication, indicating that the sent data has been acknowledged without errors. The processor, the CAN transceiver and the impedance setting module are connected in sequence.
Specifically, when the output signal of the vehicle or the vehicle diagnostic apparatus after passing through the impedance setting module is error-free, the processor transmits a confirmation character as a digital signal to the CAN transceiver. The CAN transceiver converts the confirmation character of the digital signal into the confirmation character of the analog signal, and then sends the confirmation character of the analog signal to the vehicle or the vehicle diagnostic apparatus through the impedance setting module, and the vehicle or the vehicle diagnostic apparatus stops sending data according to the confirmation character.
In this embodiment, the validation character is sent to the vehicle or vehicle diagnostic instrument via the CAN transceiver, which is capable of converting the character format and avoiding the vehicle or vehicle diagnostic instrument from always sending data.
In one embodiment, transmitting the acknowledge character to the CAN transceiver includes determining a CAN bus type based on a voltage value of the output signal and transmitting the acknowledge character to the CAN transceiver corresponding to the CAN bus type.
The CAN bus types comprise a single-wire CAN bus, a high-speed CAN bus and a low-speed CAN bus. The CAN transceiver includes a high-speed CAN transceiver, a low-speed CAN transceiver, a SCAN transceiver, etc.
Specifically, the processor acquires a voltage value of an output signal corresponding to the target impedance obtained by the signal acquisition module, and determines the type of the CAN bus according to the voltage value and a voltage range in which the type of the CAN bus is located. It CAN be appreciated that the output signal corresponding to the target impedance complies with the CAN protocol standard. For example, the CANH voltage of the high-speed CAN bus fluctuates between 2.5v and 3.5v, and the CANL voltage fluctuates between 1.5v and 2.5 v. Then the CAN bus type is determined to be a high speed CAN bus when the output signal conforms to the CAN protocol and CANH is 3V and CANL is 2V and CANH and CANL exhibit differential signal characteristics. The processor sends an acknowledge character to the CAN transceiver corresponding to the CAN bus type.
In this embodiment, as shown in fig. 3, an application environment diagram of an impedance adaptive method in another embodiment is shown. In fig. 3, the MCU and the CAN controller are not integrated on the same chip. Including a vehicle or vehicle diagnostic, an impedance setting module, ADC, MCU, CAN controller, a high-speed CAN transceiver, a low-speed CAN transceiver, and a SCAN transceiver. The vehicle or the vehicle diagnostic apparatus outputs a signal, and the signal is transmitted to the signal acquisition module through the impedance setting module. The signal acquisition module converts the output signal into a digital signal. And a CAN controller in the processor analyzes the digital signals according to a CAN protocol to obtain an analysis result. When the analysis result does not accord with the CAN protocol, the MCU sends a control signal to control the impedance setting module to switch the impedance until the analysis result output by the CAN controller accords with the CAN protocol, and the target impedance adapted to the pin is obtained. After switching to the target impedance, the MCU sends a confirmation character and a CAN bus type to the CAN controller, the CAN controller converts the confirmation character formatted as an analog signal into a confirmation character of a digital signal, and the confirmation character of the digital signal is sent to a CAN transceiver corresponding to the CAN bus type. I.e. to a high speed CAN transceiver, a low speed CAN transceiver or a SCAN transceiver. The CAN transceiver may send a confirmation character to the vehicle or vehicle diagnostic instrument via the impedance setting module such that the vehicle or vehicle diagnostic instrument ceases to send data.
In the embodiment, the CAN bus type is determined according to the voltage value of the output signal, the acknowledgement character is sent to the CAN transceiver corresponding to the CAN bus type, the data transmission is carried out according to the data of different CAN bus types, and the vehicle or the vehicle diagnostic instrument is ensured to be capable of receiving the acknowledgement character and stop sending the data.
In one embodiment, an impedance adaption method comprises:
And a1, verifying according to the voltage value and the waveform of the output signal acquired by the signal acquisition module, and analyzing the digital signal according to a CAN protocol to obtain an analysis result when the voltage value and the waveform of the output signal accord with the CAN waveform characteristics. The digital signal is obtained by collecting and converting the output signal by the signal collecting module, and the output signal is sent by a vehicle or a vehicle diagnostic instrument and is obtained by the impedance setting module.
And a2, when the analysis result does not accord with the CAN protocol, sending a control signal to control the impedance setting module to switch the impedance until the analysis result accords with the CAN protocol, and obtaining the target impedance adapted to the pin.
And a step a3, when the analysis result accords with the CAN protocol, reserving the current set impedance in the impedance setting module as the target impedance adapted to the pin.
And a4, when the analysis result accords with the CAN protocol, reserving the current set impedance in the impedance setting module as the target impedance of the pin which is adapted to the vehicle or the vehicle diagnostic instrument.
And a step a5, determining the type of the CAN bus according to the voltage value of the output signal.
And a6, transmitting an acknowledgement character to the CAN transceiver corresponding to the CAN bus type.
And a7, transmitting the confirmation character to the CAN transceiver, so that the CAN transceiver transmits the confirmation character to the vehicle or the vehicle diagnostic apparatus, and the vehicle or the vehicle diagnostic apparatus stops transmitting data according to the confirmation character.
According to the impedance self-adaption method, the digital signal is analyzed according to the CAN protocol to obtain the analysis result, when the analysis result does not accord with the CAN protocol, a control signal is sent to control the impedance setting module to switch the impedance, whether the impedance is matched with the pins of the vehicle or the vehicle diagnostic instrument is verified through the switching impedance, the impedance self-adaption of various CAN buses related to the vehicle in a vehicle scene CAN be realized, and the target impedance is not only determined through a voltage value, but also obtained through actual verification, so that the accuracy is high.
In one embodiment, the impedance setting module automatically switches to a target impedance between the known pins if the target impedance is known.
In one embodiment, as shown in fig. 4, a flow chart of an impedance adapting method in another embodiment is shown. After the main program is started, a module initializing operation is performed.
Module initialization operation-for example, setting the II pin of all OBDs does not configure any impedance of the OBDs. Pins that CAN occur are determined. Pins that CAN occur for CAN may be 1-9, 6-14, 3-8, 3-11, 12-13, etc.
The signal acquisition module acquires a voltage value and a waveform on a corresponding pin.
And the processor makes preliminary judgment according to the voltage value and the waveform acquired by the signal acquisition module, and judges whether the current pin is likely to be CAN data or not based on the voltage fluctuation of the CAN channel pin.
When the waveform characteristics of the CAN are met, binary data, namely digital signals, are obtained by respectively making differences between CANH and CANL according to the CAN channel pins known to appear in vehicle diagnosis, and are input to the CAN controller. After receiving the binary data, the CAN controller analyzes the data according to the CAN protocol, if the binary data accords with the CAN protocol, a normal analysis result is fed back, and if the binary data does not accord with the CAN protocol, an abnormal analysis result is fed back. And when the voltage value does not accord with the CAN waveform characteristics, returning to the step of acquiring the voltage value on the corresponding pin by the execution signal acquisition module.
Judging whether the data accords with the CAN protocol, wherein the processor decides whether the impedance needs to be switched according to the analysis result returned by the CAN controller. When the analysis result accords with the CAN protocol, the current impedance is reserved as the target impedance adapted to the pin. When the analysis result does not accord with the CAN protocol, the impedance setting module is controlled to switch the impedance, and the step of acquiring the voltage value on the corresponding pin by the signal acquisition module is returned to be executed.
In this embodiment, a processor, a signal acquisition module, a CAN controller, and an impedance setting module are used to form an impedance adaptive device. The method comprises the steps of collecting the pin voltage of a vehicle or a vehicle diagnostic instrument through a signal collecting module to conduct primary fluctuation judgment, pre-judging the possible CAN pin combination, inputting digital signals after the signal collecting module is converted into a CAN controller, checking whether the digital signals accord with CAN protocol standards through the CAN controller, and informing an MCU after the digital signals pass through the CAN controller. And when the CAN data analysis is successful and the impedance matching is successful, otherwise, the CAN controller checks that the CAN protocol is not met, and the MCU controls the impedance setting module to perform impedance switching. Repeating the above steps until the data is received normally or no data is present on the bus. Through the steps, compared with the traditional method that whether the voltage on a certain pin is used for judging whether the voltage is a certain path of data of the CAN bus or not CAN be automatically adapted to various vehicles or vehicle diagnostic apparatuses, and the obtained impedance is more accurate.
It should be understood that, although the steps in the flowcharts of fig. 2 and 4 described above are sequentially shown as indicated by arrows, and the steps a1 to a6 are sequentially shown as indicated by numerals, these steps are not necessarily sequentially performed in the order indicated by the arrows or numerals. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least a portion of the steps in fig. 2 and 4 may include a plurality of steps or stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily sequential, but may be performed in rotation or alternatively with at least a portion of the steps or stages in other steps or other steps thereof.
In one embodiment, the impedance self-adapting device comprises an impedance setting module, a signal acquisition module, a CAN controller, a processor and an impedance setting module which are sequentially connected, wherein the impedance setting module is connected between pins of a vehicle or a vehicle diagnostic instrument;
The signal acquisition module is used for acquiring output signals of pins of the vehicle or the vehicle diagnostic instrument through the impedance setting module and converting the output signals into digital signals;
the CAN controller processor is used for analyzing the digital signals according to a CAN protocol to obtain an analysis result;
And the processor is used for sending out a control signal to control the impedance setting module to switch the impedance when the analysis result does not accord with the CAN protocol until the analysis result accords with the CAN protocol, and obtaining the target impedance adapted to the pin.
According to the impedance self-adapting device, the digital signal is analyzed according to the CAN protocol to obtain the analysis result, when the analysis result does not accord with the CAN protocol, a control signal is sent to control the impedance setting module to switch the impedance, whether the impedance is matched with the pins of the vehicle or the vehicle diagnostic instrument is verified through the switching impedance, the impedance self-adapting of various CAN buses related to the vehicle CAN be realized under the vehicle scene, and the target impedance is obtained through the actual verification rather than the voltage value, so that the accuracy is high.
In one embodiment, the CAN controller is further configured to, when the analysis result conforms to the CAN protocol, reserve a currently set impedance in the impedance setting module as a target impedance adapted to the pin.
In this embodiment, when the analysis result directly accords with the CAN protocol, the current set impedance in the impedance setting module is reserved, the target impedance is obtained without switching, and the switching efficiency is improved.
In one embodiment, the processor is further connected to the output end of the signal acquisition module, and the processor is used for verifying according to the voltage value and the waveform of the output signal acquired by the signal acquisition module, and analyzing the digital signal according to the CAN protocol when the voltage value and the waveform of the output signal accord with the CAN waveform characteristics.
In the embodiment, verification is performed according to the voltage value and the waveform of the output signal, and when the voltage value and the waveform meet the CAN waveform characteristics, the control signal acquisition module transmits the digital signal to the CAN controller, so that some waveforms which do not meet the requirements CAN be filtered out in the front section, frequent impedance switching is avoided, and switching accuracy is improved.
In one embodiment, the device further comprises a CAN transceiver, one end of the CAN transceiver is connected with the processor, and the other end of the CAN transceiver is connected with the impedance setting module;
the processor is further configured to send an acknowledgement character to the CAN transceiver after obtaining the target impedance;
the CAN transceiver is used for sending the confirmation character to the vehicle or the vehicle diagnostic instrument;
The vehicle or the vehicle diagnostic apparatus is used to stop transmitting data according to the confirmation character.
In this embodiment, the validation character is sent to the vehicle or vehicle diagnostic instrument via the CAN transceiver, which is capable of converting the character format and avoiding the vehicle or vehicle diagnostic instrument from always sending data.
In one embodiment, the processor is configured to determine the CAN bus type based on the output signal;
The processor sends an acknowledge character to the CAN transceiver corresponding to the CAN bus type.
In the embodiment, the CAN bus type is determined according to the voltage value of the output signal, the acknowledgement character is sent to the CAN transceiver corresponding to the CAN bus type, the data transmission is carried out according to the data of different CAN bus types, and the vehicle or the vehicle diagnostic instrument is ensured to be capable of receiving the acknowledgement character and stop sending the data. For specific limitations of the impedance adaption device, reference may be made to the above limitation of the impedance adaption method, which is not repeated here. The various modules in the impedance adaption apparatus described above may be implemented in whole or in part by software, hardware, or a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when executed by a processor, implements the steps of the method embodiments described above.
In one embodiment, a computer program product or computer program is provided that includes computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the steps of the method embodiments described above.
Those skilled in the art will appreciate that implementing all or part of the above described methods in accordance with the embodiments may be accomplished by way of a computer program stored in a non-transitory computer readable storage medium, which when executed may comprise the steps of the above described embodiments of the methods. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, or the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory. By way of illustration, and not limitation, RAM can be in various forms such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), etc.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the invention, and all equivalent structures or equivalent processes using the descriptions and drawings of the present invention or directly or indirectly applied to other related technical fields are included in the scope of the invention.

Claims (11)

1.一种阻抗自适应方法,其特征在于,所述方法包括:1. An impedance adaptation method, characterized in that the method comprises: 按照CAN协议解析数字信号,获得解析结果;所述数字信号是信号采集模块采集输出信号,且将所述输出信号转换得到的;所述输出信号是车辆或车辆诊断仪发出的且经过阻抗设置模块所得到的;所述阻抗设置模块接在车辆或者车辆诊断仪的管脚之间;The digital signal is analyzed according to the CAN protocol to obtain the analysis result; the digital signal is obtained by collecting the output signal of the signal acquisition module and converting the output signal; the output signal is sent by the vehicle or the vehicle diagnostic instrument and obtained by the impedance setting module; the impedance setting module is connected between the pins of the vehicle or the vehicle diagnostic instrument; 当所述解析结果无法通过所述CAN协议的CRC校验时,发出控制信号以控制阻抗设置模块切换阻抗,直至所述解析结果符合所述CAN协议时,获得适配于所述管脚的目标阻抗。When the analysis result cannot pass the CRC check of the CAN protocol, a control signal is sent to control the impedance setting module to switch the impedance until the analysis result conforms to the CAN protocol, thereby obtaining a target impedance adapted to the pin. 2.根据权利要求1所述的方法,其特征在于,所述方法还包括:2. The method according to claim 1, characterized in that the method further comprises: 当所述解析结果符合所述CAN协议时,保留所述阻抗设置模块中的当前设置阻抗,作为适配于所述管脚的目标阻抗。When the analysis result complies with the CAN protocol, the currently set impedance in the impedance setting module is retained as the target impedance adapted to the pin. 3.根据权利要求1所述的方法,其特征在于,所述按照CAN协议解析数字信号,获得解析结果,包括:3. The method according to claim 1, characterized in that the step of parsing the digital signal according to the CAN protocol to obtain the parsing result comprises: 根据所述信号采集模块所采集的输出信号的电压值和波形进行验证,当所述输出信号的电压值和波形符合CAN波形特征时,按照CAN协议解析数字信号,获得解析结果。Verification is performed based on the voltage value and waveform of the output signal collected by the signal acquisition module. When the voltage value and waveform of the output signal meet the CAN waveform characteristics, the digital signal is analyzed according to the CAN protocol to obtain the analysis result. 4.根据权利要求1所述的方法,其特征在于,在所述获得适配于所述管脚的目标阻抗之后,所述方法还包括:4. The method according to claim 1, characterized in that after obtaining the target impedance adapted to the pin, the method further comprises: 向CAN收发器发送确认字符,使得所述CAN收发器将所述确认字符发送至所述车辆或所述车辆诊断仪,所述车辆或所述车辆诊断仪根据所述确认字符停止发送数据。A confirmation character is sent to the CAN transceiver, so that the CAN transceiver sends the confirmation character to the vehicle or the vehicle diagnostic instrument, and the vehicle or the vehicle diagnostic instrument stops sending data according to the confirmation character. 5.根据权利要求4所述的方法,其特征在于,所述向CAN收发器发送确认字符,包括:5. The method according to claim 4, characterized in that the sending of a confirmation character to the CAN transceiver comprises: 根据所述输出信号的电压值确定CAN总线类型;Determining the CAN bus type according to the voltage value of the output signal; 向与所述CAN总线类型对应的CAN收发器发送确认字符。An acknowledgement character is sent to the CAN transceiver corresponding to the CAN bus type. 6.一种阻抗自适应装置,其特征在于,包括依次连接的阻抗设置模块、信号采集模块和处理器;所述阻抗设置模块接在车辆或者车辆诊断仪的管脚之间;6. An impedance adaptive device, characterized in that it comprises an impedance setting module, a signal acquisition module and a processor connected in sequence; the impedance setting module is connected between the pins of a vehicle or a vehicle diagnostic instrument; 所述车辆或所述车辆诊断仪用于向所述信号采集模块发出经过所述阻抗设置模块的输出信号;The vehicle or the vehicle diagnostic instrument is used to send an output signal passing through the impedance setting module to the signal acquisition module; 所述信号采集模块用于将所述输出信号转换为数字信号;The signal acquisition module is used to convert the output signal into a digital signal; 所述处理器用于按照CAN协议解析所述数字信号,获得解析结果;The processor is used to parse the digital signal according to the CAN protocol to obtain a parsing result; 所述处理器用于当所述解析结果无法通过所述CAN协议的CRC校验时,发出控制信号以控制所述阻抗设置模块切换阻抗,直至所述解析结果符合所述CAN协议时,获得适配于所述管脚的目标阻抗。The processor is used for sending a control signal to control the impedance setting module to switch impedance when the analysis result fails to pass the CRC check of the CAN protocol, until the analysis result conforms to the CAN protocol, and a target impedance adapted to the pin is obtained. 7.根据权利要求6所述的装置,其特征在于,所述处理器还用于当所述解析结果符合所述CAN协议时,保留所述阻抗设置模块中的当前设置阻抗,作为适配于所述管脚的目标阻抗。7. The device according to claim 6 is characterized in that the processor is further used to retain the current set impedance in the impedance setting module as the target impedance adapted to the pin when the analysis result complies with the CAN protocol. 8.根据权利要求6所述的装置,其特征在于,所述处理器还与所述信号采集模块的输出端相连;8. The device according to claim 6, characterized in that the processor is also connected to the output end of the signal acquisition module; 所述处理器用于根据所述信号采集模块所采集的输出信号的电压值与波形进行验证,当所述输出信号的电压值以及波形符合CAN波形特征时,按照CAN协议解析所述数字信号。The processor is used to verify the voltage value and waveform of the output signal collected by the signal acquisition module, and when the voltage value and waveform of the output signal meet the CAN waveform characteristics, parse the digital signal according to the CAN protocol. 9.根据权利要求6所述的装置,其特征在于,所述装置还包括CAN收发器,所述CAN收发器的一端与所述处理器连接,另一端与所述阻抗设置模块连接;9. The device according to claim 6, characterized in that the device further comprises a CAN transceiver, one end of the CAN transceiver is connected to the processor, and the other end of the CAN transceiver is connected to the impedance setting module; 所述处理器还用于在获得目标阻抗之后,向所述CAN收发器发送确认字符;The processor is further configured to send a confirmation character to the CAN transceiver after obtaining the target impedance; 所述CAN收发器用于将所述确认字符发送至所述车辆或所述车辆诊断仪;The CAN transceiver is used to send the confirmation character to the vehicle or the vehicle diagnostic instrument; 所述车辆或所述车辆诊断仪用于根据所述确认字符停止发送数据。The vehicle or the vehicle diagnostic instrument is used to stop sending data according to the confirmation character. 10.根据权利要求9所述的装置,其特征在于,所述处理器用于根据输出信号确定CAN总线类型;10. The device according to claim 9, characterized in that the processor is used to determine the CAN bus type according to the output signal; 所述处理器向所述与所述CAN总线类型对应的CAN收发器发送确认字符。The processor sends a confirmation character to the CAN transceiver corresponding to the CAN bus type. 11.一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至5任一项所述的方法的步骤。11. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
CN202111227772.5A 2021-10-21 2021-10-21 Impedance adaptive method, device and computer readable storage medium Active CN114039591B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111227772.5A CN114039591B (en) 2021-10-21 2021-10-21 Impedance adaptive method, device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111227772.5A CN114039591B (en) 2021-10-21 2021-10-21 Impedance adaptive method, device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN114039591A CN114039591A (en) 2022-02-11
CN114039591B true CN114039591B (en) 2025-06-17

Family

ID=80141700

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111227772.5A Active CN114039591B (en) 2021-10-21 2021-10-21 Impedance adaptive method, device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN114039591B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115695103B (en) * 2022-11-21 2024-05-17 深圳数马电子技术有限公司 Impedance self-adaption method, device, computer equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103067241A (en) * 2013-01-15 2013-04-24 中联重科股份有限公司 CAN bus signal transmission device and test system
CN103200062A (en) * 2013-03-29 2013-07-10 北京经纬恒润科技有限公司 Controller area network (CAN) bus data transceiver
CN105278411A (en) * 2015-10-28 2016-01-27 新誉轨道交通科技有限公司 High-speed CAN bus self-adaptive impedance matching module, method and system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102605056B1 (en) * 2017-03-08 2023-11-24 로베르트 보쉬 게엠베하 Method for mitigating transient-based attacks on key agreement methods over instrumentation controller networks
CN209860931U (en) * 2019-05-21 2019-12-27 天津卡达克数据有限公司 Intelligent CAN bus diagnosis monitor

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103067241A (en) * 2013-01-15 2013-04-24 中联重科股份有限公司 CAN bus signal transmission device and test system
CN103200062A (en) * 2013-03-29 2013-07-10 北京经纬恒润科技有限公司 Controller area network (CAN) bus data transceiver
CN105278411A (en) * 2015-10-28 2016-01-27 新誉轨道交通科技有限公司 High-speed CAN bus self-adaptive impedance matching module, method and system

Also Published As

Publication number Publication date
CN114039591A (en) 2022-02-11

Similar Documents

Publication Publication Date Title
JP7346787B2 (en) Electronic device security system
CN105282209B (en) Network system for vehicle and data transmission method of heterogeneous communication controller therein
CN109656172B (en) Method and device for obtaining baud rate
US7717085B1 (en) Virtual throttle position sensor diagnostics with a single channel throttle position sensor
US11584314B2 (en) Collision detection on a can bus
US6829726B1 (en) Method and system for testing a universal serial bus within a computing device
US9082242B2 (en) Vehicle network health assessment
US10826719B2 (en) Node and method for conducting measurements and signal analyses on a multi-master access bus
US11368330B2 (en) Error frame detection
JP6883701B2 (en) How to detect a short circuit with a transmitter / receiver for a CAN bus system and a CAN transmitter / receiver
CN109861795B (en) CANFD bus system sampling point configuration and test method and corresponding data transmission method
CN114039591B (en) Impedance adaptive method, device and computer readable storage medium
CN112230948B (en) Vehicle CAN communication system, software upgrading method, equipment and system and vehicle
CN108445860A (en) Diagnostic device, diagnosis request processing method and computer readable storage medium
CN113406944A (en) Vehicle diagnosis method, apparatus, device and computer readable storage medium
CN114911214A (en) An integrated testing device and testing method based on XCP protocol
JP2015053633A (en) Communications system
US12113647B2 (en) Controller area network apparatus with reconfiguration signalling
CN115695103B (en) Impedance self-adaption method, device, computer equipment and storage medium
WO2022092263A1 (en) Ground short failure detection device and node device
CN117896038B (en) Gateway connected to a master processor and a plurality of slave devices and method for operating the gateway
JP3401361B2 (en) Multiplex transmission system
CN111740888B (en) Ignition signal synchronization method and related equipment
CN118400232A (en) Baud rate self-adaption method and device based on multiple data analysis modules
CN111416761A (en) CAN waveform simulation device, simulation method and CAN waveform transmitter

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
GR01 Patent grant
GR01 Patent grant