CAN message processing method, information display method and system

By determining and displaying the delay information of CAN messages, the problem that the CAN bus arbitration segment has difficulty in reflecting the impact of the CAN bus arbitration segment on message transmission is solved, providing effective data support for the development process, and optimizing the real-time and efficiency of the equipment.

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

Patent Information

Application Number
CN202411280674.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-12
Publication Date
2025-01-14

AI Technical Summary

Technical Problem

In the prior art, in the development process of equipment that realizes communication through the CAN bus, it is difficult to reflect the impact of the arbitration section on CAN message transmission and reception, resulting in the development of equipment being unable to accurately meet the needs.

Method used

Provide a CAN message processing method, which determines the transmission delay information of the target CAN message, displays the statistical results of the transmission delay information and the corresponding transmission delay of each ID information, and helps developers understand the impact of ID information on the transmission of CAN messages.

Benefits of technology

By accurately determining the sending delay information, it provides effective data support for the development process, helping developers optimize ID information configuration and algorithm processes, and ensuring the real-time, accuracy and efficiency of the device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119316261A_ABST
    Figure CN119316261A_ABST
Patent Text Reader

Abstract

The invention relates to a CAN message processing method, a CAN message display method, a bus communication device and a bus communication system. The CAN message processing method comprises the following steps: for a target CAN message which can be successfully sent to a CAN bus, determining sending delay information of the target CAN message; wherein the sending delay information is matched with the duration of a sending process and is associated with ID information of an arbitration segment of the target CAN message; the sending process is a process in which the bus interaction circuit obtains the target CAN message to be sent and then sends the target CAN message to the CAN bus.
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 CAN message processing method, information display method and system. Background Art

[0002] CAN bus is widely used in the fields of vehicles, aviation, rail transportation, etc. On a CAN bus, only one message is usually allowed to be successfully transmitted at the same time. Therefore, it is often necessary to decide which message will be sent first based on the arbitration segment in the message.

[0003] In the prior art, for devices that communicate via the CAN bus (such as domain controllers, sensors), in order to support the development of such devices (such as algorithm research, circuit design, function verification, testing, etc.), it is often necessary to carry out simulation testing, vehicle-mounted data collection, etc., so as to obtain various data for supporting development. Such data often includes CAN messages monitored from the CAN bus. However, such data often finds it difficult to reflect the impact of the arbitration segment on the sending and receiving of CAN messages.

[0004] When developers are not aware of this impact, the result is often that the devices they develop cannot accurately and specifically meet the requirements. Summary of the invention

[0005] Based on this, it is necessary to provide a CAN message processing method, information display method and system to address the above technical problems.

[0006] In a first aspect, the present application provides a method for processing a CAN message, comprising:

[0007] For a target CAN message that can be successfully sent to the CAN bus, determining sending delay information of the target CAN message;

[0008] in:

[0009] The sending delay information matches the duration of the sending process;

[0010] The sending process is a process in which the bus interaction circuit acquires the target CAN message to be sent and then sends the target CAN message to the CAN bus.

[0011] In a second aspect, the present application provides an information display method, including: displaying sending delay information, and / or: displaying statistical results of the sending delay information corresponding to each ID information; wherein the sending delay information is determined by the method provided in the first aspect.

[0012] In a third aspect, the present application provides a system, comprising: a bus communication device, wherein the bus communication device is used to execute the method provided in the first aspect, and the bus communication device includes the bus interaction circuit.

[0013] In a fourth aspect, a bus communication device includes a bus interaction circuit; the bus interaction circuit is used in the method provided in the first aspect.

[0014] In the above-mentioned CAN message processing method, information display method and system, the sending delay information corresponding to the target CAN message is determined, because the sending delay information matches the duration of the sending process, and the sending process refers to the process of sending the target CAN message to the CAN bus after the bus interaction circuit obtains the target CAN message to be sent, and the sending delay information is associated with the ID information of the target CAN message. Therefore, the sending delay information can show the influence of the ID information on the sending speed of the CAN message, providing sufficient and effective data support for product development. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be 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 paying creative work.

[0016] Figure 1 An example of an application environment in one embodiment Figure 1 ;

[0017] Figure 2 An example of an application environment in one embodiment Figure 2 ;

[0018] Figure 3 An example of an application environment in one embodiment Figure 3 ;

[0019] Figure 4 A schematic flow chart of a processing method in one embodiment;

[0020] Figure 5 FIG. 4 is a flow chart of step S300 in an embodiment. DETAILED DESCRIPTION

[0021] 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.

[0022] 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.

[0023] 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.

[0024] 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.

[0025] 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.

[0026] The CAN message in the embodiment of the present application may refer to any message that needs to be transmitted via the CAN bus. A bus communication device may be connected to the CAN bus, and the CAN message may be sent to the CAN bus via the bus communication device. The CAN in the present application may refer to the traditional CAN, or may refer to CANFD or CANXL, that is, the CAN bus in the embodiment of the present application may refer to a bus that communicates based on at least one of the following protocols: CAN, CANFD, CANXL.

[0027] In the application scenario of the embodiment of the present application, Figure 1 As shown, a bus communication device is used, and the bus communication device can be connected to a bus, and a real bus device can be connected to the bus, wherein the bus includes at least a CAN bus, and in other examples, it can also include at least one of a LIN bus, a Flexray bus, an in-vehicle Ethernet bus, a DSI3 bus, a PSI5 bus, etc.

