Detection method, detection result application method and electronic equipment

By detecting the CAN bus signal, determining the baud rate upper limit and using the reference baud rate decoded signal, the problem that the baud rate and sampling point devices cannot communicate without pre-configuration are solved, and the detection efficiency and accuracy are improved.

CN119628991APending Publication Date: 2025-03-14KUNYI ELECTRONICS TECHNOLOGY (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411585706.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-07
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

The prior art is difficult to realize communication between devices that have not pre-configured baud rates and sampling points on the CAN bus.

Method used

The signal on the CAN bus is detected to determine the upper baud rate limit and decode the signal with multiple reference baud rates not greater than the upper limit to determine the detection results of the baud rate and sampling point.

Benefits of technology

The baud rate and sampling point detection efficiency and accuracy are improved, ensuring that the detection results are based on successful decoding, and the baud rate exceeding the upper limit is excluded.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119628991A_ABST
    Figure CN119628991A_ABST
Patent Text Reader

Abstract

The invention relates to a detection method, a detection result application method and electronic equipment, and the method comprises the steps: determining the baud rate upper limit of a CAN bus according to a signal transmitted on the CAN bus; the signals transmitted on the CAN bus are decoded through various reference baud rates not larger than the baud rate upper limit, detection results of the CAN bus are determined according to decoding results, the detection results comprise baud rate detection results and sampling point detection results, and the detection results are sent to the CAN bus. The Baud rate detection result and the sampling point detection result are matched with the successfully decoded Baud rate and sampling point.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of bus technology, and in particular to a detection method, a detection result application method and an electronic device. Background Art

[0002] CAN bus is widely used in vehicles, aviation, rail transportation and other fields. In the CAN bus, it is often necessary to send and receive messages based on pre-set baud rates and sampling points.

[0003] However, for devices connected to the CAN bus but without pre-configured baud rate and sampling point, communication on the CAN bus is often not possible. Summary of the invention

[0004] Based on this, it is necessary to provide a detection method, a detection result application method and an electronic device to address the above technical problems.

[0005] In a first aspect, the present application provides a detection method, comprising: Determine the baud rate upper limit of the CAN bus according to the signal transmitted on the CAN bus; The signals transmitted on the CAN bus are decoded respectively using multiple reference baud rates that are not greater than the baud rate upper limit, and a detection result of the CAN bus is determined based on the decoding result, the detection result includes a baud rate detection result and a sampling point detection result, and the baud rate detection result and the sampling point detection result match the baud rate range and the sampling point range of successful decoding.

[0006] In a second aspect, the present application provides a detection feedback method, comprising: Feedback to the user part or all of the detection results determined by the detection method of the first aspect.

[0007] In a third aspect, the present application provides an electronic device, including a processing module and a channel, characterized in that: The processing module is used to execute the method of the first aspect, and the processing module is connected to the CAN bus through the channel.

[0008] In the detection method, detection result application method and electronic device provided by the present invention, the decoding of the reference baud rate can be used as the basis for the baud rate and sampling point detection results, thereby ensuring that the detected detection results are based on the situation of successful decoding and have a certain accuracy. At the same time, since the reference baud rate is less than the baud rate upper limit, and the baud rate upper limit is based on the actual signal transmitted on the CAN bus, the baud rate exceeding the upper limit is realistically excluded based on the actual signal, and has better exclusion accuracy. It can be seen that the present application ensures that the processing process can be implemented within a limited range while excluding some baud rates more accurately. Compared with the solution that does not exclude some baud rates based on the upper limit, the present application improves the efficiency of baud rate and sampling point detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required to be used in the embodiments of the present application or the related technologies are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work. Figure 1 A schematic diagram of a detection method in an embodiment; Figure 2 is a schematic flow chart of the steps in step S100 in one embodiment; Figure 3 A schematic diagram of the process of step S200 in one embodiment Figure 1 ; Figure 4 A schematic diagram of the process of step S200 in one embodiment Figure 2 . DETAILED DESCRIPTION

[0010] In order to facilitate understanding of the present application, the present application will be described more fully below with reference to the relevant drawings. Embodiments of the present application are provided in the drawings. However, the present application can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present application more thorough and comprehensive.

[0011] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.

[0012] It can be understood that the terms "first", "second", etc. used in the present application can be used in this article to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from another element.

[0013] It should be noted that when an element is considered to be "connected" to another element, it can be directly connected to the other element, or connected to the other element through an intermediate element. In addition, the "connection" in the following embodiments should be understood as "electrical connection", "communication connection", etc. if there is transmission of electrical signals or data between the connected objects.

[0014] When used herein, the singular forms "a", "an", and "said / the" may also include plural forms, unless the context clearly indicates otherwise. It should also be understood that the terms "include / comprise" or "have" etc. specify the presence of stated features, wholes, steps, operations, components, parts or combinations thereof, but do not exclude the possibility of the presence or addition of one or more other features, wholes, steps, operations, components, parts or combinations thereof.

[0015] Part or all of the steps of the detection method and the detection result application method involved in the present application can be implemented by electronic devices. The number of electronic devices, the number of processing modules in each electronic device, and the number of channels in each electronic device can be one or more.

[0016] The electronic device may be any device with data processing capability, such as a circuit board, or at least one of a host computer, a slave computer, a bus communication device, a real-time machine, a bus board, etc. It may also be a combination of a host computer and a slave computer (or a bus communication device, a real-time machine, a bus board). In a specific example, the electronic device may be a test device, such as a back-injection test device, a HIL test device, a simulation test device, an RCP device, etc., or it may be a data acquisition device, a vehicle-mounted device, etc.

[0017] The detection method and detection result application method of the embodiments of the present application can be implemented through one or more devices. The detection method and detection result application method can be implemented through the same electronic device or through different electronic devices. For example, the detection method is implemented through a certain electronic device to determine the detection result, and part or all of the detection result (for example, the final detection result) is fed back to the user through other electronic devices (for example, a locally connected computer, a host computer, an industrial computer, a remotely connected computer, a server, a mobile terminal, etc.).

[0018] Please refer to Figure 1 , the detection method of the embodiment of the present application comprises: S100: determining the baud rate upper limit of the CAN bus according to the signal transmitted on the CAN bus; S200: using a plurality of reference baud rates not greater than the baud rate upper limit to respectively decode the signals transmitted on the CAN bus, and determining the detection result of the CAN bus according to the decoding results.

[0019] The above steps S100 and S200 can be executed by one or more electronic devices. The electronic device can be connected to the CAN bus, and the signal transmitted on the CAN bus can be monitored by the electronic device from the CAN bus. The electronic device can also be not connected to the CAN bus, and the signal transmitted on the CAN bus can be transmitted to the electronic device via other media. For example, the data of the signal transmitted on the CAN bus can be stored in a storage medium, and then the electronic device reads the data stored in the storage medium to execute steps S100 and S200.

[0020] The CAN bus may be a CAN bus, a CANfd bus, or a CANXL bus.

[0021] Among them, the signal transmitted on the CAN bus may include the signal that has been transmitted on the CAN bus in the past, for example, the baud rate upper limit is determined based on the signal transmitted on the CAN bus in a certain time period or several time periods in the past in step S100, and may also include the signal that is being transmitted; the signal transmitted on the CAN bus in step S100 and the signal transmitted on the CAN bus in step S200 may be the same signal or different. Furthermore, in one example, step S100 and step S200 may be respectively performed for the same segment or the same segments of signals, that is: the signal based on which the baud rate upper limit is determined is used to perform decoding; in other examples, step S100 and step S200 may also be respectively performed for two different segments of signals, or two segments of signals that are partially the same (or can be understood as partially overlapping). For ease of understanding, the signal transmitted by the CAN bus in step S100 may be described as a target signal segment, and the signal transmitted by the CAN bus in step S200 may be described as a designated signal segment. The target signal segment and the designated signal segment may be the same signal segment, or different signal segments, or partially overlapping signal segments.

[0022] The signals transmitted on the CAN bus may be what occurs when electronic devices connected to the CAN bus communicate via the CAN bus; The reference baud rate may be understood as the baud rate used to attempt to decode the signal in order to determine the detection result, which may or may not be successfully decoded.

[0023] The decoding result can be understood to include at least: whether the decoding is successful. The judgment criteria and judgment method of whether the decoding is successful can be implemented with reference to the existing technology or improved technology in the field, and all do not depart from the scope of this application. In one example, whether the decoding is successful can be judged based on whether the decoded information complies with the CAN bus protocol specification. If it complies, it is determined that the decoding is successful. If it does not comply, it is determined that the decoding is unsuccessful. In another example, whether the decoding is successful can be judged based on the proportion of the decoded information that complies with the CAN bus protocol specification. If the proportion is higher than the preset standard, the decoding is determined to be successful. If it is not higher than the preset standard, it is determined that the decoding is unsuccessful.

[0024] The detection results include baud rate detection results and sampling point detection results. Any information that can describe the baud rate and sampling point of the CAN bus can be understood as the detection results here, for example, it can be a value range of the baud rate and sampling point, or a specific value of the baud rate and sampling point, or multiple discrete values ​​of the baud rate and sampling point. In any case, the baud rate detection result and the sampling point detection result match the successfully decoded baud rate and sampling point, wherein the successfully decoded baud rate refers to the successfully decoded baud rate in the reference baud rate.

[0025] In the above scheme, the decoding of the reference baud rate can be used as the basis for the baud rate and sampling point detection results, thereby ensuring that the detected detection results are based on the situation of successful decoding and have a certain degree of accuracy.

[0026] At the same time, since the reference baud rate is less than the baud rate upper limit, and the baud rate upper limit is based on the signal actually transmitted on the CAN bus, the baud rate exceeding the upper limit is excluded based on the actual signal, and has better exclusion accuracy. It can be seen that the present application excludes some baud rates more accurately, thereby ensuring that the processing process can be implemented within a limited range. Compared with the solution that does not exclude some baud rates based on the upper limit, the present application improves the efficiency and accuracy of baud rate and sampling point detection.

[0027] In one embodiment, the CAN bus can use two different baud rates, and the two different baud rates include a first baud rate and a second baud rate that is smaller than the first baud rate. Of course, based on the use of two different baud rates, it is not ruled out that the CAN bus also uses other baud rates, such as a third baud rate, a fourth baud rate, etc. As long as the processing procedures recorded in this application are implemented for any two different baud rates, it can be understood as an implementation method of the present application; in one example, the CAN bus can be a CANfd bus, and the CANfd bus can communicate at different baud rates. In one example, the two different baud rates can also be understood as the CAN baud rate as the first baud rate and the CANfd baud rate as the second baud rate.

[0028] Correspondingly, the signal to be decoded includes a signal encoded using the two different baud rates and transmitted via the CAN bus; the baud rate upper limit includes a first baud rate upper limit and a second baud rate upper limit; the number of the reference baud rates is a plurality of groups, and each group of reference baud rates includes a first reference baud rate and a second reference baud rate; The baud rate detection result includes a first baud rate detection result of the first baud rate and a second baud rate detection result of the second baud rate; the sampling point detection result includes a first sampling point detection result corresponding to the first baud rate detection result and a second sampling point detection result corresponding to the second baud rate detection result.

[0029] In addition, for the two reference baud rates, the criteria and methods for determining whether the decoding is successful can also refer to any existing or improved methods in the art. In one example, when determining whether the decoding is successful, for the designated signal segment to be decoded, it can be decoded based on the first reference baud rate (for example, it can also be based on a certain sampling point, which can also be understood as being based on the "combination" mentioned in this application) to determine which first signal segments are successfully decoded, and then it can be decoded using the second reference baud rate (for example, it can also be based on a certain sampling point, which can also be understood as being based on the "combination" mentioned in this application) to determine which second signal segments are successfully decoded, and then the ratio of the first signal segment to the second signal segment as a whole in the designated signal segment is calculated. If the ratio exceeds the preset standard, the decoding is deemed to be successful, and if it does not exceed the preset standard, the decoding is deemed to be unsuccessful.

[0030] The process of step S100 will be executed multiple times, so that: the first baud rate upper limit and the second baud rate upper limit determined each time are used to determine a detection result once; it can also be understood that: each time the baud rate upper limit (for example, including the first baud rate upper limit and the second baud rate upper limit of the CAN bus) is determined according to the signal transmitted on the CAN bus, it can be understood that step S100 is executed once, and then, multiple executions of step S100 are realized. After each execution of step S100, step S200 is executed once. It can also be understood that: each time the baud rate upper limit (for example, including the first baud rate upper limit and the second baud rate upper limit of the CAN bus) is determined, the process of step S200 must be executed once to obtain the corresponding detection result.

[0031] Please refer to Figure 2 , wherein each time the baud rate upper limit (for example, including the first baud rate upper limit and the second baud rate upper limit of the CAN bus) is determined by the following process: S110: Determine a first minimum pulse width and a second minimum pulse width in the signal transmitted by the CAN bus based on the current pulse width jitter range; Wherein, the first minimum pulse width is smaller than the second minimum pulse width, and the width difference between the first minimum pulse width and the second minimum pulse width is larger than the pulse width jitter range; S120: determining the first baud rate upper limit according to the first minimum pulse width; S130: determining the second baud rate upper limit according to the second minimum pulse width; The pulse width is intended to find out the pulse width of one bit of data formed by continuous flipping. Ideally, through continuous bus bit flipping, the pulse width that can be used to represent 1 bit of data (i.e., one bit of data) can be determined, and the baud rate can be calculated based on this. However, for one bit of data at the same baud rate, the pulse width will also fluctuate due to various factors. The longer the signal transmitted on the CAN bus used to execute step S100, the more possibilities of such floating changes it covers. No matter how long, after determining the two minimum pulse widths, although it cannot be ensured that the two pulse widths can be accurately converted into the baud rate, the pulse width representing 1 bit of data at the first baud rate is usually greater than or equal to the first minimum pulse width, and the pulse width representing 1 bit of data at the second baud rate is usually greater than or equal to the second minimum pulse width. Therefore, based on the first minimum pulse width and the second minimum pulse width, the first baud rate upper limit and the second baud rate upper limit can be determined.

[0032] The process of step S110 may occur during the process of monitoring the CAN bus. At this time, the electronic device is connected to the CAN bus, monitors the signal changes on the CAN bus, records and iteratively updates the first minimum pulse width and the second minimum pulse width currently monitored. For example, if the two minimum pulse widths currently recorded and updated are L1 and L2, L1 is smaller than L2, and a pulse width of L3 is monitored at this time, if L3 is smaller than L1, the two minimum pulse widths are updated to L3 and L1, if L3 is smaller than L2 and larger than L1, the two minimum pulse widths are updated to L1 and L3, and if L3 is larger than L2, the two minimum pulse widths are still L1 and L2.

[0033] The process of step S110 may also be directed to a recorded (ie stored) signal, in which two minimum pulse widths are found.

[0034] The pulse width jitter range can be understood as reflecting the size of the pulse width jitter. In other words, for any two pulse widths, only when the difference is large enough to exceed the pulse width jitter range will they be identified as different pulse widths. Otherwise, they should be classified as the same pulse width. It can also be understood that the pulse width jitter range reflects the difference in the pulse width of 1 bit data under two baud rates.

[0035] Furthermore, the pulse width jitter range can be used to take into account the impact of various factors (such as interference, transmission efficiency limitation, monitoring method limitation, environmental factors, synchronization mechanism, etc.) during the communication process. These impacts often result in: even if the same baud rate is used, the pulse width of 1 bit data will jitter, and the introduction of the pulse width jitter range can compensate for the impact of this jitter on the calculation of the baud rate upper limit.

[0036] Therefore, facing the situation that the pulse width of a bit of data at the same baud rate may fluctuate, the above solution chooses to define the baud rate upper limit based on the minimum pulse width, and introduces the pulse width jitter range to compensate for the baud rate calculation error caused by this.

[0037] In an example, if W1 and W2 represent the first minimum pulse width and the second minimum pulse width respectively, and ΔW represents the pulse width jitter range, then: W1 and W2, if not W1<W2, must also satisfy: W2>W1*(1+ΔW), and / or: W1<W2*(1-ΔW).

[0038] Among them, the pulse width jitter range used each time the baud rate upper limit is determined can be different or the same. If different, in one example, the pulse width jitter range used each time the baud rate upper limit is determined is gradually changed with a specified step size; for example: after each execution of steps S110-S130, a new pulse width jitter range can be taken with a certain step size, for example, the jitter is adapted to the width of 1%~25% stepping by 1%, for example: first take △W=25% to execute steps S110-S130 (and then execute step S200), then take △L=24% to execute steps S110-S130 (and then execute step S200), and so on.

[0039] The signal transmitted on the CAN bus used for determining the baud rate upper limit each time (which can be described as a target signal segment) may be the same or different.

[0040] It can be seen that in one example, steps S110-S130 can be executed multiple times using different target signal segments with the same pulse width jitter range; in another example, steps S110-S130 can be executed multiple times using different target signal segments with the same pulse width jitter range; in yet another example, steps S110-S130 can be executed multiple times using different target signal segments with different pulse width jitter ranges, and step S200 can be executed once each time steps S110-S130 are executed.

[0041] Regardless of the logic used to loop through steps S110-S130, it can ensure that the determined baud rate upper limit is adapted to the corresponding situation. By looping through the steps, it can adapt to a variety of situations and ensure that the final detection result can more accurately reflect the baud rate and the detection result.

[0042] In one implementation, please refer to Figure 3 , step S200 may include: S210: constructing multiple combinations of baud rate sampling points based on a plurality of preset baud rates and a plurality of sampling points; Each of the combinations includes a first reference baud rate, a second reference baud rate, a first reference sampling point, and a second reference sampling point; the first reference baud rate in each of the combinations is less than the first baud rate upper limit, and the second reference baud rate in each of the combinations is less than the second baud rate upper limit; in each of the combinations, the second reference baud rate is less than the first reference baud rate, the first reference baud rate and the second reference baud rate are selected from the plurality of preset baud rates, and the first reference sampling point and the second reference sampling point are selected from the plurality of sampling points; the plurality of sampling points may be, for example, values ​​of all sampling points of 5% to 95% obtained by continuously phase shifting a high-frequency clock, or may be preset; S220: Decoding the signal transmitted on the CAN bus using each of the combinations, and determining value range information according to the first reference baud rate, the second reference baud rate, the first reference sampling point, and the second reference sampling point in the successfully decoded combination; The value range information includes: a value range of the first baud rate, a value range of the second baud rate, a value range of the first sampling point, and a value range of the second sampling point; After step S220, step S230 may be performed: using the value range information as the detection result, or step S240 may be performed: determining the detection result according to the value range information. Of course, both step S230 and step S240 may be performed.

[0043] The difference between step S240 and S230 is mainly reflected in that step S230 directly uses the value range as the detection result obtained by executing step S200 this time, while step S240 needs to perform further calculation on this basis to obtain the corresponding detection result.

[0044] For example, step S240 may include at least one of the following: Calculating a statistical value of a value range of the first baud rate as the first baud rate detection result; Calculating a statistical value of a value range of the second baud rate as the first baud rate detection result; Calculating a statistical value of a value range of the first sampling point as a detection result of the first sampling point; A statistical value of a value range of the second sampling point is calculated as the second sampling point detection result.

[0045] The statistical value may be, for example, an average value, and the possibility of other statistical values ​​is not excluded.

[0046] In an example, the following takes the process of determining the detection result for the nth time as an example to illustrate the implementation process of step S220 in the process of determining the detection result each time, which may include: According to the first reference baud rate, the second reference baud rate, the first reference sampling point and the second reference sampling point in the successfully decoded combination, the value range information determined when the detection result is determined for the n-1th time is updated to obtain the latest value range information.

[0047] Specifically: In the process of determining the detection result for the first time and thus executing step S220, according to the first reference baud rate, the second reference baud rate, the first reference sampling point, and the second reference sampling point in the decoded combination, the smallest first reference baud rate can be found as the minimum value of the first baud rate, and the largest first reference baud rate can be found as the maximum value of the first baud rate, thereby obtaining the value range information of the first baud rate. Similarly, the value range information of the second baud rate, the sampling point corresponding to the first baud rate, and the sampling point corresponding to the second baud rate can be found; In the process of determining the detection result for the second time and thus executing step S220, the smallest first reference baud rate and the largest first reference baud rate can be found according to the first reference baud rate, the second reference baud rate, the first reference sampling point, and the second reference sampling point in the decoded combination, and the smallest first reference baud rate is compared with the minimum value of the value range information of the first baud rate determined last time, and the larger value is taken as the latest minimum value of the value range information of the first baud rate, so as to update the minimum value of the value range information of the first baud rate, and the largest first reference baud rate is compared with the maximum value of the value range information of the first baud rate determined last time, and the smaller value is taken as the latest maximum value of the value range information of the first baud rate, so as to update the maximum value of the value range information of the first baud rate, and further, the update of the value range information of the first baud rate is realized. Similarly, the update of the value range information of the second baud rate, the sampling point corresponding to the first baud rate, and the sampling point corresponding to the second baud rate can be realized.

[0048] It can be seen that the range of the latest value range information determined each time is not less than the value range information determined last time; thereby the value range information is continuously narrowed, and the values ​​of the first baud rate and its sampling point, and the second baud rate and its sampling point are continuously refined.

[0049] In one example, the detection result determined last time can be used as the final detection result, and / or: the statistical value of the upper limit value and the lower limit value of the value range information determined last time can be used as the final detection result. For example, the average value of the first baud rate, the average value of the corresponding sampling point, the average value of the second baud rate, and the average value of the corresponding sampling point calculated last time can be used as the final detection result.

[0050] In addition, the goal of the above process is to reflect the test results obtained by executing steps S100 and S200 in each cycle in the final test result, so: In some examples, the above solution can be used to update the information based on the previous detection result each time, for example, by continuously narrowing the value range information; In some other examples, the test result (such as the value range) of each loop can be obtained, and then all the test results are finally aggregated into the final test result; For example, for the first baud rate, each time the detection result is determined, the smallest first reference baud rate is found in the combination successfully decoded this time as the minimum value of the first baud rate, and the largest first reference baud rate is found as the maximum value of the first baud rate, thereby obtaining the value range information of the first baud rate; In an example based on this, the intersection of all value ranges of each detection result can be taken as the final detection result, or: the statistical value (such as the average value) of the intersection can be calculated as the final detection result; In another example based on this, an average value may be calculated based on the value range information detected each time, and then the average value of each average value may be taken as the final detection result; In other examples, still taking the first baud rate as an example, the first reference baud rate in the combination of successful decoding can be used each time to find the smallest first reference baud rate as the minimum value of the first baud rate, and the largest first reference baud rate as the maximum value of the first baud rate, so as to calculate the average value of the first baud rate as the initial average value, and then, in each cycle except the first cycle, the initial average value calculated this time and the target average value calculated last time are averaged as the target average value of this cycle. Then, the target average value determined last time can be used as the final detection result.

[0051] By analogy with the above method, the final detection results of the second baud rate, and the sampling points corresponding to the first baud rate and the second baud rate can also be obtained in the same way.

[0052] The present application embodiment further provides a detection result application method, which may include S300 and / or S400: S300: Feedback to the user part or all of the detection results determined by the above detection method; S400: Based on part or all of the detection results determined by the above detection method, fault injection is performed on the CAN bus.

[0053] The part or all of the test results involved may, for example, include part or all of the test results obtained by executing step S200 each time, or may include part or all of the final test results, or may include both part or all of the test results obtained by executing step S200 each time and part or all of the final test results.

[0054] The feedback of step S300 may be displayed, for example; The feedback of step S300 can be immediate or post-event. The fault injection of step S300 can be performed by the same electronic device immediately after steps S100 and S200, or can be performed by other electronic devices or by the same electronic device at another time after the detection results are stored.

[0055] For example, steps S100 and S200 can be executed in a simulation test device (i.e., an electronic device). The simulation test device can be connected to the CAN bus and obtain the detection results when collecting CAN bus data. Then, step S300 is executed through the simulation test device or other electronic device. After the detection results are fed back to the user, the user can trigger the sending of a test message to the CAN bus based on the detection results.

[0056] The fault injection of step S400 may be performed immediately after steps S100 and S200 through the same electronic device, or after the test results are stored, it may be performed at another time through another electronic device or by the same electronic device. For example, steps S100 and S200 may be performed in a data acquisition device (i.e., an electronic device) to obtain the test results when the CAN bus data is collected, and step S400 may be performed in a data injection device (i.e., another electronic device) to achieve fault injection in the process of injecting the collected CAN bus data back into the device under test (e.g., ECU and / or sensor) through the CAN bus.

[0057] The embodiments of the present application provide electronic devices that implement the corresponding functions in the above-mentioned various optional schemes. The electronic device may include a processing module for executing the above-mentioned method (e.g., a detection method, and another example, a detection result application method), and the processing module may be implemented by an FPGA or a processor such as a CPU, and the processing module may read and execute a program in a memory to execute the above-mentioned method.

[0058] An embodiment of the present application also provides a testing system, including some or all of the above-mentioned electronic equipment.

[0059] The test systems can be simulation test systems, hardware-in-the-loop test systems, data injection test systems, bus test analysis systems, simulation test systems, etc.

[0060] The embodiment of the present application also provides a data acquisition system, including some or all of the above electronic devices. For example, in the process of collecting data on the CAN bus (that is, recording and storing all the data transmitted on the CAN bus), the detection result of the CAN bus can be determined based on the collected data, and the detection result can be fed back to the user during the data collection process.

[0061] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0062] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above-mentioned method embodiments when executed by a processor.

