Method, device and equipment for data transmission in CAN network, and medium

By monitoring data in the CAN network and selecting target instructions, the problem of relying on a separate monitoring node is solved, and the reliability and fault tolerance of data transmission in the CAN network is realized, reducing communication load.

CN119232519APending Publication Date: 2024-12-31西安超越申泰信息科技有限公司
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411370729.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-27
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

The existing CAN network relies on individual monitoring nodes to monitor data transmission, resulting in increased system dependence on monitoring nodes. If the monitoring node fails or fails, the faulty link cannot be monitored in time, increasing the communication load.

Method used

By monitoring data arrival in the CAN network, it is determined whether the data on the forward dual CAN link is the same instruction, and selects the target instruction based on the judgment result, and decides whether to transmit to the next node through the backward dual CAN link, avoiding Dependencies for monitoring nodes are set separately.

Benefits of technology

It effectively avoids data transmission interruption caused by monitoring node failure, reduces the communication load of the CAN bus, and improves the fault tolerance and reliability of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119232519A_ABST
    Figure CN119232519A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, and provides a data transmission method and device in a CAN network, equipment and a medium. The method comprises the following steps: in response to data arrival monitored by a current node in a CAN network, judging whether the data arrived on forward double CAN links of the current node corresponds to the same instruction or not; selecting a target instruction from the forward dual CAN link based on the judgment result; and based on the target instruction and the identifier of the current node, determining whether to transmit the target instruction to the next node through the backward dual CAN link of the current node. According to the scheme, the dependence of the CAN network on the monitoring node is avoided, and the communication load of the CAN bus is reduced under the condition of ensuring normal data transmission in the CAN network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method, device, equipment and medium for data transmission in a CAN network. Background Art

[0002] CAN (Controller Area Network) bus is a widely used serial communication protocol bus, suitable for communication between components in real-time control systems. In some single-link scenarios with high reliability requirements, CAN devices need to be connected in series and have relay functions to ensure that the signal can be accurately transmitted to the target node.

[0003] Each CAN node in the CAN network is connected in series, so each CAN node is important. If one of the CAN nodes goes down, the data will not be able to continue to propagate. The existing data transmission method in the CAN network is to set up a CAN monitoring node separately and connect it to the remaining CAN nodes respectively. The CAN monitoring node is used to ensure normal data transmission in the CAN network. However, the monitoring node needs to receive and process data from other CAN nodes in real time, which increases the communication load of the CAN bus, and the entire system is more dependent on the monitoring node. Once the monitoring node fails or fails, it will not be able to monitor the faulty link in the CAN network in time.

[0004] Therefore, there is an urgent need for a method that can ensure normal data transmission in a CAN network without relying on a separately set monitoring node. Summary of the invention

[0005] In view of this, in the prior art, a CAN monitoring node is separately set up and connected to the remaining CAN nodes respectively. The monitoring node needs to receive and process data from other CAN nodes in real time, which increases the communication load of the CAN bus, and the dependence of the entire system on the monitoring node is enhanced. Once the monitoring node fails or fails, the faulty link in the CAN network cannot be monitored in time. The present disclosure provides a method, device, equipment and medium for data transmission in a CAN network.

[0006] According to a first aspect of the present invention, a method for data transmission in a CAN network is provided, comprising: In response to a current node in the CAN network monitoring data arrival, determining whether the data arriving on the forward dual CAN link of the current node corresponds to the same instruction; Selecting a target instruction from the forward dual CAN link based on the determination result; Based on the target instruction and the identifier of the current node, it is determined whether to transmit the target instruction to the next node through the backward dual CAN link of the current node.

[0007] In some embodiments, the step of selecting a target instruction from the forward dual CAN link based on the judgment result includes: If the data arriving on the forward dual CAN link of the front node corresponds to the same instruction, then any one instruction from the forward dual CAN link is selected as the target instruction; If the data arriving on the forward dual CAN link of the front node does not correspond to the same instruction, the correct link is selected from the forward dual CAN link according to the integrity check result and the cyclic redundancy check result of the instruction and the corresponding instruction is obtained as the target instruction.

[0008] In some embodiments, the step of determining whether the data arriving on the forward dual CAN link of the current node corresponds to the same instruction includes: According to the identifier of the instruction corresponding to the forward dual CAN link of the current node and the timestamp of the data arrival, it is determined whether the data arriving on the forward dual CAN link of the current node corresponds to the same instruction.