[0028] The bus communication device may be understood as a device that can send messages on a bus (including at least a CAN bus) in a manner that satisfies the bus protocol. Of course, in some examples, it can also receive messages.

[0029] Sending a message may be only one of the functions of a bus communication device, but not its only function. In one example, the bus communication device may be a bus adapter, a bus interaction device, a bus board, etc. In another example, the bus communication device may also be a recorder for recording bus data. In another example, the bus communication device may also be a test device for simulating a bus, or for simulating a real bus device based on a bus. In another example, the bus communication device may also be an AD data acquisition device for collecting and recording data from various onboard devices in a vehicle (e.g., data transmitted via the bus). In addition, the bus communication device may be a circuit board device, or a device including structures such as a circuit board and a housing.

[0030] Please refer to Figures 1 to 3 The bus communication device includes a bus interaction circuit (also understood as a CAN bus interaction circuit). The bus interaction circuit can be directly connected to the CAN bus or connected to the CAN bus via a bus transceiver. Of course, the bus transceiver can also be used as part or all of the bus interaction circuit.

[0031] Regardless of the method, the bus interaction circuit can be understood as: at least being able to send CAN messages to the CAN bus in a manner that meets the arbitration requirements of the CAN protocol (or CANFD protocol, CANXL protocol). Further, the bus interaction circuit can usually meet the requirements of: sending CAN messages to the CAN bus in a manner required by the CAN protocol (or CANFD protocol, CANXL protocol).

[0032] In one example, the bus interaction circuit can be implemented by FPGA, which can also be understood as: the bus communication device includes an FPGA circuit, the FPGA circuit includes part or all of the bus interaction circuit, and further, the bus communication device can also include peripheral circuits for helping the FPGA and the bus interaction circuit to realize their functions, and the bus interaction circuit can include one or more FPGAIPs in the FPGA circuit. In other examples, the functions of the bus interaction circuit can also be implemented by other processing circuits (such as CPU). If the bus interaction circuit is connected to the CAN bus via a bus transceiver, the bus transceiver is connected between the FPGA circuit (such as the bus interaction circuit therein) and the CAN bus.

[0033] In a specific example, the CAN message sent by the bus interaction circuit is usually not generated by the bus interaction circuit, but may be received from a processing circuit (such as a CPU) in a bus communication device, or directly or indirectly from an external computer.

[0034] The computer involved in the embodiments of the present application may refer to a host computer, an industrial computer, or a computer or mobile terminal that remotely communicates with a bus communication device.

[0035] A real bus device may be connected to the bus (e.g., CAN bus). A real bus device may be understood as any electronic device that can be connected to the bus and send and / or receive messages on the bus. The real bus device may be in the development process or already developed. In some examples, the real bus device may include a device that can be installed in a vehicle after development and connected to the bus in the vehicle. Specifically, the real bus device may be a controller (e.g., ECU), a sensor, etc. In some examples, the real bus device may also include: a test bench.

[0036] In one example, if the bus is mainly used in the field of vehicles, the bus usually refers to a vehicle bus. Of course, the vehicle bus only indicates that this type can be used in vehicles or is often used in vehicles, and does not mean that the bus involved in the embodiments of the present application must be a bus that has been installed in the vehicle. Therefore, the bus may be installed in the vehicle or not installed in the vehicle.

[0037] The real bus device and the bus communication device can be connected via one bus or multiple buses. For example, the real bus device is an ECU, and the ECU is connected to the bus communication device via the vehicle Ethernet bus, CAN bus, LIN bus, and Flexray bus. The bus can be connected to one real bus device or multiple real bus devices.

[0038] In one example, the bus communication device may include a bus interaction circuit and a processing circuit (such as a CPU), wherein the processing circuit may include a processor sufficient to run embedded operating system (such as Linux, EOS, Windows CE, etc.) software. Figure 2 The first processing circuit shown or Figure 3 The second processing circuit shown in FIG. Figure 2 Taking the first processing circuit shown in FIG. 1 as an example, the processing circuit can be directly connected to the display device, so that the display device can display the required content (such as sending delay information and / or its statistical results). Of course, Figure 3Taking the second processing circuit shown as an example, the processing circuit can also be connected to a computer (e.g., a host computer), and the display device can display the content to be displayed (e.g., sending delay information and / or its statistical results) through the computer. The display device can be directly connected to the bus communication device, and remote display can also be achieved.

[0039] In another example, the processing circuit of the bus communication device may not be sufficient to run an embedded operating system. In this case, the CAN message can be generated by the processing circuit, or it can be obtained from the computer by the processing circuit through USB, Ethernet, etc. and sent to the bus interaction circuit. The content to be displayed (such as sending delay information and / or its statistical results) can also be fed back to the computer in the same way.

[0040] In another example, the bus communication device may include a bus interaction circuit, which is connected to a computer, obtains a target CAN message from the computer, and feeds back the content to be displayed (such as sending delay information and / or its statistical results) to the computer.

[0041] In another example, the FPGA circuit includes both bus interaction circuits and other communication circuits (such as USB communication circuits, Ethernet communication circuits, etc.), and the other communication circuits are used to connect to a computer to interact with CAN messages, content to be displayed, etc.