[0063] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the computer program can be stored in a non-volatile readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0064] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0065] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A detection method, characterized in that: include: Determine the baud rate upper limit of the CAN bus according to the signal transmitted on the CAN bus; The signals transmitted on the CAN bus are decoded respectively using multiple reference baud rates that are not greater than the baud rate upper limit, and a detection result of the CAN bus is determined based on the decoding result, the detection result including a baud rate detection result and a sampling point detection result, and the baud rate detection result and the sampling point detection result match the successfully decoded baud rate and sampling point.

2. The detection method according to claim 1, characterized in that: The CAN bus can use two different baud rates, the two different baud rates include a first baud rate and a second baud rate that is less than the first baud rate; and the signal to be decoded includes a signal encoded using the two different baud rates and transmitted via the CAN bus; The baud rate upper limit includes a first baud rate upper limit and a second baud rate upper limit; The number of the reference baud rates is multiple groups, and each group of reference baud rates includes a first reference baud rate and a second reference baud rate; The baud rate detection result includes a first baud rate detection result of the first baud rate, and a second baud rate detection result of the second baud rate; The sampling point detection result includes a first sampling point detection result corresponding to the first baud rate detection result, and a second sampling point detection result corresponding to the second baud rate detection result.

3. The detection method according to claim 2, characterized in that: According to the signal transmitted on the CAN bus, the process of determining the baud rate upper limit of the CAN bus is performed multiple times, wherein each time the first baud rate upper limit and the second baud rate upper limit are determined by the following process: Based on the current pulse width jitter range, determining a first minimum pulse width and a second minimum pulse width in the signal transmitted by the CAN bus; the first minimum pulse width is smaller than the second minimum pulse width, and the width difference between the first minimum pulse width and the second minimum pulse width is greater than the pulse width jitter range; Determining the first baud rate upper limit according to the first minimum pulse width; The second baud rate upper limit is determined according to the second minimum pulse width.

