Remote diagnosis method, device and storage medium
By forwarding data byte-by-byte or bit-by-bit, K-line protocol communication between the diagnostic tool and the vehicle is realized, solving the adaptability problem of K-line protocol vehicle remote diagnostics in the existing technology and realizing remote diagnostics of K-line protocol vehicles.
Patent Information
- Application Number
- CN202310774882.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-27
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2043-06-27
AI Technical Summary
Existing remote diagnostic technologies cannot effectively support vehicles that use the K-line protocol for communication, resulting in limited vehicle compatibility for diagnostic tools.
Remote diagnostics between the diagnostic tool and the vehicle are achieved by establishing K-line protocol communication through a wired connection between the first remote device and the diagnostic tool, and a wired connection between the second remote device and the vehicle, using a byte-by-byte or bit-by-bit forwarding method.
It enables remote diagnostics of vehicles using the K-line protocol, reduces data latency, and expands the scope of application for remote diagnostics.
Smart Images

Figure CN116679676B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of automobile diagnosis technology, and in particular to a remote diagnosis method, device and storage medium. Background Art
[0002] Automobile diagnosis refers to determining the technical condition of a car without disassembling it (or only removing individual parts). For example, diagnosing the technical condition of the car's chassis, steering wheel, dashboard, engine, etc.
[0003] like Figure 1 As shown, in existing technologies, diagnostic instruments can be connected to the car via a cable for diagnosis. For example, the diagnostic instrument can be connected to the car's OBD (On-Board Diagnostic) port. This requires that the diagnostic instrument and the car must be in the same location for operation. However, diagnostic instruments generally only support a limited number of vehicle models. Some diagnostic instruments are even specialized for diagnosing a specific brand or even a series of vehicles. Therefore, if a user needs to diagnose multiple vehicle models, they must have a certain number of diagnostic instruments, which is obviously limited.
[0004] To address this, remote diagnostic technology has emerged in related technologies to address the limitations described above. However, the inventors have discovered that while remote diagnostic technology typically targets vehicles that communicate using the CAN protocol, some vehicles (such as older models) still use the K-line protocol, and some current remote diagnostic technologies may not support these vehicles. Summary of the Invention
[0005] Based on this, the present application provides a remote diagnosis method, device and storage medium to implement remote diagnosis of automobiles using the K-line protocol for communication.
[0006] In a first aspect, the present application provides a remote diagnostic method, applied to a first remote device, wherein the first remote device is connected to a diagnostic instrument via a wired connection and to a second remote device via a network connection, and the second remote device is connected to a vehicle via a wired connection; the method comprises:
[0007] receiving a signal sent by the diagnostic instrument, and if a low-level width of the signal reaches a first preset threshold, instructing the second remote device to send start data of the signal to the vehicle; wherein the start data is a fast initialization header or a start bit in a 5-baud segment;
[0008] if the initialization type adopted by the signal is fast initialization, the communication start request data of the signal is sent to the second remote device in a byte-by-byte forwarding manner, and the communication start response data received from the second remote device is sent to the diagnostic instrument in a byte-by-byte forwarding manner; wherein the communication start response data is received by the second remote device after sending the communication start request data to the automobile in a byte-by-byte forwarding manner;
[0009] if the initialization type adopted by the signal is 5-baud initialization, the target data in the signal is sent to the second remote device in a bit-by-bit forwarding manner, and the second remote device is instructed to send the target data to the automobile in a bit-by-bit forwarding manner; wherein the target data is the data in the 5-baud segment except the start bit.
[0010] In a second aspect, the application provides a remote device, comprising: a memory, the memory storing a computer program; and a processor, the processor implementing the steps of the method of the first aspect when executing the computer program.
[0011] In a third aspect, the application provides a computer-readable storage medium, which stores a computer program, the computer program being executed by a processor to implement the steps of the method of the first aspect.
[0012] Based on the above technical solution, the application can establish communication between a diagnostic instrument and an automobile based on the K-line protocol in a remote diagnosis scenario, and then perform diagnosis. That is, the application realizes remote diagnosis of an automobile that uses the K-line protocol for communication. BRIEF DESCRIPTION OF DRAWINGS
[0013] Figure 1 An application scenario of automobile diagnosis in the prior art;
[0014] Figure 2 An exemplary application scenario of the embodiments of the application;
[0015] Figure 3 An exemplary flowchart of initial initialization of the K-line protocol;
[0016] Figure 4 An exemplary flowchart of 5-baud initialization of the K-line protocol;
[0017] Figure 5 A flowchart of the remote diagnosis method provided by the embodiments of the application;
[0018] Figure 6 A flowchart of step S10 in the embodiments of the application;
[0019] Figure 7An exemplary flow chart for step S10 in the embodiments of the present application;
[0020] Figure 8 A structural schematic diagram of a remote device provided in the embodiments of the present application. Embodiments
[0021] In the related art, the baud rate of the CAN protocol is relatively high, for example, above 33.3K, thus, when performing remote diagnosis at the relatively high baud rate, the data delay is not too large, and basically the regulation of the protocol can be met. That is, the remote diagnosis technology is generally for the automobile which uses the CAN protocol to communicate. However, some automobiles (for example, old automobiles) also use the K-line protocol to communicate, for example, some modules (such as the steering wheel) in the automobile use the CAN protocol, and some modules (such as the instrument panel) use the K-line protocol. The commonly used baud rate (for example, 9600bps, 10400bps) based on the K-line protocol and the initialization of the K-line protocol are above the millisecond level, thus, the current remote diagnosis technology does not support the automobile which uses the K-line protocol to communicate.
[0022] Based on the above findings of the inventor, the embodiments of the present application provide a remote diagnosis method, device and storage medium, and realize remote diagnosis of the automobile which uses the K-line protocol to communicate. Exemplarily, if there is a demand for remote diagnosis in a certain place, and there is a module which uses the K-line protocol to communicate in the automobile targeted by the remote diagnosis, the embodiments of the present application can realize remote diagnosis of the module, and further realize remote diagnosis of the whole vehicle.
[0023] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application, and it should be understood that the specific embodiments described herein are only used to explain the present application, and not used to limit the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of protection of the present application.
[0024] The embodiments of the present application can be exemplarily applied to, for example, Figure 2The first remote device is connected with the diagnostic instrument in a wired manner, the first remote device is connected with the second remote device in a network manner, and the second remote device is connected with the automobile in a wired manner. Exemplarily, the diagnostic instrument and the first remote device can be connected through a communication cable, and after the connection, the first remote device can complete the adaptation of pin, baud rate, impedance and the like information by using the data frame sent by the diagnostic instrument, and complete the communication between the two. It can be understood that after the communication is completed, the two can normally transmit and receive data. Similarly, the second remote device and the automobile can also be connected through a communication cable and complete the adaptation, and after the communication is completed, the two can also normally transmit and receive data. Exemplarily, the diagnostic instrument and the first remote device can be arranged at A place, and the second remote device can be arranged at B place. When a user at B place needs to diagnose the automobile which uses the K-line protocol to communicate, the second remote device can be connected with the automobile, and the first remote device and the second remote device are connected through a network. It can be understood that the first remote device and the second remote device act as a "bridge" between the diagnostic instrument and the automobile, and through the embodiment of the application, the remote diagnosis of the automobile is realized.
[0025] The method provided by the embodiment of the application can be applied to the first remote device, that is, executed by the first remote device. Exemplarily, the first remote device can be provided with an FPGA (Field Programmable Gate Array, field programmable logic gate array), and the method provided by the embodiment of the application is executed by the software execution element, the FPGA and other necessary elements in the first remote device together.
[0026] The K-line protocol is exemplarily introduced first. If the host and the slave use the K-line protocol to establish communication, initialization is needed to establish this communication. The initialization type of the K-line protocol is usually two types: fast initialization and 5-baud initialization (or called slow initialization).
[0027] As shown in Figure 3 If it is fast initialization, the host sends a fast initialization header to the slave, wherein the fast initialization header refers to 25 ms low level and 25 ms high level set in time sequence, that is, the host first sends 25 ms low level and then sends 25 ms high level. After that, the transmission of data between the host and the slave is based on 10400 bps (baud rate). Then, the host and the slave enter a handshake stage. Specifically, the host sends communication start request data (5 bytes, which can also be called system entry data) to the slave, and then the slave returns communication start response data (7 bytes) to the host. In this way, the host and the slave establish this communication, so that the two can transmit and receive data. Based on this, it needs to be explained that the start data mentioned in the embodiment of the application can be the fast initialization header.
[0028] As shown in Figure 4As shown, if 5-baud initialization is adopted, the host first sends a 5-bps address byte (also referred to as a 5-baud segment), which consists of a start bit, 8 address bits, and a stop bit. The start bit is 1 bit (bit) and is at a low level; the 8 address bits are 8 bits; and the stop bit is 1 bit and is at a high level. Moreover, the duration of each bit of the 5-baud segment is 200 ms. Next, the slave returns 0x55 carrying baud rate information (at this time, the baud rate is the baud rate carried by 0x55), and the host determines the baud rate of communication (usually 9600 bps or 10400 bps) according to 0x55. Then, the host and the slave enter a handshake phase, specifically, the slave returns KW1 and KW2 to the host, the host sends the inverted KW2 (denoted as ~KW2) to the slave after receiving the same, and finally the slave sends the inverted ADDR (denoted as ~ADDR) to the host after receiving the same. Based on this, the start data mentioned in the embodiments of the present application can be the start bit of the 5-baud segment, and the target data can be the data in the 5-baud segment other than the start bit.
[0029] The remote diagnosis method provided by the embodiments of the present application can include steps S10 to S30. Figure 5
[0030] S10, receiving a signal sent by a diagnosis instrument, and if the low-level width of the signal reaches a first preset threshold, indicating the second remote device to send start data of the signal to the automobile.
[0031] As described above, the start data can be the start bit in the 5-baud segment or the fast initialization header. Specifically, if the signal adopts fast initialization, the start data is the fast initialization header; and if the signal adopts 5-baud initialization, the start data is the start bit in the 5-baud segment.
[0032] It should be noted that if the host and the slave establish communication after initialization, they usually transmit data at 9600 bps or 10400 bps, and the data format transmitted after initialization is similar to a UART byte. Based on this, the value of the first preset threshold can be reasonably set according to the UART byte, as long as the low-level width (the duration of the signal at a low level) of the signal is greater than the first preset threshold, the UART byte can be excluded.
[0033] In an embodiment, the first preset threshold value can be set to be greater than or equal to 1 ms. Specifically, a UART byte is usually composed of a start bit (low level), 4-8 data bits, and a stop bit (high level). Based on this, the low level maximum width of the UART byte can be roughly confirmed at 9600 bps or 10400 bps, and the value of the first preset threshold value is reasonably set. For example, assuming that the UART byte has 8 data bits and all the 8 data bits are 0, this is the low level maximum width of the UART byte. At 10400 bps, the low level maximum width of the UART byte is about 865 us, so the first preset threshold value can be set to be greater than or equal to 1 ms. Of course, the first preset threshold value cannot be set too large and needs to be reasonably set.
[0034] Based on this, the first remote device can monitor when receiving the signal sent by the diagnostic instrument. When the low level width of the signal reaches the first preset threshold value, it can be confirmed that the signal is used for initialization of the K-line protocol, thereby instructing the second remote device to send start data to the automobile.
[0035] For example, the first remote device starts to appear a falling edge when receiving the signal sent by the diagnostic instrument, at this time, it can be judged whether the duration of the low level of the signal can reach 1 ms. If it can and the initialization type of the signal is fast initialization, then at 1 ms, the second remote device is instructed to send a fast initialization header to the automobile, for example, 25 ms low level and 25 ms high level (or other approximate signals, for example, 35 ms low level and 35 ms high level) are set in sequence. If it can and the initialization type of the signal is 5-baud initialization, then at 1 ms, the second remote device is instructed to send the start bit in the 5-baud section to the automobile, for example, 200 ms of low level is instructed to be sent.
[0036] S20, if the initialization type of the signal is fast initialization, the communication start request data of the signal is sent to the second remote device in a byte-by-byte forwarding manner, and the communication start response data received from the second remote device is sent to the diagnostic instrument in a byte-by-byte forwarding manner. The communication start response data is received by the second remote device after sending the communication start request data to the automobile in a byte-by-byte forwarding manner.
[0037] As mentioned above, if the initialization type adopted by the signal is fast initialization, the first remote device instructs the second remote device to also send the fast initialization header at the time corresponding to the first preset threshold after the second remote device receives the fast initialization header. When the first remote device starts to receive the communication start request data sent by the diagnostic instrument after receiving the fast initialization, in order to reduce the data delay, the embodiment of the application adopts the byte-by-byte forwarding mode to process the handshake stage, wherein the byte-by-byte forwarding mode refers to forwarding one byte after receiving one byte. Specifically, the second remote device forwards one byte to the second remote device after receiving one byte of the communication start request data, and similarly, the second remote device forwards one byte to the vehicle after receiving one byte.
[0038] It can be understood that after forwarding the communication start request data sent by the diagnostic instrument to the vehicle in the byte-by-byte forwarding mode, the vehicle returns the communication start response data. Specifically, the second remote device forwards one byte to the first remote device after receiving one byte of the communication start response data, so that the first remote device forwards one byte to the diagnostic instrument after receiving one byte. It can be understood that after forwarding the communication start response data sent by the vehicle to the diagnostic instrument in the byte-by-byte forwarding mode, the diagnostic instrument and the vehicle establish this communication, so that the data transmission can be normally performed.
[0039] In the related art, if the diagnostic instrument and the vehicle establish this communication like the CAN protocol, the first remote device usually sends the fast initialization header to the second remote device after receiving the fast initialization header sent by the diagnostic instrument, and the second remote device sends the fast initialization header to the vehicle after receiving it. Taking 50 ms of the fast initialization header as an example, the data delay (from the diagnostic instrument to the vehicle) will be greater than 100 ms (network delay is ignored here), which basically cannot meet the delay requirement of the K-line protocol. In the embodiment of the application, the first remote device instructs the second remote device to also start sending the fast initialization header at the time corresponding to the first preset threshold after the diagnostic instrument starts to send the fast initialization header, so that the data delay of the embodiment of the application from the diagnostic instrument sending the fast initialization header to the vehicle completely receiving the fast initialization header is only the time length corresponding to the first threshold time (for example, only 1 ms, and the network delay is also ignored). In addition, in the handshake stage after the fast initialization header is forwarded, the first remote device in the related art forwards the communication start request data to the second remote device after receiving it, and the second remote device also does so, and similarly, the communication start response data is also forwarded in this way. However, in order to further reduce the data delay, the communication start request data and the communication start response data in the embodiment of the application are forwarded in the byte-by-byte forwarding mode, which almost does not have data delay (network delay is ignored).
[0040] Therefore, the embodiment of the application can realize the rapid initialization of the communication between the diagnostic instrument and the automobile based on the K-line protocol in the remote diagnosis scene, and then the diagnosis is performed.
[0041] In S30, if the initialization type of the signal is the 5-baud initialization, the target data in the signal is sent to the second remote device in the bit-by-bit forwarding manner, and the second remote device is instructed to send the target data to the automobile in the bit-by-bit forwarding manner. The target data is the data in the 5-baud section except the start bit.
[0042] As described above, if the initialization type of the signal is the 5-baud initialization, the first remote device instructs the second remote device to also send the start bit at the time corresponding to the first preset threshold after receiving the start bit (200 ms of low level) in the 5-baud section. When the first remote device starts to receive the target data (8 address bits and one stop bit) in the 5-baud section after receiving the start bit in the 5-baud section, since the baud rate is 5, 200 ms is needed to transmit 1 bit of data, and therefore the target data cannot be processed in the byte-by-byte forwarding manner (the data delay in this manner exceeds the protocol specification). Therefore, the bit-by-bit forwarding manner is adopted in the embodiment of the application, that is, one bit is sent when one bit is received. Specifically, one bit of the target data is sent to the second remote device when the second remote device receives one bit of the target data, and similarly, one bit is sent to the automobile when the second remote device receives one bit.
[0043] It can be understood that after the target data sent by the diagnostic instrument is forwarded to the automobile in the bit-by-bit forwarding manner, the subsequent process can be performed in the manner described above. For example, the automobile returns 0x55 to the second remote device, the second remote device returns to the first remote device, and the first remote device forwards to the diagnostic instrument. Then, the automobile continues to return KW1 and KW2 to the second remote device, the second remote device forwards to the first remote device, and the first remote device forwards to the diagnostic instrument. Then, the diagnostic instrument sends ~KW2 to the first remote device, the first remote device sends to the second remote device, and the second remote device sends to the automobile. Finally, the automobile returns ~ADDR to the second remote device, the second remote device returns to the first remote device, and the first remote device returns to the diagnostic instrument. In this way, the diagnostic instrument and the automobile establish the communication this time, so that the data transmission can be performed normally.
[0044] In the related art, if the diagnostic instrument and the car establish this communication like the CAN protocol, then usually the first remote device sends the 5-baud segment to the second remote device after receiving the 5-baud segment sent by the diagnostic instrument, and the second remote device sends it to the car after receiving it. Then the data delay (from the diagnostic instrument starting to send to the car completely receiving it) will be greater than 4s (network delay is ignored here), which completely fails to meet the delay specified by the K-line protocol. In the embodiment of the present application, from the moment corresponding to the first preset threshold after the diagnostic instrument starts to send the 5-baud segment, the first remote device instructs the second remote device to also start sending the start bit of the 5-baud segment. Afterwards, according to the protocol, since the delay between the 5-baud segment and 0x55 needs to be guaranteed to be 20-300ms, the embodiment of the present application adopts a bit-by-bit forwarding method to send the target data (that is, 8 address bits and 1 bit of a stop bit are sent every 200ms), so this can also meet the delay specified by the protocol. Therefore, from the time the diagnostic instrument starts sending the 5-baud segment to the time the car completely receives the 5-baud segment, the data delay in the embodiment of the present application is only the duration corresponding to the first threshold moment (for example, only 1ms, also ignoring the network delay).
[0045] Therefore, the embodiment of the present application can realize the establishment of communication between the diagnostic instrument and the car based on the 5-baud initialization of the K-line protocol in the remote diagnosis scenario, and then perform diagnosis.
[0046] As can be seen, based on the above technical solution, the embodiment of the present application can achieve remote diagnosis scenarios in which the diagnostic instrument and the vehicle establish communication based on the K-line protocol and then perform diagnosis. In other words, remote diagnosis of the vehicle using the K-line protocol for communication is achieved.
[0047] In one embodiment, if Figure 6 As shown, step S10 may include sub-steps S110 to S140.
[0048] S110 : When the low level width of the signal reaches a first preset threshold, instruct the second remote device to send a low level to the car.
[0049] As mentioned above, the fast initial header and the 5-baud segment both start with a low level. Therefore, as long as the low-level width of the signal sent by the diagnostic instrument reaches the first preset threshold, in order to support remote diagnosis, the first remote device needs to instruct the second remote device to send a low level to the car at the moment corresponding to the first preset threshold.
[0050] S120: Determine the initialization type adopted by the signal.
[0051] Specifically, subsequent processing is determined according to the initialization type.
[0052] In an embodiment, the determining the initialization type adopted by the signal can comprise: determining the initialization type adopted by the signal according to preset user logic. Specifically, the initialization type can be determined according to the user's prior settings. For example, in the remote diagnosis scenario, the user can know in advance the initialization type to be used between the diagnostic instrument and the vehicle, and can set the first remote diagnosis device in advance.
[0053] In an embodiment, the determining the initialization type adopted by the signal can comprise: if a rising edge occurs when the low level width of the signal reaches the second preset threshold, determining that the initialization type of the signal is fast initialization, otherwise determining that the initialization type of the signal is 5-baud initialization. For example, as described above, the low level duration of the fast initialization header can be 25 ms, and the starting bit of the 5-baud section can be 200 ms of low level. Therefore, when the low level duration of the signal reaches the second preset threshold, it is determined whether a rising edge occurs. If yes, it is determined that it is fast initialization, otherwise it is 5-baud initialization. For example, the second preset threshold can be reasonably set according to the low level duration of the fast initialization header, for example, set to 25 ms. When the low level width of the signal reaches 25 ms, it is determined whether a rising edge occurs. If yes, it means fast initialization, and the diagnostic instrument will send 25 ms of high level. If not, it means 5-baud initialization because the starting bit of the 5-baud section is 200 ms of low level.
[0054] S130, if the initialization type adopted by the signal is fast initialization, instructing the second remote device to send a high level with a first preset duration to the vehicle when the low level width of the signal reaches the second preset threshold.
[0055] As described above, if the initialization type is fast initialization, the diagnostic instrument will send a high level when the low level width of the signal reaches the second preset threshold. At this time, the first remote device can instruct the second remote device to send a high level with a first preset duration, for example, 25 ms of high level.
[0056] S140, if the initialization type adopted by the signal is 5-baud initialization, causing the second remote device to continue to send a low level to the vehicle until the low level width reaches a third preset threshold.
[0057] As described above, if the initialization type is 5-baud initialization, the second remote device is caused to send a low level with a width reaching a third preset threshold to the vehicle under the instruction of sub-step S110. For example, the second remote device sends 200 ms of low level to the vehicle under the instruction of sub-step S110.
[0058] In an embodiment, after receiving the signal sent by the diagnostic instrument in step S10, the method can further comprise: determining whether the low level width of the signal reaches a fourth preset threshold; and if the low level width of the signal reaches the fourth preset threshold, further determining whether the low level width of the signal reaches the first preset threshold. The fourth preset threshold is less than the first preset threshold.
[0059] In some cases, the low level received by the first remote device can be caused by abnormal conditions such as noise, and the duration of the low level in this case is very short. Therefore, in the embodiment of the present application, in order to filter such abnormal conditions, it is first determined whether the low level width of the signal reaches a fourth preset threshold, and if so, it is further determined whether the low level width of the signal reaches the first preset threshold. Exemplarily, the fourth preset threshold can be 10us.
[0060] Exemplarily, step S10 can be as shown in Figure 7 When the first remote device receives the signal (low level) sent by the diagnostic instrument, it is determined whether the low level width of the signal reaches 10us (the fourth preset threshold). If so, it is further determined whether the low level width of the signal reaches 1ms (the first preset threshold). If so, the second remote device is instructed to send the low level to the vehicle. Thereafter, if the first remote device can determine the initialization type according to the preset user logic, it is directly determined. Specifically, if it is fast initialization, the second remote device is instructed to send the fast initialization header, and if not, the second remote device is instructed to send the start bit of the 5-baud section. If not, it is further determined. Specifically, it is determined whether there is a rising edge when the signal width reaches 25ms (the second preset threshold). If so, it is determined to be fast initialization, and the second remote device is instructed to send a high level of 25ms. If not, it is determined to be 5-baud initialization, and the second remote device is instructed to send a low level of 175ms (the total duration is 200ms).
[0061] In an embodiment, step S20 can comprise sub-step S210 to sub-step S230.
[0062] S210, if the initialization type of the signal is fast initialization, the current byte in the communication start request data is sent to the second remote device every time a byte in the communication start request data is received, and the second remote device is instructed to send the current byte in the communication start request data to the vehicle.
[0063] S220, the second remote device is instructed to send the current byte in the communication start response data to the first remote device every time a byte in the communication start response data is received.
[0064] S230, send the current byte of the communication enable response data to the diagnostic tool each time a byte of the communication enable response data sent by the second remote device is received.
[0065] When the diagnostic tool has sent the fast initialization header, as described above, the diagnostic tool then sends the communication start request data (5 bytes). Accordingly, the first remote device sends the current byte to the second remote device each time a byte is received until all 5 bytes are sent, i.e. one byte is sent for each byte received. Similarly, the second remote device is instructed so that it also sends the current byte to the vehicle each time a byte is received until all 5 bytes are sent.
[0066] It is appreciated that when the vehicle returns the communication start response data (7 bytes) after receiving the communication enable request data, the second remote device is similarly instructed to send a byte to the first remote device each time a byte is received until all 7 bytes are sent. So that the first remote device also sends a byte to the vehicle each time a byte is received until all 7 bytes are sent. In this way, the communication between the diagnostic tool and the vehicle is established for this session and the diagnostic can proceed.
[0067] In one embodiment, the step S30 can comprise sub-steps S310 to S320.
[0068] S310, if the initialization type used by the signal is 5 baud initialization, send the current bit of the target data to the second remote device each time a bit of the target data is received.
[0069] S320, instruct the second remote device to send the current bit of the target data to the vehicle each time a bit of the target data is received.
[0070] When the diagnostic tool has sent the start bit in the 5 baud section, as described above, the diagnostic tool then sends the target data, i.e. the address bits (8 bits) and the stop bit (1 bit). Accordingly, the first remote device sends the current bit to the second remote device each time a bit is received until all 9 bits (8 bits of address bits plus 1 bit of stop bit) are sent, i.e. one bit is sent every 200 ms. Similarly, the second remote device is instructed so that it also sends the current bit to the second remote device each time a bit is received until all 9 bits are sent. It is appreciated that the start data sent in step S10 and the 9 bits sent here make up a complete 5 baud section.
[0071] As mentioned above, the automobile will return 0x55 carrying the baud rate to the second remote device after receiving the 5-baud section. The second remote device can send 0x55 to the first remote device after receiving it, and the first remote device can send 0x55 to the diagnostic instrument after receiving it. After returning 0x55, the automobile will continue to return KW1 and KW2 for handshake to the second remote device, and the second remote device can send KW1 and KW2 to the first remote device after receiving them, and the first remote device can send KW1 and KW2 to the diagnostic instrument after receiving them. Then, the diagnostic instrument sends ~KW2 to the first remote device, and the first remote device can send ~KW2 to the second remote device after receiving it, and the second remote device can send ~KW2 to the automobile after receiving it. Finally, the automobile will return ~ADDR to the second remote device after receiving ~KW2, and the second remote device can send ~ADDR to the first remote device after receiving it, and the first remote device can send ~ADDR to the diagnostic instrument after receiving it. In this way, the diagnostic instrument and the automobile establish communication with each other, so that diagnosis can be performed.
[0072] In an embodiment, after the second remote device is instructed to send target data to the automobile in a bit-by-bit forwarding manner, i.e., after step S30, the method can further include receiving 0x55 returned by the second remote device. The 0x55 returned by the second remote device is obtained by the second remote device when it receives the first low section in the 0x55 returned by the automobile.
[0073] As mentioned above, the automobile will return 0x55 to the second remote device after receiving the 5-baud section. It should be noted that the binary representation of 0x55 is 01010101, and on this basis, 0x55 has 5 sections of 1-bit low voltage in waveform representation with a start bit 0 and a stop bit 1. Based on this, in the related art, the baud rate is usually determined according to the 5 sections of low voltage (for example, the baud rate is obtained after averaging), and in order to achieve faster forwarding, the automobile returns 0x55, and the second remote device can determine the baud rate when it receives the first section of low voltage, and send 0x55 to the first remote device at the baud rate. That is, the 0x55 received by the first remote device at this time is obtained by the second remote device when it receives the first section of low voltage in the 0x55 returned by the automobile. As can be seen, the embodiment of the present application can save 9-bit processing time and achieve faster forwarding.
[0074] In an embodiment, after the second remote device is instructed to send the target data to the automobile in a bit-by-bit forwarding manner, i.e., after step S30, the method can further include: after sending the KW1 and the KW2 returned from the second remote device to the diagnostic instrument, detecting whether a falling edge occurs; and if the falling edge occurs, sending the stored historical KW2 to the second remote device after being inverted.
[0075] As described above, the second remote device sends the KW1 and the KW2 returned by the automobile to the first remote device, and the first remote device returns the KW1 and the KW2 to the diagnostic instrument. In the related art, the diagnostic instrument sends the ~KW2 to the first remote device for forwarding to the automobile, wherein the start bit of the ~KW2 is also a low level. However, in order to achieve faster forwarding, the first remote device, after returning the KW1 and the KW2 to the diagnostic instrument, can detect that the falling edge occurs, which indicates that the diagnostic instrument starts to send the ~KW2. Therefore, the first remote device can send the historical KW2 stored in advance to the second remote device after being inverted, so as to achieve faster forwarding.
[0076] In an embodiment, after the second remote device is instructed to send the target data to the automobile in a bit-by-bit forwarding manner, i.e., after step S30, the method can further include: receiving the inverted ADDR returned by the second remote device, wherein the inverted ADDR is sent by the second remote device after inverting the historical ADDR stored by the second remote device after detecting the falling edge after sending the inverted KW2 to the automobile; and sending the inverted ADDR to the diagnostic instrument.
[0077] As described above, the second remote device forwards the ~KW2 to the automobile, and the automobile returns the ~ADDR after receiving the ~KW2. In the related art, the second remote device receives the ~ADDR and then forwards the ~ADDR to the first remote device, wherein the start bit of the ~ADDR is also a low level. However, in order to achieve faster forwarding, the second remote device, after sending the ~KW2 to the automobile, can detect that the falling edge occurs, which indicates that the automobile starts to send the ~ADDR. Therefore, the second remote device can send the historical ADDR stored in advance to the first remote device after being inverted, so as to achieve faster forwarding. Of course, the first remote device sends the ~ADDR to the diagnostic instrument after receiving the ~ADDR, so as to establish the current communication.
[0078] Exemplarily, after step S30, the method can be exemplified as follows: after receiving the 5-baud section, the automobile returns 0x55 to the second remote device, at this time, the second remote device can determine the baud rate when receiving the first section low level in 0x55, and return 0x55 to the first remote device at the baud rate, and the first remote device returns 0x55 to the diagnostic instrument after receiving 0x55. Then, the automobile returns KW1 and KW2 to the second remote device, and the diagnostic receives KW1 and KW2 through the forwarding of the second remote device and the first remote device. Then, the first remote device sends the stored historical KW2 to the second remote device after taking the inverse if a falling edge is detected, and the second remote device forwards it to the automobile. Finally, the second remote device sends the stored historical ADDR to the first remote device after taking the inverse if a falling edge is detected, and the first remote device forwards it to the diagnostic instrument. It can be understood that the example can achieve the purpose of faster forwarding.
[0079] The embodiment of the present application further provides a remote device 300, which can include a processor 301 and a memory 302, as shown in the figure. Figure 8 Exemplarily, the processor 301 and the memory 302 can be connected through a bus, for example, through an I2C bus. 2 C (Inter-integrated Circuit) bus.
[0080] Specifically, the processor 301 is configured to provide calculation and control capabilities, and the processor 301 can be a central processing unit (CPU). The processor 301 can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0081] Specifically, the memory 302 can be a flash chip, a read-only memory (ROM), a magnetic disk, an optical disk, a U disk or a mobile hard disk, etc.
[0082] Those skilled in the art can understand that Figure 8The structure shown in the figure is only a block diagram of part of the structure related to the embodiments of the present application, and does not constitute a limitation on the terminal device to which the embodiments of the present application are applied. Specifically, the terminal device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0083] The processor 301 is configured to run the computer program stored in the memory 302 and implement the method provided in any of the embodiments of the present application when the computer program is executed.
[0084] The embodiments of the present application also provide a storage medium for computer readable storage, and the storage medium stores one or more computer programs. The one or more computer programs can be executed by one or more processors to implement the steps of the method provided in the embodiments of the present application.
[0085] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes in the above-mentioned embodiments can be included. Any reference to the memory, storage, database or other medium used in the embodiments of the present application can include at least one of the non-volatile and volatile memories. The non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory. The volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, the RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0086] It should be understood that the descriptions such as "first", "second" and the like in the embodiments of the present application are only for the purpose of description and cannot be understood as indicating or implying the relative importance of the technical features indicated or implying the number of technical features indicated. Therefore, the features defined as "first", "second" can explicitly or implicitly include at least one of the features. In addition, the technical solutions of each embodiment can be combined with each other, but it must be based on the realization of ordinary skilled in the art. When the combination of technical solutions appears contradictory or unachievable, it should be considered that the combination of technical solutions does not exist and is not within the protection scope required by the present application.
[0087] The above merely describes the preferred embodiments of the present application, and is not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation, or direct or indirect application in other related technical fields, which is made according to the content of the present application specification and drawings, is also included in the patent protection scope of the present application.
Claims
1. A remote diagnosis method characterized by comprising: The method is applied to a first remote device which is connected with a diagnostic instrument in a wired mode and connected with a second remote device in a network mode, and the second remote device is connected with a vehicle in a wired mode; the method comprises: receiving a signal sent by the diagnostic instrument, and instructing the second remote device to send a low level to the vehicle when a low level width of the signal reaches a first preset threshold; determining an initialization type adopted by the signal; if the initialization type adopted by the signal is fast initialization, instructing the second remote device to send a high level with a first preset time length to the vehicle when the low level width of the signal reaches a second preset threshold, so as to realize sending of a fast initialization header to the vehicle; sending a current byte in communication start request data in the signal to the second remote device every time one byte in the communication start request data is received, and instructing the second remote device to send the current byte in the communication start request data to the vehicle; instructing the second remote device to send a current byte in communication start response data to the first remote device every time one byte in the communication start response data is received; sending the current byte in the communication start response data to the diagnostic instrument every time one byte in the communication start response data sent by the second remote device is received; if the initialization type adopted by the signal is 5-baud initialization, making the second remote device continue to send the low level to the vehicle until the low level width reaches a third preset threshold, so as to realize sending of a start bit in a 5-baud section to the vehicle; sending a current bit in target data in the signal to the second remote device every time one bit in the target data is received; instructing the second remote device to send the current bit in the target data to the vehicle every time one bit in the target data is received; wherein the target data is data other than the start bit in the 5-baud section.
2. The method of claim 1, wherein, The first preset threshold is greater than or equal to 1 ms.
3. The method of claim 1, wherein, The first remote device is connected with the diagnostic instrument through a communication cable; the method further comprises: establishing communication with the diagnostic instrument by using a data frame sent by the diagnostic instrument.
4. The method of claim 1, wherein, The determination of the initialization type adopted by the signal comprises: determining the initialization type adopted by the signal according to a preset user logic.
5. The method of claim 1, wherein, The determination of the initialization type adopted by the signal comprises: if a rising edge occurs when the low level width of the signal reaches the second preset threshold, it is determined that the initialization type of the signal is fast initialization, otherwise it is determined that the initialization type of the signal is 5-baud initialization.
6. The method of claim 1, wherein, After the receiving of the signal sent by the diagnostic instrument, the method further comprises: determining whether the low level width of the signal reaches a fourth preset threshold; wherein the fourth preset threshold is less than the first preset threshold; if the low level width of the signal reaches the fourth preset threshold, it is further determined whether the low level width of the signal reaches the first preset threshold.
7. The method according to any one of claims 1 to 6, characterized in that, The first preset threshold is set according to a UART byte.
8. The method according to any one of claims 1 to 6, characterized in that, The second preset threshold is set according to a low level duration of the fast initialization header.
9. The method according to any one of claims 1 to 6, characterized in that, After the indication that the second remote device sends the current bit of the target data to the automobile every time a bit of the target data is received, the method further comprises: receiving 0x55 returned by the second remote device; wherein the 0x55 returned by the second remote device is obtained by the second remote device when a first low level in the 0x55 returned by the automobile is received.
10. The method of claim 1, wherein, After the indication that the second remote device sends the current bit of the target data to the automobile every time a bit of the target data is received, the method further comprises: sending KW1 and KW2 returned from the second remote device to the diagnostic instrument, and detecting whether a falling edge occurs; if the falling edge occurs, sending the stored historical KW2 after being inverted to the second remote device.
11. The method of claim 1, wherein, After the indication that the second remote device sends the current bit of the target data to the automobile every time a bit of the target data is received, the method further comprises: receiving inverted ADDR returned by the second remote device; wherein the inverted ADDR is sent by the second remote device after inverting the stored historical ADDR when a falling edge is detected after the inverted KW2 is sent to the automobile; sending the inverted ADDR to the diagnostic instrument.
12. A remote device, characterized by comprise: a memory, the memory storing a computer program; a processor, the processor implementing the steps of the method of any one of claims 1 to 11 when executing the computer program.
13. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 11.
Citation Information
Patent Citations
Vehicle remote diagnosis method, equipment connector and vehicle connector
CN111552268A
Channel allocation method and device, computer equipment and computer readable storage medium
CN114143273A