[0042] Furthermore, a computer may refer to a computer connected to a bus communication device (for example, at least one of an FPGA circuit, a processing circuit, a bus interaction circuit, etc. connected to a bus communication box via a corresponding interface or chip) through at least one means such as Ethernet or USB, or a computer that remotely accesses a bus communication device via the Internet.

[0043] The hardware architecture is not limited to Figures 1 to 3 As shown, the CAN message processing method of the embodiment of the present application can be executed by a bus communication device, can be executed by the bus interaction circuit therein, or can be executed jointly by the bus interaction circuit and the processing circuit therein. The CAN message processing method of the embodiment of the present application does not exclude the possibility of being implemented on a computer (such as a host computer, an industrial computer), etc.

[0044] In addition, the application scenarios of the embodiments of the present application may not be limited to the development process of vehicle-mounted equipment (such as domain controllers and sensors for vehicles), but may also be applied to aerospace, electric power and other fields.

[0045] Please refer to Figure 4 , the method for processing a CAN message in an embodiment of the present application includes:

[0046] S100: for a target CAN message that can be successfully sent to the CAN bus, determining sending delay information of the target CAN message;

[0047] S200: Determine the statistical result of the transmission delay information corresponding to each ID information according to the transmission delay information of multiple CAN messages.

[0048] in:

[0049] The target CAN message can be understood as a CAN message for which the sending delay information needs to be determined. In one example, all CAN messages that need to be sent through the bus interaction circuit can be used as target CAN messages. In another example, CAN messages with specific ID information can also be selected as target CAN messages. The specific ID information can be, for example, ID information within a preset interval. Then, CAN messages for which the sending delay information needs to be determined can be selectively selected, and statistical analysis and observation of CAN messages with some ID information can be carried out in a targeted manner.

[0050] The sending delay information matches the duration of the sending process, wherein the match can at least be understood as: for the sending processes of different CAN messages, if the duration of the sending process is the same, the corresponding sending delay information is also the same; in other words, the sending delay information can be understood as being used to represent the duration of the sending process.

[0051] In a specific example, the sending delay information can be the duration of the sending process itself, or: the sending delay information is different from the duration, but the difference is smaller than a preset error standard (which can be understood as an error in a statistical sense). The sending delay information can also be information obtained after processing the duration, such as information obtained after at least one of grading, correcting, and converting the duration.

[0052] The sending process is a process in which the bus interaction circuit obtains the target CAN message to be sent and then sends the target CAN message to the CAN bus;

[0053] In one example, the sending process includes: a first waiting process, that is, a process in which the bus interaction circuit waits for the specified CAN message of other bus nodes on the CAN bus to complete transmission on the CAN bus.

[0054] Among them, the ID information of the arbitration segment of the designated CAN message is smaller than the ID information of the arbitration segment of the target CAN message, and thus, the priority of the designated CAN message is higher than that of the target CAN message. It can be seen that the designated CAN message can be understood as a CAN message sent by other bus nodes that will compete with the target CAN message for the CAN bus and has a higher priority than the target CAN message.

[0055] The other bus nodes can be understood as: bus nodes that are not used to send the target CAN message, and can also be understood as: if the bus node that sends the target CAN message is recorded as the target bus node, then the other bus nodes are other bus nodes that are not the target bus nodes and can send messages on the CAN bus. In one example, the bus interaction circuit can be connected to the CAN bus through a channel, and then the channel can be understood as the target bus node for sending the target CAN message. The other bus nodes generally refer to bus nodes that are not bus interaction circuits. In another example, the bus interaction circuit can be connected to the CAN bus through multiple channels, and then each channel can be understood as a bus node of the CAN bus. Then, for the target CAN message, the so-called other bus nodes may also include: other channels in the bus interaction circuit that are not used to transmit the target CAN message, and / or bus nodes of the non-bus interaction circuit. In addition, if the other bus node is another channel of the bus interaction circuit, then the specified CAN message can also be used as the target CAN message to determine its sending delay information.

[0056] In the embodiment of the present application, the so-called delay in the sending delay information may generally represent the delay between the actual successful sending time caused by the bus interaction device executing the target CAN message sending and the time when the message is received.

[0057] In comparison, in some technologies, the delay of CAN messages may refer to the delay between the time when the CAN message is actually successfully sent to the bus and the time stamp of the CAN message. In comparison, the embodiments of the present application may more accurately reflect the delay caused by the circuit in the process of executing the sending step, that is, the present application focuses more accurately on the delay caused by the execution of the bus interaction circuit, which may accurately cover the delay caused by having to wait for other messages on the CAN bus to be transmitted due to the large ID information, and may also cover the delay caused by having to wait for the busyness of the CAN bus (such as the load rate) to change to a time suitable for sending the target CAN message due to the large ID information. If the timestamp is used as the basis, the time processed at the software layer (such as the operating system) will also be calculated.

[0058] The reason why this application needs to determine the sending delay information so accurately and exclude the time before the bus interaction circuit obtains the target CAN message (especially the time of various processing at the software level) from the sending delay information is to better assist development work.