4. The detection method according to claim 3, characterized in that: The pulse width jitter range used when determining the baud rate upper limit each time is different, and the pulse width jitter range used when determining the baud rate upper limit each time changes gradually with a specified step size.

5. The detection method according to claim 2, characterized in that: Decoding the signals transmitted on the CAN bus respectively using a plurality of reference baud rates not greater than the baud rate upper limit, and determining the baud rate detection result and the sampling point detection result of the CAN bus according to the decoding results, including: Based on a number of preset baud rates and a number of sampling points, construct multiple combinations of baud rate sampling points; Wherein, each of the combinations includes a first reference baud rate, a second reference baud rate, a first reference sampling point, and a second reference sampling point; the first reference baud rate in each of the combinations is less than the first baud rate upper limit, the second reference baud rate in each of the combinations is less than the second baud rate upper limit, and the second reference baud rate in each of the combinations is less than the first reference baud rate; the first reference baud rate and the second reference baud rate are selected from the plurality of preset baud rates, and the first reference sampling point and the second reference sampling point are selected from the plurality of sampling points; Decoding the signal transmitted on the CAN bus by using each of the combinations, and determining value range information according to the first reference baud rate, the second reference baud rate, the first reference sampling point, and the second reference sampling point in the successfully decoded combination, wherein the value range information includes: a value range of the first baud rate, a value range of the second baud rate, a value range of the first sampling point, and a value range of the second sampling point; Using the value range information as the detection result, and / or: determining the detection result based on the value range information.