[0009] In some embodiments, the step of determining whether the data arriving on the forward dual CAN link of the current node corresponds to the same instruction based on the identifier of the instruction corresponding to the forward dual CAN link of the current node and the timestamp of the data arrival includes: If the identifier of the instruction corresponding to the forward dual CAN link of the current node and the timestamp of the data arrival are consistent, confirming that the data arriving on the forward dual CAN link of the current node corresponds to the same instruction; If the identifier of the instruction corresponding to the forward dual CAN link of the current node and / or the timestamp of data arrival are inconsistent, it is confirmed that the data arriving on the forward dual CAN link of the current node does not correspond to the same instruction.

[0010] In some embodiments, the step of confirming whether to transmit the target instruction to the next node through the backward dual CAN link of the current node based on the target instruction and the identifier of the current node includes: Performing data verification on the data of the target instruction; In response to successful verification, based on the target instruction and the identifier of the current node, it is confirmed that the target instruction is executed at the current node or is placed on the backward dual CAN link of the current node for transmission to the next node.

[0011] In some embodiments, the step of confirming whether to transmit the target instruction to the next node through the backward dual CAN link of the current node based on the target instruction and the identifier of the current node includes: If the identifier carried by the target instruction is inconsistent with the identifier of the current node, confirm that the successfully verified data is placed on the backward dual CAN link of the current node for transmission to the next node; If the identifier carried by the target instruction is consistent with the identifier of the current node, it is confirmed that the target instruction is executed at the current node and the verification successfully data is stopped from being placed on the backward dual CAN link.

[0012] In some embodiments, the method further comprises: Connect the nodes in the CAN network in series through dual CAN links; A signal monitoring program is deployed and started at each node to monitor whether data arrives at the current node through the monitoring program.

[0013] According to a second aspect of the present invention, a device for data transmission in a CAN network is provided, the device comprising: The first module is used for judging whether the data arriving on the forward dual CAN link of the current node corresponds to the same instruction in response to the current node in the CAN network monitoring the arrival of data; A second module is used to select a target instruction from the forward dual CAN link based on the judgment result; The third module is used to confirm whether to transmit the target instruction to the next node through the backward dual CAN link of the current node based on the target instruction and the identifier of the current node.

[0014] According to a third aspect of the present invention, there is further provided an electronic device, the electronic device comprising: at least one processor; and The memory stores a computer program that can be run on the processor, and the processor executes the aforementioned method for data transmission in the CAN network when executing the program.

[0015] According to a fourth aspect of the present invention, there is further provided a computer-readable storage medium, the computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the method for data transmission in a CAN network is executed.

[0016] In the above method for data transmission in a CAN network, when the current node in the CAN network monitors the arrival of data, it is determined whether the data arriving on the forward CAN link of the current node corresponds to the same instruction, and based on the judgment result, the target instruction is selected from the forward dual CAN link, and based on the identifiers corresponding to the target instruction and the current node, it is determined whether to transmit the target instruction to the next node through the backward dual CAN link of the current node. This method for data transmission in a CAN network avoids setting up a separate CAN monitoring node in the CAN network to monitor the data transmission of the remaining nodes, avoids the dependence of the CAN network on the monitoring node, effectively avoids the problem that the monitoring node fails or fails and cannot timely monitor the faulty link in the CAN network, and at the same time reduces the communication load of the CAN bus while ensuring normal data transmission in the CAN network.

[0017] In addition, the present invention also provides a device for data transmission in a CAN network, an electronic device and a computer-readable storage medium, which can also achieve the above-mentioned technical effects and will not be described in detail here. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can be obtained based on these drawings without paying creative work.

[0019] Figure 1 A flowchart of a method for data transmission in a CAN network provided by the first embodiment of the present invention; Figure 2 A schematic diagram of a network architecture of a CAN node in a CAN network provided by a second embodiment of the present invention; Figure 3 A schematic diagram of logic judgment of a CAN node in a CAN network provided by a second embodiment of the present invention; Figure 4 A schematic diagram of the structure of a device for data transmission in a CAN network provided by a third embodiment of the present invention; Figure 5 is an internal structure diagram of an electronic device in a fourth embodiment of the present invention; Figure 6 This is a structural diagram of a computer-readable storage medium in the fifth embodiment of the present invention. DETAILED DESCRIPTION

[0020] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the embodiments of the present invention are further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.