[0059] For example, for developers, taking the development of vehicle domain control as an example, the vehicle domain control and various sensors need to be connected to the CAN bus. During the development process, it is necessary to configure corresponding ID information for various CAN messages that may interact with domain control, sensors, etc. Different ID information configuration strategies may affect the accuracy and efficiency of the response processing of the entire system. Different processing algorithms constructed based on the same configuration strategy of ID information will also be different. During the development process, it is best to accurately know how much delay will be caused by the specific process of executing CAN message sending, so as to better configure the ID information of various CAN messages and specific algorithm processes. If the method of the embodiment of the present application is applied to the test verification process, in an example, a configuration strategy for ID information can be used first, and then the sending delay information and / or its statistical results can be observed and analyzed, and then another configuration strategy for ID information can be adjusted accordingly or the algorithm process can be changed. Of course, this can be performed during the test and verification phase, so the sending and receiving functions of some or all of the messages of the domain controller, sensor, etc. can be implemented by simulation module simulation, as long as the predefined information is pre-configured (for example, defining the messages it receives and / or sends, or its sending and receiving logic, etc.) and executed accordingly. In another example, real domain controllers and sensors can also be used to execute the method of the embodiment of the present application in a real vehicle environment to determine the sending delay information and / or its statistical results, which can provide support for subsequent development. For example, the sending delay information and / or its statistical results can be measured in a real vehicle environment, and then the domain controller, sensor, etc. under development can be designed based on this (for example, the ID information of various CAN messages can be designed, and the algorithm flow of the domain controller and / or sensor can be designed).

[0060] For this reason, there is a need to specifically determine the sending delay information in this application. In other words, only under this need, the time waiting for other CAN messages with smaller ID information to complete transmission on the CAN bus and the time waiting for the load rate to change to a time suitable for transmitting the target CAN message become particularly important. In order to better reflect this, we choose to determine the sending delay information so accurately, and exclude the time before the bus interaction circuit obtains the target CAN message (especially the time for various processing at the software level) from the sending delay information.

[0061] In the specific example, it can also be understood that: Generally speaking, whether it is a domain control or a sensor, it has software-level processing and CAN chip receiving and sending processing. The sending delay information of this application can more accurately reflect the actual scenario. The CAN chip (its function can be understood as being implemented by the bus interaction circuit through FPGA, and it can also be understood as part or all of the bus interaction circuit of this application, that is, using an existing CAN chip) The sending execution process will probably bring about how much delay.

[0062] In summary, it can be seen that what is determined in this application is the "sending delay information", which accurately focuses on the delay caused by the execution of the sending process, rather than the so-called delay determined based on the timestamp. It can provide effective data support for the development process. The delay determined based on the timestamp can only prove that compared with the timestamp, the CAN message has a certain degree of delay, and there is no way to reflect which link causes this delay, that is, it is not the "sending delay information" in this application.

[0063] In addition, the delay calculation process of the present application may not rely on the timestamp in the CAN message and the local clock, and the accuracy of the transmission delay information itself will not necessarily be significantly affected by inaccurate or unstable timestamps and local clocks.

[0064] Specifically, the following are a few examples to illustrate: if there is no timestamp in the message, then the solution of calculating the delay based on the timestamp cannot be implemented at all, but the specific solution of the present application may not be limited to this; if there is a timestamp in the message, but the CAN message is sent by the host computer based on the timestamp and the local time, then when the delay is calculated based on the timestamp, the delay caused by the transmission of the host computer and the inaccuracy of the local time of the host computer will be included in the delay calculation process, and the duration of the sending process (that is, the delay caused by the sending process) cannot be accurately expressed, but the specific solution of the present application may not be affected by this; even if the bus communication device maintains the local time (such as the local time of the embedded operating system), the bus communication device sends the message according to the local time and the timestamp of the message, and the calculated delay must include the time for software layer processing (such as the time to construct the message), and the specific solution of the present application may not be affected by this.

[0065] Step S100 can be executed by the bus interaction circuit of the bus communication device. At the same time, because the CAN message is sent by the bus interaction circuit in accordance with the arbitration mechanism of the CAN protocol, the sending delay information determined by the bus interaction circuit is often more accurate. For example, because it is sent by itself, the bus interaction circuit can accurately know when it is successfully sent and when the target CAN message and sending instructions are obtained at the first time, so the calculated sending delay information can be more accurate. In other examples, the sending delay information can also be determined by other devices or other circuits in the bus communication device (such as processing circuits, computers, etc.), which is usually determined based on the information fed back by the bus interaction circuit. For example, the bus interaction circuit can feed back the information of the starting time and settlement time of the corresponding sending process to the processing circuit, computer, etc., and the sending delay information is calculated by others.

[0066] Step S200 can be executed by the bus interaction circuit in the bus communication device, or by other devices or other circuits in the bus communication device (such as processing circuits, computers, etc.). It can be seen that if step S200 is not executed by the bus interaction circuit, step S200 can be changed to: sending the transmission delay information (directly or indirectly) to a designated device, so that the designated device determines the statistical results of the transmission delay information corresponding to each ID information based on the transmission delay information of multiple CAN messages. The designated device can be, for example, a processing circuit in the bus communication device, or a computer connected to the bus communication device proximally or remotely.

[0067] The multiple CAN messages involved in step S200 include the target CAN message, or it can be understood that: each CAN message in the multiple CAN messages can be used as the target CAN message when determining the corresponding sending delay information.

[0068] When calculating the statistical results of a certain ID information, statistics can be performed based only on the sending delay information of CAN messages sent by one bus communication device, or based on the sending delay information of CAN messages sent by multiple bus communication devices. Statistics can be performed based on all CAN messages with sending delay information, or statistics can be performed only for CAN messages in a specified time period and / or specified environment (for example, a specified real vehicle environment, or a specified simulation test environment).

