CN115695103A - Impedance self-adaption method and device, computer equipment and storage medium - Google Patents
Impedance self-adaption method and device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN115695103A CN115695103A CN202211454817.7A CN202211454817A CN115695103A CN 115695103 A CN115695103 A CN 115695103A CN 202211454817 A CN202211454817 A CN 202211454817A CN 115695103 A CN115695103 A CN 115695103A
- Authority
- CN
- China
- Prior art keywords
- impedance
- signal
- baud rate
- protocol type
- bus signal
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 52
- 230000009191 jumping Effects 0.000 claims abstract description 25
- 230000006978 adaptation Effects 0.000 claims description 20
- 238000004590 computer program Methods 0.000 claims description 15
- 238000001514 detection method Methods 0.000 claims description 7
- 230000006854 communication Effects 0.000 description 29
- 238000004891 communication Methods 0.000 description 28
- 230000007704 transition Effects 0.000 description 15
- 238000010586 diagram Methods 0.000 description 14
- 230000003044 adaptive effect Effects 0.000 description 8
- 230000008569 process Effects 0.000 description 6
- 230000005540 biological transmission Effects 0.000 description 4
- 230000008859 change Effects 0.000 description 2
- 238000007796 conventional method Methods 0.000 description 2
- 230000008878 coupling Effects 0.000 description 2
- 238000010168 coupling process Methods 0.000 description 2
- 238000005859 coupling reaction Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000000630 rising effect Effects 0.000 description 2
- 238000012360 testing method Methods 0.000 description 2
- 238000012795 verification Methods 0.000 description 2
- 230000002411 adverse Effects 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 230000008094 contradictory effect Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Images
Landscapes
- Small-Scale Networks (AREA)
Abstract
The application relates to an impedance self-adaption method, an impedance self-adaption device, computer equipment and a storage medium. The method comprises the following steps: receiving a bus signal; determining a protocol type of the bus signal based on a voltage value of the bus signal; detecting the jumping duration of a jumping edge in the bus signal; under the condition that the jump duration meets a target condition, acquiring a signal baud rate of the bus signal; and under the condition that the signal baud rate meets the baud rate corresponding to the protocol type, determining the configured impedance as the target impedance corresponding to the protocol type. By adopting the method, the target impedance matched with the bus signal can be rapidly and accurately configured.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to an impedance self-adaptation method, apparatus, computer device, and storage medium.
Background
In the communication process, the counterpart device is a device supporting some kind of bus communication, but the counterpart device may switch among a plurality of protocol standards when communicating, and whether the counterpart device has a corresponding impedance may also change. Under the condition of no impedance, the waveform transmitted by the opposite device is disordered and difficult to recognize. The traditional mode adopts the mode of continuously switching impedance until a better waveform is obtained, and has the problem of low efficiency.
Disclosure of Invention
In view of the above, there is a need to provide an impedance adaptive method, apparatus, computer device and storage medium, which can quickly and accurately configure a target impedance matching a bus signal.
An impedance adaptation method, the method comprising:
receiving a bus signal;
determining a protocol type of the bus signal based on a voltage value of the bus signal;
detecting the jumping duration of jumping edges in the bus signals;
under the condition that the jump duration meets a target condition, acquiring a signal baud rate of the bus signal;
and under the condition that the signal baud rate meets the baud rate corresponding to the protocol type, determining the configured impedance as the target impedance corresponding to the protocol type.
An impedance adaptive device, the device comprising:
the receiving module is used for receiving the bus signal;
the protocol type determining module is used for determining the protocol type of the bus signal based on the voltage value of the bus signal;
a jumping duration detection module, configured to detect a jumping duration of a jumping edge in the bus signal;
a baud rate obtaining module, configured to obtain a signal baud rate of the bus signal when the transition duration satisfies a target condition;
and the target impedance determining module is used for determining the configured impedance as the target impedance corresponding to the protocol type under the condition that the signal baud rate accords with the baud rate corresponding to the protocol type.
A computer device comprising a memory storing a computer program and a processor implementing the steps of the impedance adaptation method embodiments when executing the computer program.
A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the respective impedance adaptation method embodiment.
The impedance self-adapting method, the impedance self-adapting device, the computer equipment and the storage medium determine the protocol type of the bus signal based on the voltage value of the bus signal, and the obtained protocol type may be wrong at the moment; detecting the jump duration of a jump edge in a bus signal, and acquiring the baud rate of the bus signal, namely the distortion of the signal under the condition that the jump duration meets a target condition, so that the opposite equipment is not provided with impedance; at the moment, whether the protocol type is the correct protocol type is verified, and under the condition that the signal baud rate accords with the baud rate corresponding to the protocol type, the protocol type is the correct protocol type; the configured impedance is determined to be the target impedance corresponding to the protocol type, and the target impedance matched with the bus signal can be rapidly and accurately configured, so that reliable communication connection is rapidly established.
Drawings
FIG. 1 is a diagram of an exemplary implementation of the adaptive impedance method;
FIG. 2 is a flow diagram illustrating an exemplary implementation of an impedance adaptation method;
FIG. 3 is a waveform diagram of a standard bus signal and a transmitted bus signal in one embodiment;
FIG. 4 is a schematic waveform diagram of a CANH signal and a CANL signal of a single-wire CAN in one embodiment;
FIG. 5 is a schematic waveform diagram of a standard CANH signal and a standard CANL signal of a two-wire CAN in one embodiment;
FIG. 6 is a flow chart illustrating an adaptive impedance method according to another embodiment;
FIG. 7 is a block diagram of the impedance adaptation means in one embodiment;
FIG. 8 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of and not restrictive on the broad application.
The technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without inventive step, are within the scope of the present disclosure.
It should be noted that all directional indicators (such as up, down, left, right, front, back, 8230; \8230;) in the embodiments of the present application are only used to explain the relative positional relationship between the components, the movement, etc. in a specific posture (as shown in the attached drawings), and if the specific posture is changed, the directional indicators are changed accordingly, and the connection may be a direct connection or an indirect connection.
In addition, descriptions in this application as to "first", "second", etc. are for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicit to the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the feature. In addition, technical solutions between the embodiments may be combined with each other, but must be based on the realization of the technical solutions by a person skilled in the art, and when the technical solutions are contradictory to each other or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope claimed in the present application.
The terms "first," "second," and the like, as used herein, may be used herein to describe various data, but the data is not limited by these terms. These terms are only used to distinguish one datum from another. For example, a first amplitude may be referred to as a second amplitude, and similarly, a second amplitude may be referred to as a first amplitude, without departing from the scope of the present application. The first amplitude and the second amplitude are both amplitudes, but they are not the same amplitude.
It is to be understood that "connection" in the following embodiments is to be understood as "electrical connection", "communication connection", and the like if the connected circuits, modules, units, and the like have communication of electrical signals or data with each other.
The impedance self-adapting method provided by the application can be applied to the application environment as shown in FIG. 1. Fig. 1 is a diagram of an application environment of the adaptive impedance method in one embodiment. Including counterparty device 110 and self device 120. Each of the other device 110 and the own device 120 may be, but is not limited to, various FPGAs (Field programmable Gate arrays), personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices. Partner device 110 sends a bus signal to own device 120 via the bus. The own device 120 receives the bus signal and performs impedance adaptation.
In an embodiment, as shown in fig. 2, a flowchart of the impedance adaptation method in an embodiment is illustrated, taking the own device 120 in fig. 1 as an example, and includes:
in step 202, a bus signal is received.
Specifically, the partner device transmits a bus signal to the own device, and the own device receives the bus signal. Wherein the bus signals may be signals transmitted over buses having different protocol types. Such as the bus may be a CAN bus or the like.
And step 204, determining the protocol type of the bus signal based on the voltage value of the bus signal.
Wherein, the protocol types refer to different protocol types of the same bus. Protocol types such as CAN protocol include single-wire CAN and two-wire CAN.
Specifically, taking the CAN bus as an example, the CANH signal of the two-wire CAN and the CANL signal have opposite phases, the CANH signal of the single-wire CAN has fluctuation, and the CANL signal is almost a straight line and has no fluctuation. The protocol type of the bus signal can be determined by the own device by detecting whether the signal fluctuation of the CANL signal meets the fluctuation threshold condition.
Specifically, the own device detects the duration of the transition edge in the detection bus signal. The transition edge may be a rising edge or a falling edge. The voltage value difference between the two ends of the jump edge is larger. The transition duration refers to the duration of time when the voltage begins to change to steady. The preset duration can be configured as required. The specific preset duration may be slightly longer than the duration of the transition of the bus signal with the adaptive impedance.
Fig. 3 is a schematic waveform diagram of a standard bus signal and a transmitted bus signal in one embodiment. FIG. 3 (a) is a standard bus signal. The signal in fig. 3 (a) is a waveform with impedance and the transition duration is almost zero. Fig. 3 (b) shows the bus signal after transmission. In fig. 3 (b), both the rising and falling edges of the signal are distorted. Then, whether the opposite equipment has impedance can be obtained by detecting the jumping duration of the jumping edge.
And step 208, acquiring the signal baud rate of the bus signal under the condition that the jump duration meets the target condition.
Wherein the target condition is used for characterizing that the jump time is longer. Then, the target condition may be that the absolute value of the transition slope obtained by the ratio of the transition duration to the amplitude is smaller than the preset slope.
Specifically, when the hop duration satisfies the target condition, it indicates that the hop duration is long, the impedance is not configured in the other device, and the other device can obtain the signal baud rate of the bus signal. The signal baud rate may be obtained by an oscilloscope, or by communicating with a device of the other party, or by a baud rate adaptive method.
Taking the CAN protocol as an example, the target impedance includes a target single-wire CAN impedance, a target low-speed CAN impedance, and a target high-speed CAN impedance. And the mapping relation between the protocol type, the baud rate and the target impedance is prestored in the own equipment. Baud rate alignment: single wire CAN > low speed CAN > high speed CAN.
Specifically, under the condition that the signal baud rate accords with the baud rate corresponding to the single-wire CAN, the own device determines that the configured impedance is the target single-wire CAN impedance corresponding to the single-wire CAN. When the protocol type is a double-wire CAN, the corresponding baud rates are two, one is the baud rate of the high-speed CAN, and the other is the high-speed baud rate for short; one is the baud rate of low-speed CAN, referred to as low-speed baud rate for short. And under the condition that the signal baud rate accords with the high-speed baud rate corresponding to the double-wire CAN, the own equipment determines that the configured impedance is the target high-speed CAN impedance corresponding to the double-wire CAN. And under the condition that the signal baud rate accords with the low-speed baud rate corresponding to the two-wire CAN, the own equipment determines that the configured impedance is the target low-speed CAN impedance corresponding to the two-wire CAN. The own device enables the target impedance at which to communicate with the counterpart device.
In this embodiment, the protocol type of the bus signal is determined based on the voltage value of the bus signal, and the obtained protocol type may be wrong at this time; detecting the jump duration of a jump edge in a bus signal, and acquiring the signal baud rate of the bus signal under the condition that the jump duration meets a target condition, namely the signal is distorted, which indicates that the opposite device is not provided with impedance; at the moment, whether the protocol type is the correct protocol type is verified, and under the condition that the signal baud rate accords with the baud rate corresponding to the protocol type, the protocol type is the correct protocol type; the configured impedance is determined to be the target impedance corresponding to the protocol type, and the target impedance matched with the bus signal can be rapidly and accurately configured, so that reliable communication connection is rapidly established.
In one embodiment, the bus signals include a CANH signal and a differential signal.
Determining a protocol type of the bus signal based on the voltage value of the bus signal, including: acquiring a first amplitude of a CANH signal and a second amplitude of a differential signal; determining a difference between the second amplitude and the first amplitude; when the difference is larger than the preset amplitude difference, determining the protocol type of the bus signal as a two-wire CAN; and when the difference is smaller than or equal to the preset amplitude difference, determining the protocol type of the bus signal as a single-wire CAN.
The differential signal is a signal obtained by subtracting the CANH signal and the CANL signal. The differential signal can effectively remove noise in the signal. The preset amplitude difference value can be set according to requirements. The selection range of the preset amplitude difference is the end signal amplitude which is less than 2 times and is greater than the CANH-CANL amplitude. The amplitude of the CANH may specifically be chosen.
Specifically, in an ideal case, only one CANH signal of the single-wire CAN fluctuates, but since signal coupling may exist in the single-wire CAN, a CANL signal may fluctuate in the same phase as the CANH but with a smaller amplitude. Fig. 4 is a schematic diagram showing waveforms of a CANH signal and a CANL signal of the single-wire CAN in one embodiment. Then the protocol type to which the signal corresponds cannot be detected at this time by measuring the CANL signal alone.
Fig. 5 is a schematic waveform diagram of a CANH signal and a CANL signal of a two-wire CAN in one embodiment. In the two-wire CAN, the CANH signal and CANL signal have opposite phases, and similarly, the CANH signal and CANL signal without impedance have opposite phases. The amplitude of the differential signal should be approximately 2 times the amplitude of the signal at each end, and the differential signal should be greater than the amplitude of the CANH signal. Therefore, when the difference is greater than the preset amplitude difference, the protocol type of the bus signal is determined to be the two-wire CAN. In the single-wire CAN, because a CANL signal exists at a CANL end due to coupling, the amplitude of the differential signal should be smaller than or equal to the amplitude of the CANH signal, and therefore, when the difference value is smaller than or equal to a preset amplitude difference value, the protocol type of the bus signal is determined to be the single-wire CAN.
In this embodiment, by determining the difference between the amplitude of the CANH signal and the amplitude of the differential signal, when the difference satisfies the corresponding difference condition, the protocol type of the bus signal is determined, which is more accurate than the conventional method.
In one embodiment, the protocol type is single wire CAN. The impedance self-adapting method further comprises the following steps: and under the condition that the jump duration time meets the target condition, configuring the impedance to be the target single-wire CAN impedance corresponding to the single-wire CAN. Determining the configured impedance as a target impedance corresponding to the protocol type, including: and determining the configured impedance as the target single-wire CAN impedance corresponding to the single-wire CAN.
Specifically, under the condition that the protocol type is the single-wire CAN, the jump duration of a jump edge in a CANH signal is detected. When the jump duration meets the target condition, the impedance of the counterpart device is not provided, so that the impedance is configured to be the target single-wire CAN impedance corresponding to the single-wire CAN. Further, the own device detects the signal baud rate of the bus signal, and determines the configured impedance as the target impedance corresponding to the protocol type under the condition that the signal baud rate meets the baud rate corresponding to the protocol type. And under the condition that the jump duration does not meet the target condition, the impedance of the opposite equipment is explained, so that impedance self-adaption is not needed.
In this embodiment, when the hop duration satisfies the target condition, it is stated that the opposite device does not have an impedance, and when the protocol type is the single-wire CAN, the impedance is configured to be a target single-wire CAN impedance corresponding to the single-wire CAN, so that the received signal is better, and communication CAN be established or recovered quickly.
In one embodiment, the impedance adaptation method further comprises: and under the condition that the signal baud rate does not accord with the baud rate corresponding to the single-wire CAN, determining that the protocol type corresponding to the bus signal is the double-wire CAN, and returning to the step of detecting the jumping duration of the jumping edge in the bus signal.
Specifically, the signal is disturbed during transmission, so that CANL signal fluctuation of the two-wire CAN is small, and the two-wire CAN is mistaken for the single-wire CAN. And then verifying through the signal baud rate, and under the condition that the signal baud rate does not accord with the baud rate corresponding to the single-wire CAN, indicating that the protocol type is not the single-wire CAN, and then considering that the probability is the double-wire CAN, and then executing the step of detecting the jumping duration of the jumping edge in the bus signal. Wherein the bus signals in the step may be differential signals. And finally verifying through the baud rate, correcting errors, realizing impedance self-adaption, and quickly establishing or recovering communication.
In one embodiment, determining the configured impedance as a target impedance corresponding to the protocol type when the signal baud rate meets the baud rate corresponding to the protocol type includes: under the condition that the signal baud rate accords with the low-speed baud rate corresponding to the two-wire CAN, determining the configured impedance as the target low-speed CAN impedance; and under the condition that the signal baud rate accords with the high-speed baud rate corresponding to the double-wire CAN, determining the configured impedance as the target high-speed CAN impedance.
In this embodiment, when the protocol type is a two-wire CAN, there are two corresponding baud rates, one is the baud rate of a high-speed CAN, which is referred to as a high-speed baud rate for short; one is the baud rate of the low-speed CAN, which is called the low-speed baud rate for short, so that under the condition that the protocol type is determined to be the double-wire CAN, the baud rate of the signal is determined to meet the low-speed baud rate or the high-speed baud rate, the protocol type and the impedance CAN be determined more accurately, and the communication CAN be established or recovered quickly.
In one embodiment, the impedance adaptation method further comprises: and under the condition that the protocol type is a two-wire CAN and the jump duration does not meet the target condition, configuring the impedance as the target high-speed CAN impedance.
Specifically, when the protocol type is a two-wire CAN and the hop duration does not satisfy the target condition, the impedance is configured as a target high-speed CAN impedance, the target high-speed CAN impedance is enabled, and communication with the counterpart device is performed based on the target high-speed CAN impedance.
In this embodiment, it is found through tests that, in a two-wire CAN, no matter a high-speed CAN or a low-speed CAN, a high-speed CAN impedance is configured first, and the waveform quality is good, so that the waveform distortion CAN be reduced.
In one embodiment, the impedance adaptation method further comprises: and when at least one of the amplitude, the jump duration and the baud rate of the bus signal is changed, returning to the step of determining the protocol type of the bus signal based on the voltage value of the bus signal.
In particular, the own device may monitor a CANH signal or a differential signal. And when at least one of the amplitude, the jump duration and the baud rate of the bus signal is changed, returning to the step of determining the protocol type of the bus signal based on the voltage value of the bus signal.
In this embodiment, when at least one of the amplitude, the transition duration, and the baud rate of the bus signal changes, it is described that the communication parameter of the other device changes or the protocol may be replaced for data transmission, so that the step of determining the protocol type of the bus signal based on the voltage value of the bus signal is returned, and the method is adaptable to the other device, and improves the universality of the own device.
In one embodiment, the bus signal is exemplified as a CAN bus signal. In a normal situation, common communication, impedance state, baud rate and the like are predetermined. However, in some cases, the own device cannot know the communication parameters of the partner device. When the two communication parties are not matched, if the impedance is not configured correctly, the bus is disordered, and the waveform quality of the bus signal is poor. If the waveform appears in a shape similar to repeated charge and discharge, some characteristics of the signal are difficult to detect only by means of baud rate and the like, and the corresponding impedance is difficult to match. Moreover, the counterpart device may switch protocols during communication, and if an error occurs during communication, it is difficult to determine whether the error is accidental or the counterpart switches protocols. Moreover, the CAN bus needs handshaking during communication, and an erroneous response may adversely affect the behavior of the counterpart device. In summary, not matching the correct impedance in time can have a significant impact on communications. There is therefore a need for an efficient and accurate impedance adaptation method. Fig. 6 is a schematic flow chart of an adaptive impedance method according to another embodiment.
And respectively acquiring signals on CANH pins and CANL pins in real time by using an analog-to-digital converter (ADC), acquiring CANH signals and CANL signals, acquiring corresponding voltage values, and analyzing the voltage values.
The specific operation is as follows:
1. clearing the impedance of the own device.
2. And respectively carrying out fluctuation detection on the CANH-CANL signal (namely a differential signal, recorded as a path I) and the CANH signal (recorded as a path II), and outputting a high-level value, a low-level value and an amplitude value of the fluctuation of the path after the fluctuation detection is successful.
3. When any one path of signal detects 4 fluctuations, polarity judgment is started: if the amplitude of the fluctuation of the I path is larger than that of the fluctuation of the II path by delta V (namely a preset amplitude difference value which is specified according to an actual result, such as 1.0V), the current CAN is judged to be a two-wire CAN (high-speed CAN or low-speed CAN), and if not, the current CAN is judged to be a single-wire CAN. If no fluctuation is detected in a certain path, the amplitude of the fluctuation is regarded as 0.
4. If it is currently a single-wire CAN, step 5 is performed. If it is currently a two-wire CAN, execution continues with step 7.
5. And detecting the falling time of the II path of waveform, and if the falling time is found to be faster than the set time, judging the self-contained impedance of the opposite equipment. If the falling time is slower than the set time, the other side equipment is judged to have no impedance, and the single-wire CAN impedance of the own side equipment is enabled at the moment.
6. And measuring and verifying whether the baud rate of the current bus signal is consistent with the corresponding baud rate of the single-wire CAN. Although the waveform is disturbed in the case where the impedance is not properly matched, the baud rate measured based on the target signal may also be used as a reference. If the correct impedance has been obtained in the previous steps, a final verification can be made by the baud rate. If the baud rate is consistent with the baud rate corresponding to the single-wire CAN, judging that the current is really the single-wire CAN, and finishing the impedance self-adaption process at the moment; if the baud rate is inconsistent with the baud rate corresponding to the single-wire CAN, judging that the current is not the single-wire CAN, immediately clearing the impedance of the own device (if the impedance of the own device is effective at the moment), and continuously executing the step 7.
7. Detecting the descending time length of the I path of waveform, and if the descending time is faster than the set time, judging the self-contained impedance of the opposite equipment; if the falling time is slower than the set time, the other side equipment is judged to have no impedance, and the high-speed CAN impedance of the own side equipment is enabled.
8. Measurement of baud rate: baud rate adaptation is performed. And determining whether the current CAN is the low-speed CAN or not according to the Baud rate. If the CAN is the low-speed CAN and the opposite side equipment does not have impedance, the impedance of the own side equipment is updated to be the impedance of the low-speed CAN, and the impedance self-adaption process is finished at the moment. If the CAN is the high-speed CAN currently, the high-speed CAN impedance of the own device is kept effective, and the impedance self-adaption process is completed.
9. Monitoring the waveform of the path I or the path II, if the fluctuation amplitude, the falling edge time or the baud rate of the waveform obviously changes, the communication parameter of the opposite device is possibly changed, and at the moment, jumping to the step 1 to start to perform impedance self-adaptation again.
Through the implementation mode of the embodiment, the CAN type and the impedance condition of the opposite equipment are identified by analyzing the falling time and the baud rate of the CAN bus signal by means of waveform analysis, so that communication CAN be established or recovered quickly.
In one embodiment, an impedance adaptation method comprises:
and (a 1) receiving a bus signal.
And (a 2) acquiring a first amplitude of the CANH signal and a second amplitude of the differential signal.
And (a 3) determining the difference between the second amplitude and the first amplitude.
And (a 4) when the difference value is larger than the preset amplitude difference value, determining that the protocol type of the bus signal is the two-wire CAN.
And (a 5) when the difference is smaller than or equal to the preset amplitude difference, determining the protocol type of the bus signal as a single-wire CAN.
And (a 6) detecting the transition duration of a transition edge in the bus signal.
And (a 7) configuring the impedance to a target single-wire CAN impedance corresponding to the single-wire CAN under the condition that the protocol type is the single-wire CAN and the jump duration meets the target condition.
And (a 8) under the condition that the protocol type is a two-wire CAN and the jump duration does not meet the target condition, configuring the impedance as the target high-speed CAN impedance.
And (a 9) acquiring the signal baud rate of the bus signal under the condition that the jump duration meets the target condition.
And (a 10) determining the configured impedance as the target single-wire CAN impedance corresponding to the single-wire CAN under the condition that the signal baud rate accords with the baud rate corresponding to the single-wire CAN.
And (a 11) determining that the protocol type corresponding to the bus signal is the two-wire CAN under the condition that the signal baud rate does not conform to the baud rate corresponding to the single-wire CAN, and returning to the step of detecting the jumping duration of the jumping edge in the bus signal.
And (a 12) determining the configured impedance as the target low-speed CAN impedance under the condition that the signal baud rate conforms to the low-speed baud rate corresponding to the two-wire CAN.
And (a 13) determining the configured impedance as the target high-speed CAN impedance under the condition that the signal baud rate conforms to the high-speed baud rate corresponding to the two-wire CAN.
In this embodiment, the protocol type of the bus signal is determined based on the voltage value of the bus signal, and the obtained protocol type may be erroneous at this time; detecting the jump duration of a jump edge in a bus signal, and acquiring the baud rate of the bus signal, namely the distortion of the signal under the condition that the jump duration meets a target condition, so that the opposite equipment is not provided with impedance; at the moment, whether the protocol type is the correct protocol type is verified, and under the condition that the signal baud rate accords with the baud rate corresponding to the protocol type, the protocol type is the correct protocol type; the configured impedance is determined to be the target impedance corresponding to the protocol type, and the target impedance matched with the bus signal can be rapidly and accurately configured, so that reliable communication connection can be rapidly established.
It should be understood that, although the steps in the flowcharts of fig. 2 and 6 are shown in sequence as indicated by arrows and the steps (a 1) to (a 13) are shown in sequence as indicated by reference numerals, the steps are not necessarily performed in sequence as indicated by the arrows or numerals. The steps are not limited to being performed in the exact order illustrated and, unless explicitly stated herein, may be performed in other orders. Moreover, at least some of the steps in fig. 2 and 6 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed in turn or alternately with other steps or at least some of the other steps.
In one embodiment, as shown in fig. 7, a block diagram of the impedance adaptation apparatus in one embodiment is shown. Fig. 7 provides an impedance adapting apparatus, which may be a part of a computer device using a software module or a hardware module, or a combination of the two, specifically comprising: a receiving module 702, a protocol type determining module 704, a hop duration detecting module 706, a baud rate obtaining module 708, and a target impedance determining module 710, wherein:
a receiving module 702, configured to receive a bus signal;
a protocol type determining module 704, configured to determine a protocol type of the bus signal based on the voltage value of the bus signal;
a jump duration detection module 706, configured to detect a jump duration of a jump edge in the bus signal;
a baud rate obtaining module 708, configured to obtain a baud rate of a bus signal when the duration of the jump meets a target condition;
the target impedance determining module 710 is configured to determine that the configured impedance is the target impedance corresponding to the protocol type when the signal baud rate meets the baud rate corresponding to the protocol type.
In this embodiment, the protocol type of the bus signal is determined based on the voltage value of the bus signal, and the obtained protocol type may be erroneous at this time; detecting the jump duration of a jump edge in a bus signal, and acquiring the baud rate of the bus signal, namely the distortion of the signal under the condition that the jump duration meets a target condition, so that the opposite equipment is not provided with impedance; at the moment, whether the protocol type is the correct protocol type is verified, and under the condition that the signal baud rate accords with the baud rate corresponding to the protocol type, the protocol type is the correct protocol type; the configured impedance is determined to be the target impedance corresponding to the protocol type, and the target impedance matched with the bus signal can be rapidly and accurately configured, so that reliable communication connection is rapidly established.
In one embodiment, the protocol type determining module 704 is configured to obtain a first amplitude of a CANH signal and a second amplitude of a differential signal; determining a difference between the second amplitude and the first amplitude; when the difference is larger than the preset amplitude difference, determining the protocol type of the bus signal as a two-wire CAN; and when the difference is smaller than or equal to the preset amplitude difference, determining the protocol type of the bus signal as a single-wire CAN.
In this embodiment, by determining the difference between the amplitude of the CANH signal and the amplitude of the differential signal, when the difference satisfies the corresponding difference condition, the protocol type of the bus signal is determined, which is more accurate than the conventional method.
In one embodiment, the protocol type is single wire CAN. A target impedance determination module 710 to: under the condition that the jump duration time meets the target condition, configuring the impedance into a target single-wire CAN impedance corresponding to the single-wire CAN; and under the condition that the signal baud rate meets the baud rate corresponding to the protocol type, determining the configured impedance as the target single-wire CAN impedance corresponding to the single-wire CAN.
In this embodiment, when the hop duration satisfies the target condition, it is stated that the counterpart device does not have an impedance, and when the protocol type is the single-wire CAN, the impedance is configured to a target single-wire CAN impedance corresponding to the single-wire CAN, so that the received signal is better, and communication CAN be quickly established or restored.
In one embodiment, the protocol type determination module 704 is configured to: and under the condition that the signal baud rate does not accord with the baud rate corresponding to the single-wire CAN, determining that the protocol type corresponding to the bus signal is the double-wire CAN, and returning to execute the detection of the jumping duration of the jumping edge in the bus signal.
In the embodiment, the final verification is performed through the baud rate, the error is corrected, the impedance self-adaption is realized, and the communication is quickly established or recovered.
In one embodiment, the target impedance determination module 710 is configured to: determining the configured impedance as a target low-speed CAN impedance under the condition that the signal baud rate conforms to the low-speed baud rate corresponding to the two-wire CAN; and under the condition that the signal baud rate accords with the high-speed baud rate corresponding to the double-wire CAN, determining the configured impedance as the target high-speed CAN impedance.
In this embodiment, when the protocol type is a two-wire CAN, the corresponding baud rates are two, one is the baud rate of a high-speed CAN, which is referred to as a high-speed baud rate for short; one is the baud rate of the low-speed CAN, which is referred to as the low-speed baud rate for short, so that under the condition that the protocol type is determined to be the two-wire CAN, the baud rate of the signal is determined to meet the low-speed baud rate or the high-speed baud rate, the protocol type and the impedance CAN be more accurately determined, and the communication CAN be quickly established or recovered.
In one embodiment, the target impedance determination module 710 is configured to: and under the condition that the protocol type is a two-wire CAN and the jump duration does not meet the target condition, configuring the impedance as the target high-speed CAN impedance.
In this embodiment, it is found through tests that, in a two-wire CAN, no matter a high-speed CAN or a low-speed CAN, a high-speed CAN impedance is configured first, so that the quality of a waveform is good, and waveform distortion CAN be reduced.
In one embodiment, the protocol type determination module is further configured to: and determining the protocol type of the bus signal based on the voltage value of the bus signal when at least one of the amplitude, the transition duration and the baud rate of the bus signal is changed.
In this embodiment, when at least one of the amplitude, the transition duration, and the baud rate of the bus signal changes, it is described that the communication parameter of the other device changes or the protocol may be replaced for data transmission, so that the step of determining the protocol type of the bus signal based on the voltage value of the bus signal is returned, and the method is adaptable to the other device, and improves the universality of the own device.
For specific limitations of the impedance adaptation means, reference may be made to the above limitations of the impedance adaptation method, which are not described in detail here. The various modules in the impedance adaptation apparatus described above may be implemented in whole or in part by software, hardware, and combinations thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a terminal device, and its internal structure diagram may be as shown in fig. 8. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used for communicating with an external terminal in a wired or wireless manner, and the wireless manner can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement an impedance adaptation method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the configuration shown in fig. 8 is a block diagram of only a portion of the configuration associated with the present application, and is not intended to limit the computing device to which the present application may be applied, and that a particular computing device may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory in which a computer program is stored and a processor, which when executing the computer program performs the steps of the above-described method embodiments.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
In one embodiment, a computer program product or computer program is provided that includes computer instructions stored in a computer readable storage medium. The computer instructions are read by a processor of the computer device from the computer-readable storage medium, and the computer instructions are executed by the processor to cause the computer device to perform the steps in the above-described method embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the above embodiments may be implemented by hardware related to instructions of a computer program, which may be stored in a non-volatile computer readable storage medium, and when executed, may include the processes of the above embodiments of the methods. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile 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 (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The above description is only a preferred embodiment of the present application, and not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings of the present application, or which are directly or indirectly applied to other related technical fields, are also included in the scope of the present application.
Claims (10)
1. An impedance adaptation method, characterized in that the method comprises:
receiving a bus signal;
determining a protocol type of the bus signal based on a voltage value of the bus signal;
detecting the jumping duration of a jumping edge in the bus signal;
under the condition that the jump duration meets a target condition, acquiring a signal baud rate of the bus signal;
and under the condition that the signal baud rate meets the baud rate corresponding to the protocol type, determining the configured impedance as the target impedance corresponding to the protocol type.
2. The method of claim 1, wherein the bus signals include a CANH signal and a differential signal;
the determining a protocol type of the bus signal based on the voltage value of the bus signal includes:
acquiring a first amplitude of the CANH signal and a second amplitude of the differential signal;
determining a difference between the second amplitude and the first amplitude;
when the difference is larger than a preset amplitude difference, determining that the protocol type of the bus signal is a two-wire CAN;
and when the difference is smaller than or equal to the preset amplitude difference, determining that the protocol type of the bus signal is a single-wire CAN.
3. The method of claim 1, wherein the protocol type is single wire CAN;
the method further comprises the following steps:
under the condition that the jump duration meets the target condition, configuring impedance as target single-wire CAN impedance corresponding to the single-wire CAN;
the determining that the configured impedance is the target impedance corresponding to the protocol type includes:
and determining the configured impedance as the target single-wire CAN impedance corresponding to the single-wire CAN.
4. The method of claim 3, further comprising:
and under the condition that the signal baud rate does not accord with the baud rate corresponding to the single-wire CAN, determining that the protocol type corresponding to the bus signal is the double-wire CAN, and returning to the step of detecting the jumping duration of the jumping edge in the bus signal.
5. The method of claim 1, wherein determining the configured impedance as the target impedance corresponding to the protocol type when the signal baud rate meets the baud rate corresponding to the protocol type comprises:
under the condition that the signal baud rate accords with the low-speed baud rate corresponding to the two-wire CAN, determining the configured impedance as the target low-speed CAN impedance;
and determining the configured impedance as the target high-speed CAN impedance under the condition that the signal baud rate conforms to the high-speed baud rate corresponding to the double-line CAN.
6. The method of claim 1, further comprising:
and under the condition that the protocol type is a two-wire CAN and the jump duration does not meet the target condition, configuring the impedance as a target high-speed CAN impedance.
7. The method of any of claims 1, 3 to 6, further comprising:
and when at least one of the amplitude, the jump duration and the baud rate of the bus signal is changed, returning to the step of determining the protocol type of the bus signal based on the voltage value of the bus signal.
8. An impedance adaptation apparatus, characterized in that the apparatus comprises:
the receiving module is used for receiving bus signals;
the protocol type determining module is used for determining the protocol type of the bus signal based on the voltage value of the bus signal;
a jumping duration detection module, configured to detect a jumping duration of a jumping edge in the bus signal;
the baud rate acquisition module is used for acquiring the signal baud rate of the bus signal under the condition that the jump duration meets a target condition;
and the target impedance determining module is used for determining the configured impedance as the target impedance corresponding to the protocol type under the condition that the signal baud rate accords with the baud rate corresponding to the protocol type.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211454817.7A CN115695103B (en) | 2022-11-21 | 2022-11-21 | Impedance self-adaption method, device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211454817.7A CN115695103B (en) | 2022-11-21 | 2022-11-21 | Impedance self-adaption method, device, computer equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115695103A true CN115695103A (en) | 2023-02-03 |
CN115695103B CN115695103B (en) | 2024-05-17 |
Family
ID=85054254
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211454817.7A Active CN115695103B (en) | 2022-11-21 | 2022-11-21 | Impedance self-adaption method, device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115695103B (en) |
Citations (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140343448A1 (en) * | 2013-05-15 | 2014-11-20 | Zephyr Technology Corporation | Two-electrode, impedance-based respiration determination |
CN105278411A (en) * | 2015-10-28 | 2016-01-27 | 新誉轨道交通科技有限公司 | High-speed CAN bus self-adaptive impedance matching module, method and system |
US20160284386A1 (en) * | 2015-03-27 | 2016-09-29 | Intel Corporation | Impedance compensation based on detecting sensor data |
CN106326156A (en) * | 2016-08-30 | 2017-01-11 | 西安翔腾微电子科技有限公司 | Single port communication processing circuit based on self-adaptive baud rate and method thereof |
CN106534003A (en) * | 2016-11-14 | 2017-03-22 | 珠海格力电器股份有限公司 | Impedance matching method, device and communication network |
WO2020135331A1 (en) * | 2018-12-24 | 2020-07-02 | 深圳市道通科技股份有限公司 | Method and apparatus for obtaining baud rate |
CN112601193A (en) * | 2020-12-16 | 2021-04-02 | 深圳数联天下智能科技有限公司 | Data transmission method and related device thereof |
EP3809638A1 (en) * | 2019-10-17 | 2021-04-21 | Volvo Car Corporation | Detecting manipulation of data on a can bus |
CN112953544A (en) * | 2021-02-02 | 2021-06-11 | 华立科技股份有限公司 | Data transmission system, method, device and medium |
WO2021173120A1 (en) * | 2020-02-25 | 2021-09-02 | Calamp Corp. | Systems and methods for detection of vehicle bus protocol using signal analysis |
CN113741272A (en) * | 2021-09-01 | 2021-12-03 | 上海节卡机器人科技有限公司 | CAN bus communication system |
CN114039591A (en) * | 2021-10-21 | 2022-02-11 | 深圳数马电子技术有限公司 | Impedance self-adaption method, apparatus and computer readable storage medium |
CN114143273A (en) * | 2021-11-24 | 2022-03-04 | 深圳数马电子技术有限公司 | Channel allocation method, device, computer equipment and computer readable storage medium |
CN114460376A (en) * | 2021-12-30 | 2022-05-10 | 深圳供电局有限公司 | Loop impedance detection method, loop impedance detection circuit, computer device and storage medium |
-
2022
- 2022-11-21 CN CN202211454817.7A patent/CN115695103B/en active Active
Patent Citations (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140343448A1 (en) * | 2013-05-15 | 2014-11-20 | Zephyr Technology Corporation | Two-electrode, impedance-based respiration determination |
US20160284386A1 (en) * | 2015-03-27 | 2016-09-29 | Intel Corporation | Impedance compensation based on detecting sensor data |
CN105278411A (en) * | 2015-10-28 | 2016-01-27 | 新誉轨道交通科技有限公司 | High-speed CAN bus self-adaptive impedance matching module, method and system |
CN106326156A (en) * | 2016-08-30 | 2017-01-11 | 西安翔腾微电子科技有限公司 | Single port communication processing circuit based on self-adaptive baud rate and method thereof |
CN106534003A (en) * | 2016-11-14 | 2017-03-22 | 珠海格力电器股份有限公司 | Impedance matching method, device and communication network |
WO2020135331A1 (en) * | 2018-12-24 | 2020-07-02 | 深圳市道通科技股份有限公司 | Method and apparatus for obtaining baud rate |
EP3809638A1 (en) * | 2019-10-17 | 2021-04-21 | Volvo Car Corporation | Detecting manipulation of data on a can bus |
WO2021173120A1 (en) * | 2020-02-25 | 2021-09-02 | Calamp Corp. | Systems and methods for detection of vehicle bus protocol using signal analysis |
CN112601193A (en) * | 2020-12-16 | 2021-04-02 | 深圳数联天下智能科技有限公司 | Data transmission method and related device thereof |
CN112953544A (en) * | 2021-02-02 | 2021-06-11 | 华立科技股份有限公司 | Data transmission system, method, device and medium |
CN113741272A (en) * | 2021-09-01 | 2021-12-03 | 上海节卡机器人科技有限公司 | CAN bus communication system |
CN114039591A (en) * | 2021-10-21 | 2022-02-11 | 深圳数马电子技术有限公司 | Impedance self-adaption method, apparatus and computer readable storage medium |
CN114143273A (en) * | 2021-11-24 | 2022-03-04 | 深圳数马电子技术有限公司 | Channel allocation method, device, computer equipment and computer readable storage medium |
CN114460376A (en) * | 2021-12-30 | 2022-05-10 | 深圳供电局有限公司 | Loop impedance detection method, loop impedance detection circuit, computer device and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN115695103B (en) | 2024-05-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10855413B2 (en) | Method and apparatus for evaluating and optimizing a signaling system | |
US9082242B2 (en) | Vehicle network health assessment | |
US9128691B2 (en) | Method and terminal for selecting internal circuit according to USB interface status | |
US7360127B2 (en) | Method and apparatus for evaluating and optimizing a signaling system | |
CN107959599B (en) | Bus_off fault test system and test method | |
US20130179603A1 (en) | Apparatus and method of identifying a usb or an mhl device | |
CN112269120A (en) | Interface signal loop test method and device, computer equipment and storage medium | |
CN108540244B (en) | Pre-emphasis coefficient test method and device and communication equipment | |
CN109743228A (en) | A kind of measuring method and system of sampling point position | |
US20230116669A1 (en) | Error detection device and error detection method | |
CN108924908B (en) | WiFi scanning method and device and electronic device | |
US11977464B2 (en) | Error rate measuring apparatus and error rate measuring method | |
US9857420B2 (en) | Method for determining a condition of pin connection of the integrated circuit and integrated circuit thereof | |
CN106205735A (en) | Embedded chip method of testing and system | |
CN115695103B (en) | Impedance self-adaption method, device, computer equipment and storage medium | |
CN107908303B (en) | Touch processing device, electronic system and touch processing method thereof | |
US10101864B2 (en) | Touch screen terminal and near field communication method, apparatus and system thereof | |
CN115562916A (en) | Method, device and medium for evaluating signal quality | |
JP2004215128A (en) | Terminating resistance device, data transmitter and inspection method of terminating resistance circuit | |
US11088817B2 (en) | Data transmission method, data transmission device, and computer readable storage medium | |
CN112929099B (en) | Signal detection method, terminal and storage medium | |
JP7040993B2 (en) | Electronic control device | |
CN113282532A (en) | Communication device, communication method of communication device and electronic equipment | |
KR20210100474A (en) | Testing device of electric control unit and testing method thereof | |
US10938507B2 (en) | Communication apparatus |
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 |