[0021] It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are for distinguishing two non-identical entities with the same name or non-identical parameters. It can be seen that "first" and "second" are only for the convenience of expression and should not be understood as limitations on the embodiments of the present invention. The subsequent embodiments will not explain this one by one.

[0022] In one embodiment, please refer to Figure 1 As shown, the present invention provides a method 100 for data transmission in a CAN network, specifically, comprising: Step 101, in response to a current node in the CAN network monitoring data arrival, determining whether the data arriving on the forward dual CAN link of the current node corresponds to the same instruction; Step 102, selecting a target instruction from the forward dual CAN link based on the judgment result; Step 103 : Based on the target instruction and the identifier of the current node, confirm whether to transmit the target instruction to the next node through the backward dual CAN link of the current node.

[0023] The above-mentioned method for data transmission in a CAN network avoids setting up a separate CAN monitoring node in the CAN network to monitor the data transmission of the remaining nodes, avoids the dependence of the CAN network on the monitoring node, and effectively avoids the problem of failure or ineffectiveness of the monitoring node and the inability to timely monitor the faulty link in the CAN network. At the same time, while ensuring normal data transmission in the CAN network, the communication load of the CAN bus is reduced.

[0024] According to some embodiments of the present invention, the step of selecting a target instruction from the forward dual CAN link based on the judgment result includes: if the data arriving on the forward dual CAN link of the previous node corresponds to the same instruction, then any instruction from the forward dual CAN link is selected as the target instruction; if the data arriving on the forward dual CAN link of the previous node does not correspond to the same instruction, then according to the integrity check result and cyclic redundancy check result of the instruction, the link with correct verification is selected from the forward dual CAN link and the corresponding instruction is obtained as the target instruction. The fault tolerance of the CAN node in transmitting data is improved. When a link fails, the other link can continue to transmit data, ensuring the continuity and stability of communication.

[0025] According to some embodiments of the present invention, the step of determining whether the data arriving on the forward dual CAN link of the current node corresponds to the same instruction includes: determining whether the data arriving on the forward dual CAN link of the current node corresponds to the same instruction based on the identifier of the instruction corresponding to the forward dual CAN link of the current node and the timestamp of the data arrival. Adding the step of determining whether the instruction corresponding to the forward dual CAN link is the same instruction improves the reliability of the CAN node and effectively avoids the situation where the transmission instruction is inconsistent due to link failure.

[0026] According to some embodiments of the present invention, based on the identifier of the instruction corresponding to the forward dual CAN link of the current node and the timestamp of the data arrival, the step of judging whether the data arriving on the forward dual CAN link of the current node corresponds to the same instruction includes: if the identifier of the instruction corresponding to the forward dual CAN link of the current node and the timestamp of the data arrival are consistent, confirming that the data arriving on the forward dual CAN link of the current node corresponds to the same instruction; if the identifier of the instruction corresponding to the forward dual CAN link of the current node and / or the timestamp of the data arrival are inconsistent, confirming that the data arriving on the forward dual CAN link of the current node does not correspond to the same instruction. Judging whether the data arriving on the forward dual CAN link of the current node corresponds to the same instruction based on the specific instruction consistency judgment rule is conducive to improving the efficiency of subsequent data transmission and timely monitoring of faulty links in the CAN network.

[0027] According to some embodiments of the present invention, based on the target instruction and the identifier of the current node, the step of confirming whether to transmit the target instruction to the next node through the backward dual CAN link of the current node includes: performing data verification on the data of the target instruction; in response to successful verification, based on the target instruction and the identifier of the current node, confirming to execute the target instruction at the current node or placing it on the backward dual CAN link of the current node for transmission to the next node. By performing data verification on the data of the target instruction and performing the next step of processing on the target instruction after successful verification, the accuracy of data transmission in the CAN network is further improved.

[0028] According to some embodiments of the present invention, based on the identifier of the target instruction and the current node, the step of confirming whether to transmit the target instruction to the next node through the backward dual CAN link of the current node includes: if the identifier carried by the target instruction is inconsistent with the identifier of the current node, confirming that the successfully verified data is placed on the backward dual CAN link of the current node for transmission to the next node; if the identifier carried by the target instruction is consistent with the identifier of the current node, confirming that the target instruction is executed at the current node and stopping placing the successfully verified data on the backward dual CAN link. The subsequent processing of the target instruction is determined based on whether the identifier carried by the target instruction is consistent with the identifier of the current node, which effectively avoids the problems of repeated processing and waste of resources.