[0069] For example, after building a simulation test environment (e.g., including several simulation nodes, each simulation node has corresponding messages that need to be interacted via the bus, and / or has corresponding message interaction logic), the test can be started, and then all calculated sending delay information after the start of the test can be counted. For another example, after running a real car on the road for a certain distance or time, the sending delay information of all CAN messages that occurred during the road running can be counted.

[0070] In the embodiment of the present application, if it is necessary to determine the statistical results, the statistical results of the transmission delay information of each ID information are counted, because it is directly related to the ID information. Based on the statistical results, the delay of the ID information can be intuitively known. In this way, it is easy to understand various information, such as: for various ID information, whether the real-time, accuracy and efficiency of communication can be guaranteed, and what kind of ID information should be configured to ensure real-time, accuracy and efficiency. It can be seen that the present application can provide intuitive, reliable and highly relevant statistical results as a reference. In a specific example, the statistical results can include at least one of the following: maximum value, minimum value, mean value, median, variance, standard deviation.

[0071] In addition, in an example based on this, further correlation analysis can be performed based on the statistical results, such as calculating the correlation between the statistical results of each ID information and various factors in the algorithm, so as to obtain a better ID information allocation strategy or a better algorithm flow.

[0072] In an example based on this, a warning value (including a maximum warning value and / or a minimum warning value) can also be set for each of several types of CAN messages. If the statistical results of the ID information of a certain type of CAN message conflict with the warning value of that type of CAN message, for example, the maximum value of the sending delay information corresponding to a certain ID information in the statistical results is greater than the maximum warning value of that type of CAN message, and for another example, the minimum value of the sending delay information corresponding to a certain ID information in the statistical results is less than the minimum warning value of that type of CAN message, then the user can be alerted so that the user pays attention to the problem and is prompted to solve the problem.

[0073] Please refer to Figure 5 , the method for processing CAN messages may further include:

[0074] S300: The bus interaction circuit obtains the target CAN message to be sent to the CAN bus, and sends the target CAN message to the CAN bus according to the arbitration segment of the target CAN message and the state of the CAN bus.

[0075] Of course, the execution of step S100 and the execution of step S300 can be carried out in parallel, for example, when sending the target CAN message, the sending delay information is determined at the same time. They can also be in a sequential relationship, for example, first executing step S300 to send the target CAN message, and then executing step S100 after sending it to determine the sending delay information.

[0076] It can be seen that if the sending delay information is determined by the bus interaction circuit, and the bus interaction circuit is used to execute the process of sending the target CAN message according to the arbitration segment, this will help ensure that the sending delay information can be accurately determined.

[0077] Among them, please refer to Figure 5 , step S300 may include:

[0078] S310: The bus interaction circuit receives the target CAN message;

[0079] S320: The bus interaction circuit obtains a corresponding sending instruction;

[0080] S330: The bus interaction circuit detects that the busy state of the CAN bus is suitable for sending the target CAN message;

[0081] In one example, step S330 may specifically include:

[0082] S331: Is the CAN bus idle?

[0083] S332: Whether the load rate of the CAN bus reaches the range within which the target CAN message is allowed to be sent;

[0084] If both steps S331 and S332 are judged to be yes, step S340 will be executed. The execution order of steps S331 and S332 can be changed arbitrarily and is not limited to Figure 5 As shown; in addition, in some examples, the load rate may not be considered, and step S340 is executed when the judgment in step S331 is yes;

[0085] S340: the bus interaction circuit starts to send data of the target CAN message bit by bit to the CAN bus one by one;

[0086] Wherein, it may include: the bus interaction circuit starts to send one bit of data of the arbitration segment of the target CAN message to the CAN bus one by one;

[0087] S350: Whether the level state of the CAN bus matches one bit of the ID information currently sent;

[0088] If the judgment result of step S350 is yes, then: S360: the bus interaction circuit continues to send the next bit of data;

[0089] If the judgment result of step S350 is no, then: S370: the bus interaction circuit stops sending subsequent data of the target CAN message, returns to step S330, and then waits for other CAN messages on the CAN bus whose ID information is smaller than the target CAN message to be successfully transmitted, and the CAN bus is idle again.

[0090] A specific example of step S310 may be, for example, receiving a target CAN message from a processing circuit or a computer, or may also be understood as receiving a target CAN message from a software layer; specifically, the processing circuit, the computer or the software layer may transmit the current CAN message to be sent to a message box (i.e., a message box), and the bus interaction circuit may take out the CAN message from the message box; in one example, the message box may only transmit one CAN message at a time; in one example, the processing circuit, the computer or the software layer may transmit the CAN message to the message box only when the local time reaches the time of the timestamp based on the timestamp of the CAN message and the local time, so that the bus interaction circuit can take it out;

[0091] A specific example of step S320 may be, for example, that the processing circuit, computer or software layer may set the data of the designated data bit as the target data (e.g., set it to 1) when the CAN message needs to be sent, and then, step S320 of the bus interaction circuit is to detect that the designated data bit is the target data, and after successful transmission, set the data of the designated data bit to non-target data (e.g., set it to 0). In other examples, the signal of the sending instruction may also be directly transmitted to the bus interaction circuit;

[0092] In other examples, step S300 may not include S320, and then proceed to step S330 after step S310;