6. The detection method according to claim 5, characterized in that: The process of determining the baud rate upper limit of the CAN bus according to the signal transmitted on the CAN bus is performed multiple times, so that: the first baud rate upper limit and the second baud rate upper limit determined each time are used to determine a detection result once; In the process of determining the detection result for the nth time, determining the value range information according to the first reference baud rate, the second reference baud rate, the first reference sampling point, and the second reference sampling point in the successfully decoded combination includes: According to the first reference baud rate, the second reference baud rate, the first reference sampling point and the second reference sampling point in the successfully decoded combination, the value range information determined when the detection result is determined for the n-1th time is updated to obtain the latest value range information.

7. The detection method according to claim 5, characterized in that: Determining the detection result according to the value range information includes: Calculating a statistical value of a value range of the first baud rate as the first baud rate detection result; Calculating a statistical value of a value range of the second baud rate as the first baud rate detection result; Calculating a statistical value of a value range of the first sampling point as a detection result of the first sampling point; A statistical value of a value range of the second sampling point is calculated as the second sampling point detection result.

8. The detection method according to claim 6, characterized in that: The range of the latest value range information determined each time shall not be less than the value range information determined last time; The detection method further comprises: The last determined detection result is used as the final detection result, and / or the statistical value of the value range information determined last is used as the final detection result.

9. A method for applying a test result, characterized in that: include: Feedback to the user part or all of the test results determined by the test method according to any one of claims 1 to 8; and / or: Based on part or all of the detection results determined by the detection method according to any one of claims 1 to 8, fault injection is performed on the CAN bus.

10. An electronic device, characterized in that: It comprises a processing module, characterized in that the processing module is used to execute the method according to any one of claims 1 to 9.

11. A testing system, characterized in that: The electronic device comprising claim 10.

12. A data acquisition system, characterized in that: The electronic device comprising claim 10.