[0029] According to some embodiments of the present invention, the method further includes: connecting the nodes in the CAN network in series through dual CAN links; deploying and starting a signal monitoring program at each node to monitor whether data has arrived at the current node through the monitoring program. By deploying and starting a signal monitoring program at each node to monitor whether data has arrived at the current node, it is avoided to set up a separate CAN monitoring node to monitor the nodes in the CAN network, reduce the dependence on the monitoring node, and effectively avoid the problem of the CAN monitoring node failing and failing to monitor the faulty link in time.

[0030] In order to further understand the method for data transmission in a CAN network of the present invention, it is described in detail in a specific example below. Figure 2 FIG. 1 is a schematic diagram of a network architecture of a CAN node in a CAN network provided by a second embodiment of the present invention, such as Figure 2 As shown, at a CAN node, the processing of CAN data involves the data acquisition layer, data processing layer, relay forwarding layer, and visual monitoring and debugging layer.

[0031] The data acquisition layer is used to collect raw data from the CAN bus in real time. This layer integrates multiple CAN interfaces and protocol support, and is compatible with CAN devices of different manufacturers and models to ensure the comprehensiveness and accuracy of the data.

[0032] The data processing layer is used to pre-process and quickly process the collected raw CAN data. Pre-processing includes data cleaning (removing invalid or erroneous data packets), data synchronization (ensuring the accuracy of data packet timestamps) and data formatting (converting binary data into a readable format); fast processing includes compression, filtering, conversion and other operations on data through efficient algorithms to meet the needs of subsequent analysis or relay forwarding. Among them, efficient algorithms include but are not limited to parallel processing algorithms, compression algorithms and intelligent filtering algorithms. The parallel processing algorithm uses the parallel computing power of multi-core processors to process multiple CAN data packets in parallel, significantly shortening the processing time; the compression algorithm uses an efficient compression algorithm to compress the repeated or redundant information in the CAN data, reducing the overhead of data transmission and storage; the intelligent filtering algorithm intelligently filters the CAN data according to preset rules or models, removes invalid or unnecessary data packets, and reduces the burden of subsequent processing and forwarding.

[0033] The relay forwarding layer is used to forward the processed CAN data from one CAN bus to another CAN bus according to the preset relay forwarding strategy. This layer supports seamless connection between CAN buses with different baud rates, and can dynamically adjust the forwarding strategy according to the network status to ensure the real-time and reliability of the data. At the same time, this layer also integrates flow control and priority scheduling mechanisms to further optimize data forwarding performance. Among them, the relay forwarding strategy includes but is not limited to dynamic routing selection strategy, priority scheduling strategy, flow control strategy, etc. The dynamic routing selection strategy combines network topology information, CAN link quality, and system load conditions to make comprehensive judgments, and is used to dynamically rotate the optimal routing path for forwarding according to network forwarding requirements to reduce forwarding delays and packet loss rates. The priority scheduling strategy sets corresponding priorities for different types of CAN data, and forwards them in order from high to low priority, supporting user-defined priorities to ensure that high-priority CAN data is forwarded preferentially. The flow control strategy dynamically adjusts the parameters of the flow control mechanism according to the network load, limits the amount of data forwarded per unit time, avoids network congestion and packet loss, and realizes network adaptive regulation.

[0034] The visual monitoring and debugging layer is used to provide a visual interface to display the flow direction, processing status and forwarding results of CAN data in real time, which is convenient for users to monitor and debug. This layer also supports log recording and playback functions, which is convenient for users to trace problems and optimize system performance. For example, the flow direction, processing status and forwarding results of CAN data are displayed in real time in the form of charts, lists, etc., to ensure that users can intuitively understand the system operation status and data transmission through the visual interface. At the same time, when the system detects an abnormal situation (such as data loss, network failure, etc.), it can automatically trigger the alarm mechanism and send a notification to remind users to deal with it in time.

[0035] exist Figure 2 Based on this, further combining Figure 3 , Figure 3 The figure shows a logical judgment diagram of a CAN node in a CAN network provided by the second embodiment of the present invention.