[0093] The state of the CAN bus may include: the current level state of the CAN bus, such as whether it is a high level or a low level, whether it is an explicit level or an invisible level, and may also include the busyness of the CAN bus. The busyness may be characterized only by whether it is idle or by quantifiable data such as a load rate, that is, the state of the CAN bus includes quantified data of the busyness (such as a load rate);

[0094] In the specific example of step S330, it can be understood that: detecting that the busy state of the CAN bus is sufficient to send the target CAN message.

[0095] In one example, the state of the CAN bus may include information indicating whether the CAN bus is idle. If it is idle, the CAN bus is considered suitable for sending the target CAN message, that is, step S330 is implemented. Otherwise, it is considered unsuitable for sending the target CAN message.

[0096] In another example, the state of the CAN bus may include quantitative data of the busyness of the CAN bus (such as load rate), and the quantitative data may be combined to determine whether it is currently suitable to send a target CAN message, for example Figure 5 Steps S331 and S332 are shown.

[0097] In an example of step S330, if the CAN bus is idle and the load rate is lower than the threshold (i.e., both step S331 and step S332 are judged as yes), it is determined to be suitable for sending the target CAN message, and if it is not idle or the load rate is not lower than the threshold, it is determined to be unsuitable for sending the target CAN message. It can be seen that the interval range in which the target CAN message is allowed to be sent in step S332 is the interval range below the threshold.

[0098] The threshold value may be a standard value, and then the same threshold value is used for different CAN messages.

[0099] The threshold value may also be a variable value, which varies with different target CAN messages.

[0100] In one example, the threshold value may vary with different ID information of the target CAN message, that is, the threshold value is associated with the ID information, and the threshold value may be negatively correlated with the ID information, or: the ID information may be divided into multiple interval ranges according to size, each interval range may also be understood as a gear, and each gear corresponds to a threshold value, and for different gears, the size of the ID information in the gear is negatively correlated with the threshold value, that is: if the ID information in one gear A is smaller than the ID information in another gear B, then the threshold value corresponding to the gear A is greater than the threshold value corresponding to the gear B.

[0101] Furthermore, it can help to achieve: for some CAN messages with higher priority (i.e. CAN messages with smaller ID information), because they are more important, they must be sent even if the load rate is high, so a higher threshold is selected; for some CAN messages with lower priority (i.e. CAN messages with larger ID information), because they are less important, they can be sent only when the load rate is low, so a lower threshold can be selected. No matter how it is designed, it is for: CAN messages with smaller ID information are easier to be sent to the CAN bus.

[0102] On this basis, in step S330, if it is idle and the current load rate of the CAN bus is a load rate that allows the target CAN message to be sent (i.e., both step S331 and step S332 are judged as yes), it is determined that the target CAN message is currently allowed to be sent on the CAN bus. If it is not idle, or the current load rate of the CAN bus is not a load rate that allows the target CAN message to be sent, it is determined that the target CAN message is not allowed to be sent on the CAN bus, and it is necessary to continue waiting. If it is determined that the target CAN message is not allowed to be sent on the CAN bus, that is, the busyness of the CAN bus is not suitable for sending the target CAN message, it is necessary to return to step S330 and wait until the busyness of the CAN bus reaches a level suitable for sending the target CAN message, and then it is considered that step S330 has been successfully executed and the subsequent step S340 is entered.

[0103] Furthermore, it is convenient to match the sending of CAN messages with different load rates. If the threshold is associated with the ID information, it can distinguish the different busy conditions of the CAN bus and execute the sending of CAN messages with different ID information differently, so as to adapt to meet the urgency requirements of messages with different priorities.

[0104] It can be seen that, for the target CAN message, the process in which the bus interaction circuit waits for the specified CAN message to be transmitted on the CAN bus can be recorded as the first waiting process, and the sending process of the target CAN message can be understood to include: waiting for the busy situation on the CAN bus to change from being unsuitable for sending the target CAN message to being suitable for sending the target CAN message. The process may overlap partially or completely with the first waiting process, and in particular includes the process in which the target CAN message changes from being unsuitable for sending the target CAN message to being suitable for the target CAN message due to changes in the quantified data of the busy situation (such as the load rate), which can be recorded as the second waiting process, that is, the sending process includes the second waiting process, and the second waiting process that occurs when the CAN bus is idle can be staggered with the first waiting process. At the same time, as can be seen from the foregoing text, the judgment of whether the busy situation (such as the load rate) when the CAN bus is idle is suitable for sending the target CAN message can be associated with the ID information of the target CAN message, and of course, it may not be associated.

[0105] In one example, the transmission delay information may include: first sub-information indicating the duration of the first waiting process, second sub-information indicating the duration of the second waiting process or the entire second waiting process when the CAN bus is idle, and third sub-information indicating the duration actually used to successfully send the target CAN message. Furthermore, the duration of the sending process is divided into three durations for representation in the transmission delay information.

[0106] In another example, no division is required, and the sending delay information may indicate the duration of the sending process. In addition, the processing method may further include: determining additional information, which may include: first sub-information and / or second sub-information. The first sub-information and the second sub-information may be used to refine and enrich the information related to the delay, and help developers better design ID information, algorithms, etc.

[0107] When step S330 needs to determine whether to allow the target CAN message to be sent based on the ID information and the busy status, it can more fully and accurately reflect the impact of the ID information on the sending of the CAN message. This impact is not limited to the process of arbitrating the competing CAN bus when trying to send the target CAN message in steps S340 to S360, but also involves the process of determining whether it is suitable for sending in step S330. Furthermore, it can further prove the value of the statistical results of determining the sending delay information based on the ID information in the specific embodiments of the present application.

[0108] In addition, through the above steps S350 and S360, the ID information of the target CAN message and other CAN messages can be compared, thereby ensuring that the message with smaller ID information has a higher transmission authority and is thus transmitted first.

[0109] In one embodiment, the specific process of step S100 may, for example, determine the sending delay information based on the timing result of a timer, and the timer is configured to start timing from zero at the start time of the sending process, stop timing at the settlement time of the sending process, and generate the timing result.

[0110] Specifically, a timer for counting the transmission delay information can be constructed in the bus interaction circuit. The timer starts counting at the start of the transmission process and ends counting at the end of the transmission process. Thus, the length of the counting time is the length of the transmission process. In a specific example, the timer can be cleared after each CAN message is sent, after a transmission instruction is detected, or after the target CAN message is obtained.

[0111] The timing of starting the sending process matches the time when the bus interaction circuit receives the target CAN message and detects the sending instruction. For example, the timer may start timing in response to the occurrence of step S310 and / or S320.

[0112] The settlement timing of the sending process is designed such that the settlement timing is sufficient to determine that the target CAN message can be successfully transmitted to the CAN bus.

[0113] The successful transmission means that the last bit of data in the arbitration segment is sent to the CAN bus, and the level state of the CAN bus read back also matches it.

[0114] When sending a CAN message, it can be seen from steps S340 to S360 that if the data of the arbitration segment can be successfully sent, generally speaking, the target CAN message has won the competition with the CAN messages of other bus nodes and will most likely be successfully transmitted. Therefore, the settlement timing can be designed to be no earlier than the moment when the last bit of data of the arbitration segment of the target CAN message is successfully sent to the CAN bus.

[0115] In one example, when the last bit of data in the arbitration segment of the target CAN message is successfully sent to the CAN bus, the timing of the timer is stopped, and the timing result of the timer at this time is used as the delayed sending information;

[0116] In another example, the timing of the timer may be stopped when all data of the target CAN message are sent to the CAN bus, and the timing result of the timer at this time is used as the delayed sending information;

[0117] In another example, the timing of the timer may be stopped when all data bits of the data segment of the target CAN message are sent to the CAN bus, and the timing result of the timer at this time is used as the delayed sending information.

[0118] In addition, different types of delayed sending information can be obtained for the same target CAN message due to different settlement timings, and then statistics can be collected for various types of delayed sending information for each ID information to obtain corresponding statistical results, thereby providing more refined and differentiated sending delay information.

[0119] In one implementation, if the bus interaction circuit needs to send CAN messages through multiple CAN channels, each CAN channel is connected to the same or different CAN buses through a corresponding interface, and the bus interaction circuit can set a timer for each CAN channel to respectively determine the sending delay information of the CAN messages sent through the corresponding CAN channels.

[0120] On this basis, if the bus interaction circuit needs to be connected to the same CAN bus through multiple CAN channels, the designated CAN message and the target CAN message involved in step S100 may also be CAN messages of different CAN channels.

[0121] In one example, if the first sub-information and the second sub-information mentioned in this specification need to be determined, a corresponding first timer may be set for the first sub-information, and a corresponding second timer may be set for the second sub-information;

[0122] For the first timer, the timing can be started when the judgment result of step S350 is no, and the timing can be ended when it is detected that the CAN bus has returned to idle state, to obtain the timing result, and complete one timing of the first timer. The first timer needs to be cleared after each timing, and the timing results of each time in the process of sending the target CAN message can be accumulated to obtain the first sub-information; the first timer can also start timing when trying to send the target CAN message to the CAN bus (for example, when the frame of the target CAN message is started). If the arbitration is successful, that is, it is determined that the current target CAN message can be successfully sent, the timing result of the first timer is discarded and the first timer is cleared. On the contrary, if the sending is not successful, the timing result of the first timer is not discarded. Then, the timing results of each timing that have not been discarded are accumulated to obtain the first sub-information.

[0123] For the second timer, the state of the CAN bus (i.e., whether it is idle and the load rate) can be determined based on the state of the CAN bus (i.e., whether it is idle and the load rate), with the state in which the CAN bus is idle and the load rate is not suitable for sending the target CAN message as the focus state. When it is detected that the CAN bus enters the focus state, the second timer starts timing, and when the CAN bus exits the focus state, the second timer ends timing, completing one timing of the second timer, and the timing results of each time the target CAN message sending process can be accumulated to obtain the second sub-information.

[0124] It should also be pointed out that, in one example, if S100 is executed by a computer, a processing circuit, etc., as long as the timing result of the timer involved above can be obtained, the transmission delay information can be obtained accordingly. In another example, if S100 is executed by a computer, a processing circuit, etc., as long as the time information of the starting timing and the settlement timing can be obtained, or a feedback signal that the starting timing and the settlement timing have been received at the corresponding timing can be received, the transmission delay information can also be obtained accordingly, and on this basis, the statistical result of step S200 can naturally be obtained.

[0125] In one embodiment, an information display method includes: displaying sending delay information, and / or: displaying statistical results of sending delay information corresponding to each ID information; wherein the sending delay information is determined by the above-mentioned processing methods.