[0036] With this CAN node as the current node, each node in the CAN network is connected in series through a dual CAN link, and a signal monitoring program is deployed in each node. The filter of this node is configured with filtering conditions through the signal monitoring program to ensure that messages that meet the preset conditions are filtered out from the data received by this node. At the same time, the interrupt function of the CAN controller of this node is configured through the signal monitoring program to ensure that when this node receives a message that meets the filter conditions, the CAN controller will generate an interrupt signal to notify the CPU (Central Processing Unit) of this node to process. After the system of this node is powered on, the signal monitoring program of this node is started to monitor whether there is data arriving at this node through the signal monitoring program.

[0037] When the signal monitoring program of this node monitors that data has arrived at this node, it determines whether the data arriving on the forward dual CAN links (i.e., forward CAN link 1 and forward CAN link 2) of this node corresponds to the same instruction. The specific judgment process is as follows: since each instruction transmitted on the CAN link has a unique identifier corresponding to it, and each instruction data has a corresponding arrival timestamp when it arrives at a node, based on this, it is determined whether the data arriving on the forward CAN link 1 and the forward CAN link 2 correspond to the same instruction based on whether the identifiers of the forward CAN link 1 and the forward CAN link 2 and the timestamps corresponding to the data arriving at this node are consistent. If the identifiers of the forward CAN link 1 and the forward CAN link 2 and the timestamps corresponding to the data arriving at this node are consistent, it means that the two correspond to the same instruction, otherwise, it means that the two correspond to different instructions. It can be understood that in actual applications, the judgment method for determining whether the data arriving on the forward CAN link 1 and the forward CAN link 2 corresponds to the same instruction includes but is not limited to judging based on the two elements of the identifiers of the forward CAN link 1 and the forward CAN link 2 and the timestamps corresponding to the data arriving at this node.

[0038] If the data of the forward CAN link 1 and the forward CAN link 2 correspond to the same instruction, then the data of the instruction of any one of the two links is verified, otherwise, the data of the instruction of the corresponding forward CAN link is selected from the forward CAN link 1 and the forward CAN link 2 based on the preset rules for data verification, and the specific process is as follows: the instructions corresponding to the forward CAN link 1 and the forward CAN link 2 are respectively verified by instruction integrity verification and cyclic redundancy check, and the instructions corresponding to the successful instruction integrity verification (i.e., the instruction is complete) and the successful cyclic redundancy check (i.e., the cyclic redundancy check code calculated by the instruction is consistent with the cyclic redundancy check code carried by the instruction) are selected from the two, and then the data verification is performed again. It can be understood that in actual applications, the verification method of selecting the correct link to be verified from the forward CAN link 1 and the forward CAN link 2 includes but is not limited to the integrity check and cyclic redundancy check of the instruction.

[0039] The selected instruction is used as the target instruction and data verification is performed on it, that is, whether the data of the target instruction is correct is determined, for example, whether the data of the target instruction is correct is determined by checking the bit filling rule. After the data verification is successful, based on the identifier of the target instruction and the node, it is determined whether the target instruction is executed at the current node or placed on the backward dual CAN link (i.e., backward CAN link 3 and forward CAN link 4) of the node to be transmitted to the next node until it is transmitted to the node that can execute the target instruction for execution. Specifically, if the target instruction is consistent with the identifier of the node, the target instruction is directly executed at the node, otherwise, the successfully verified data is placed on the backward CAN link 3 and the forward CAN link 4 to be transmitted to the next node until it is transmitted to the node that can execute the target instruction for execution.

[0040] In some embodiments, please refer to Figure 4 As shown, the present invention also provides a device 200 for data transmission in a CAN network, the device comprising: The first module 201 is used for judging whether the data arriving on the forward dual CAN link of the current node corresponds to the same instruction in response to the current node in the CAN network monitoring the arrival of data; The second module 202 is used to select a target instruction from the forward dual CAN link based on the judgment result; The third module 203 is used to confirm whether to transmit the target instruction to the next node through the backward dual CAN link of the current node based on the target instruction and the identifier of the current node.

[0041] It should be noted that each module in the above-mentioned device for data transmission in the CAN network can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in an electronic device in the form of hardware, or can be stored in a memory in an electronic device in the form of software, so that the processor can call and execute operations corresponding to each of the above modules.

[0042] According to another aspect of the present invention, an electronic device is provided. The electronic device may be a server. Figure 5 As shown. The electronic device includes a processor, a memory, a network interface and a database connected via a system bus. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the electronic device is used to store data. The network interface of the electronic device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, the method for data transmission in the CAN network described above is implemented.