[0126] The information display method can be executed by a display device, by a computer, or by a processing circuit of a bus communication device. As long as the result can achieve the display of sending delay information and / or statistical results, it can be used as an optional solution.

[0127] In one embodiment, a system includes: a bus communication device, wherein the bus communication device is used to execute the above-mentioned processing methods, and the bus communication device includes the bus interaction circuit.

[0128] Optionally, the system further includes a display device for displaying the sending delay information and / or: statistical results of the sending delay information corresponding to each ID information.

[0129] In one embodiment, a bus communication device includes a bus interaction circuit; the bus interaction circuit is used to execute the above-mentioned processing methods.

[0130] Optionally, the bus interaction circuit is implemented by FPGA.

[0131] Optionally, the bus communication device also includes a processing circuit for running software, and the processing circuit is used to: generate the target CAN message, share the target CAN message to the FPGA circuit, and feedback a sending indication so that the bus interaction circuit can detect the sending indication.

[0132] The bus communication device, bus interaction circuit, processing circuit, FPGA circuit, etc. involved therein can be understood by referring to the relevant description of this specification.

[0133] 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.

[0134] 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.

[0135] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer 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 device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0136] 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.

[0137] 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 method for processing a CAN message, characterized in that: include: For a target CAN message that can be successfully sent to the CAN bus, determining sending delay information of the target CAN message; in: The sending delay information matches the duration of the sending process and is associated with the ID information of the arbitration segment of the target CAN message; The sending process is a process in which the bus interaction circuit obtains the target CAN message to be sent and then sends the target CAN message to the CAN bus.

2. The method according to claim 1, characterized in that The sending process includes: a first waiting process and / or a second waiting process; The first waiting process is a process in which the bus interaction circuit waits for a designated CAN message of another bus node on the CAN bus to be transmitted on the CAN bus, and the ID information of the arbitration segment of the designated CAN message is smaller than the ID information of the arbitration segment of the target CAN message; The second waiting process is a process in which the bus interaction circuit waits for the load rate of the CAN bus to change from being unsuitable for sending the target CAN message to being suitable for sending the target CAN message.

3. The method according to claim 1, characterized in that Also includes: According to the sending delay information of multiple CAN messages, the statistical result of the sending delay information corresponding to each ID information is determined, or: the sending delay information is sent to a designated device, so that the designated device determines the statistical result of the sending delay information corresponding to each ID information according to the sending delay information of multiple CAN messages, and the multiple CAN messages include the target CAN message.

4. The method according to claim 3, characterized in that The statistical results include at least one of the following: Maximum, minimum, mean, median, variance, standard deviation.

5. The method according to claim 1, characterized in that Also includes: The bus interaction circuit acquires the target CAN message to be sent to the CAN bus, and sends the target CAN message to the CAN bus according to the arbitration segment of the target CAN message and the state of the CAN bus.

6. The method according to claim 5, characterized in that According to the arbitration segment of the target CAN message and the state of the CAN bus, the target CAN message is sent to the CAN bus, including: When it is detected that the busy state of the CAN bus is suitable for sending the target CAN message, start sending the bit data of the target CAN message to the CAN bus one by one, including: start sending the bit data in the ID information of the target CAN message to the CAN bus one by one; after sending one bit of data each time, read back the level state of the CAN bus; If the level state matches a bit of data of the ID information currently sent, continue to send the next bit of data; If the level state does not match one bit of the ID information currently sent, stop sending subsequent data of the target CAN message, wait for the specified CAN message with ID information smaller than the target CAN message on the CAN bus to be successfully transmitted, and the CAN bus is suitable for sending the target CAN message again.

7. The method according to claim 5, characterized in that The bus interaction circuit acquires the target CAN message to be sent to the CAN bus, including: The bus interaction circuit receives the target CAN message and obtains a corresponding sending instruction.

8. The method according to claim 7, characterized in that The starting timing of the sending process matches the time when the bus interaction circuit receives the target CAN message and detects the sending instruction.

9. The method according to claim 1, characterized in that: The settlement timing of the sending process is no earlier than the moment when the last bit of data of the arbitration segment of the target CAN message is successfully sent to the CAN bus.

10. The method according to claim 1, characterized in that Determining the sending delay information of the target CAN message includes: The sending delay information is determined according to a timing result of a timer, wherein the timer is configured to: start timing from zero at the start timing of the sending process, stop timing at the settlement timing of the sending process, and generate the timing result.

11. An information display method, characterized in that: include: Displaying the sending delay information, and / or: displaying the statistical results of the sending delay information corresponding to each ID information; The sending delay information is determined by the method described in any one of claims 1 to 10.

12. A system, characterized in that: include: A bus communication device, wherein the bus communication device is used to execute the method according to any one of claims 1 to 10, and the bus communication device includes the bus interaction circuit.

13. The system according to claim 12, characterized in that It also includes a display device for displaying the sending delay information and / or: the statistical results of the sending delay information corresponding to each ID information.

14. A bus communication device, characterized in that: It comprises a bus interaction circuit; the bus interaction circuit is used to execute the method according to any one of claims 1 to 10.

15. The device according to claim 14, characterized in that The bus interaction circuit is implemented by FPGA.

16. The bus communication device according to claim 14, characterized in that: It also includes a processing circuit for running software, wherein the processing circuit is used to: generate the target CAN message, share the target CAN message to the bus interaction circuit, and feed back a sending instruction so that the bus interaction circuit can obtain the sending instruction.