[0043] According to another aspect of the present invention, a computer readable storage medium is provided. Figure 6 As shown, a computer program is stored thereon, and when the computer program is executed by a processor, the above-mentioned method for data transmission in a CAN network is implemented.

[0044] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented 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 memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0045] 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 specification.

[0046] The above-mentioned 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 invention patent. 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 patent of the present application shall be subject to the attached claims.

Claims

1. A method for data transmission in a CAN network, characterized in that: include: In response to a current node in the CAN network monitoring data arrival, determining whether the data arriving on the forward dual CAN link of the current node corresponds to the same instruction; Selecting a target instruction from the forward dual CAN link based on the determination result; Based on the target instruction and the identifier of the current node, it is determined whether to transmit the target instruction to the next node through the backward dual CAN link of the current node.

2. The method for data transmission in a CAN network according to claim 1, characterized in that: The step of selecting a target instruction from the forward dual CAN link based on the judgment result comprises: If the data arriving on the forward dual CAN link of the front node corresponds to the same instruction, then any one instruction from the forward dual CAN link is selected as the target instruction; If the data arriving on the forward dual CAN link of the front node does not correspond to the same instruction, the correct link is selected from the forward dual CAN link according to the integrity check result and the cyclic redundancy check result of the instruction and the corresponding instruction is obtained as the target instruction.

3. The method for data transmission in a CAN network according to claim 1, characterized in that: The step of determining whether the data arriving on the forward dual CAN link of the current node corresponds to the same instruction comprises: According to the identifier of the instruction corresponding to the forward dual CAN link of the current node and the timestamp of the data arrival, it is determined whether the data arriving on the forward dual CAN link of the current node corresponds to the same instruction.

4. The method for data transmission in a CAN network according to claim 3, characterized in that: The step of judging whether the data arriving on the forward dual CAN link of the current node corresponds to the same instruction according to the identifier of the instruction corresponding to the forward dual CAN link of the current node and the timestamp of the data arrival includes: If the identifier of the instruction corresponding to the forward dual CAN link of the current node and the timestamp of the data arrival are consistent, confirming that the data arriving on the forward dual CAN link of the current node corresponds to the same instruction; If the identifier of the instruction corresponding to the forward dual CAN link of the current node and / or the timestamp of data arrival are inconsistent, it is confirmed that the data arriving on the forward dual CAN link of the current node does not correspond to the same instruction.

5. The method for data transmission in a CAN network according to claim 1, characterized in that: The step of confirming whether to transmit the target instruction to the next node through the backward dual CAN link of the current node based on the target instruction and the identifier of the current node includes: Performing data verification on the data of the target instruction; In response to successful verification, based on the target instruction and the identifier of the current node, it is confirmed that the target instruction is executed at the current node or is placed on the backward dual CAN link of the current node for transmission to the next node.

6. The method for data transmission in a CAN network according to claim 5, characterized in that: The step of confirming whether to transmit the target instruction to the next node through the backward dual CAN link of the current node based on the target instruction and the identifier of the current node includes: If the identifier carried by the target instruction is inconsistent with the identifier of the current node, confirm that the successfully verified data is placed on the backward dual CAN link of the current node for transmission to the next node; If the identifier carried by the target instruction is consistent with the identifier of the current node, it is confirmed that the target instruction is executed at the current node and the verification successfully data is stopped from being placed on the backward dual CAN link.

7. The method for data transmission in a CAN network according to claim 1, characterized in that: The method further comprises: Connect the nodes in the CAN network in series through dual CAN links; A signal monitoring program is deployed and started at each node to monitor whether data arrives at the current node through the monitoring program.

8. A device for data transmission in a CAN network, characterized in that: The device comprises: The first module is used for judging whether the data arriving on the forward dual CAN link of the current node corresponds to the same instruction in response to the current node in the CAN network monitoring the arrival of data; A second module is used to select a target instruction from the forward dual CAN link based on the judgment result; The third module is used to confirm whether to transmit the target instruction to the next node through the backward dual CAN link of the current node based on the target instruction and the identifier of the current node.

9. An electronic device, characterized in that: include: at least one processor; as well as A memory storing a computer program executable in the processor, wherein the processor executes the method for data transmission in a CAN network as described in any one of claims 1 to 7 when executing the program.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for data transmission in a CAN network according to any one of claims 1 to 7 is performed.

Citation Information

Cited By

  • Data information transmission method and system in communication network and computer equipment

    CN119834935A