Transparent transmission method and system for Bluetooth to CAN communication

By introducing a transparent protocol layer in the Bluetooth to CAN communication system, the problem of the Bluetooth CAN box that requires two sets of protocols to be converted into each other in the prior art is solved, and the effect of improving development efficiency and reducing firmware upgrade frequency is achieved.

CN119316492BActive Publication Date: 2025-03-04深圳市华芯控股有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411851502.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-03-04
Estimated Expiration
2044-12-16

AI Technical Summary

Technical Problem

The existing Bluetooth to CAN communication technology requires the conversion of two sets of protocols in the Bluetooth CAN box, resulting in cumbersome development and difficult version maintenance.

Method used

By defining the Bluetooth master device, CAN interface device and Bluetooth CAN box, the transparent transmission protocol layer is used to separate the CAN application layer protocol from the Bluetooth protocol to avoid modifying the Bluetooth application layer protocol in the Bluetooth CAN box firmware.

Benefits of technology

Improve development efficiency, reduce the frequency of firmware upgrade of Bluetooth CAN box, and improve user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119316492B_ABST
    Figure CN119316492B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical fields of transmission of digital information, and provides a transparent transmission method and system for Bluetooth to CAN communication. A Bluetooth main device is defined, the Bluetooth main device includes a main device CAN application layer, a main device transparent transmission protocol layer and a main device Bluetooth transceiver, a CAN interface device is defined, the CAN interface device includes an interface device CAN application layer and an interface device CAN transceiver, a Bluetooth CAN box is defined, the Bluetooth CAN box includes a CAN box transparent transmission protocol layer, a CAN box Bluetooth transceiver and a CAN box CAN transceiver, the transparent transmission protocol layer of the main device communicates with the transparent transmission protocol layer of the CAN box through a transparent transmission protocol, the Bluetooth main device and the CAN interface device establish communication through the Bluetooth CAN box to transmit data packets, thereby avoiding the need to additionally formulate a set of Bluetooth application layer protocols. When the upper CAN application layer protocol is changed, the firmware of the Bluetooth CAN box does not need to be modified, thereby improving development efficiency, reducing the frequency of Bluetooth CAN box firmware upgrades, and improving user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical fields of digital information transmission, electronic digital data processing, and the like, and in particular to a transparent transmission method and system for Bluetooth to CAN communication. Background Art

[0002] In order to achieve communication between smart devices with Bluetooth function (such as smart phones) and CAN interface devices, Bluetooth to CAN communication technology is usually used. At present, Bluetooth to CAN communication technology is generally bound to specific products. Bluetooth protocol and CAN protocol are two completely different protocols. The two protocols need to be converted to each other in the Bluetooth CAN box. This means that if the two protocols are changed, the Bluetooth CAN box needs to be modified accordingly, which makes development very cumbersome and version maintenance difficult.

[0003] In summary, the existing Bluetooth to CAN communication technology has the problem that the two protocols need to be converted to each other in the Bluetooth CAN box. When the two protocols change, corresponding modifications need to be made to the Bluetooth CAN box. The development is very cumbersome and the version maintenance is difficult. Summary of the invention

[0004] In view of the deficiencies in the above-mentioned prior art, the present invention provides a transparent transmission method and system for Bluetooth to CAN communication, so as to avoid the need to formulate an additional set of Bluetooth application layer protocols. When the upper CAN application layer protocol changes, there is no need to change the firmware of the Bluetooth CAN box, thereby improving development efficiency, reducing the frequency of Bluetooth CAN box firmware upgrades, and improving user experience.

[0005] In a first aspect, the present invention provides a method for transparent transmission of Bluetooth to CAN communication, comprising the following steps:

[0006] A Bluetooth master device is defined, wherein the Bluetooth master device comprises a master device CAN application layer, a master device transparent transmission protocol layer, and a master device Bluetooth transceiver, wherein the master device CAN application layer communicates with the master device transparent transmission protocol layer, and the master device transparent transmission protocol layer communicates with the master device Bluetooth transceiver;

[0007] A CAN interface device is defined, wherein the CAN interface device comprises an interface device CAN application layer and an interface device CAN transceiver, wherein the interface device CAN application layer communicates with the interface device CAN transceiver; the master device CAN application layer communicates with the interface device CAN application layer via a CAN application layer protocol;

[0008] A Bluetooth CAN box is defined, wherein the Bluetooth CAN box comprises a transparent transmission protocol layer of the CAN box, a CAN box Bluetooth transceiver and a CAN box CAN transceiver, wherein the transparent transmission protocol layer of the CAN box communicates with the CAN box Bluetooth transceiver and the CAN box CAN transceiver respectively, the transparent transmission protocol layer of the master device communicates with the transparent transmission protocol layer of the CAN box through a transparent transmission protocol, the CAN box Bluetooth transceiver communicates with the master device Bluetooth transceiver through a standard Bluetooth protocol, and the CAN box CAN transceiver communicates with the interface device CAN transceiver through a standard CAN protocol;

[0009] Through the Bluetooth CAN box, communication is established between the Bluetooth main device and the CAN interface device to perform data packet transmission.

[0010] Furthermore, the data packet transmitted from the Bluetooth master device to the CAN interface device is a downlink CAN data packet. After the transparent transmission protocol layer of the master device communicates with the transparent transmission protocol layer of the CAN box through the transparent transmission protocol, the downlink CAN data packet is transmitted through the master device Bluetooth transceiver to the CAN box Bluetooth transceiver for reception. After the CAN box Bluetooth transceiver receives the downlink CAN data packet, it transmits the received downlink CAN data packet to the CAN box CAN transceiver through the transparent transmission protocol layer of the CAN box. The CAN box CAN transceiver receives the downlink CAN data packet transmitted by the transparent transmission protocol layer of the CAN box and then transmits it to the interface device CAN transceiver.

[0011] Furthermore, the data packet transmitted from the CAN interface device to the Bluetooth master device is an uplink CAN data packet. After the transparent transmission protocol layer of the master device communicates with the transparent transmission protocol layer of the CAN box through the transparent transmission protocol, the uplink CAN data packet is transmitted to the CAN box CAN transceiver through the interface device CAN transceiver. The CAN box CAN transceiver transmits the uplink CAN data packet to the CAN box Bluetooth transceiver through the transparent transmission protocol layer of the CAN box. After receiving the uplink CAN data packet, the CAN box Bluetooth transceiver transmits it to the master device Bluetooth transceiver.

[0012] Furthermore, the data packet structure of the transparent transmission protocol layer includes a packet header TAG, and the packet header TAG has fixed data and is used to identify a Bluetooth data frame header.

[0013] Furthermore, the data packet structure of the transparent transmission protocol layer includes a packet number FrameNo, and the packet number FrameNo is used for data transmission and reception response, retransmission and deduplication.

[0014] Furthermore, the data packet structure of the transparent transmission protocol layer includes a function code FuncCode, and the function code FuncCode is used to identify the type of the packet.

[0015] Further, when the function code FuncCode identifies the type of the packet, it includes uplink transparent transmission or downlink transparent transmission of CAN data.

[0016] Furthermore, when performing uplink transparent transmission of CAN data, the type of the function code FuncCode identification packet includes setting a filter, and the filter is used to filter out CAN data packets that are not required by the master device CAN application layer on the Bluetooth master device side.

[0017] Furthermore, the data packet structure of the transparent transmission protocol layer includes a response confirmation field NeedResp, and the response confirmation field NeedResp is used to inform the data receiver whether a response to the data packet transmitted by the transparent transmission protocol layer is required.

[0018] In a second aspect, the present invention provides a Bluetooth to CAN communication transparent transmission system, comprising: a Bluetooth master device, a CAN interface device and a Bluetooth CAN box, wherein the Bluetooth master device communicates with the CAN interface device through the Bluetooth CAN box; when the Bluetooth master device, the Bluetooth CAN box and the CAN interface device communicate with each other, the above-mentioned Bluetooth to CAN communication transparent transmission method is used to transmit data packets.

[0019] Compared with the prior art, the present invention has the following beneficial effects:

[0020] The present invention provides a transparent transmission method and system for Bluetooth to CAN communication, by defining a Bluetooth master device, the Bluetooth master device includes a master device CAN application layer, a master device transparent transmission protocol layer and a master device Bluetooth transceiver, the master device CAN application layer communicates with the master device transparent transmission protocol layer, the master device transparent transmission protocol layer communicates with the master device Bluetooth transceiver, a CAN interface device is defined, the CAN interface device includes an interface device CAN application layer and an interface device CAN transceiver, the interface device CAN application layer communicates with the interface device CAN transceiver; the master device CAN application layer communicates with the interface device CAN application layer through a CAN application layer protocol, a Bluetooth CAN box is defined, the Bluetooth CAN box includes a CAN box transparent transmission protocol layer, a CAN box Bluetooth transceiver and a CAN The CAN box is a CAN transceiver, the transparent transmission protocol layer of the CAN box communicates with the CAN box Bluetooth transceiver and the CAN box CAN transceiver respectively, the transparent transmission protocol layer of the main device communicates with the transparent transmission protocol layer of the CAN box through the transparent transmission protocol, the CAN box Bluetooth transceiver communicates with the main device Bluetooth transceiver through the standard Bluetooth protocol, the CAN box CAN transceiver communicates with the interface device CAN transceiver through the standard CAN protocol, and communication is established between the Bluetooth main device and the CAN interface device through the Bluetooth CAN box to transmit data packets, thereby avoiding the need to additionally formulate a set of Bluetooth application layer protocols. When the upper CAN application layer protocol changes, there is no need to change the firmware of the Bluetooth CAN box, thereby improving development efficiency, reducing the frequency of Bluetooth CAN box firmware upgrades, and improving user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their description are used to explain the present invention and do not constitute an improper limitation of the present invention. Some specific embodiments of the present invention will be described in detail in an exemplary and non-restrictive manner with reference to the drawings. The same reference numerals in the drawings indicate the same or similar components or parts. It should be understood by those skilled in the art that these drawings are not necessarily drawn to scale. In the drawings:

[0022] Figure 1 It is a flow chart of a transparent transmission method of Bluetooth to CAN communication according to an embodiment of the present invention;

[0023] Figure 2 It is a schematic diagram of the architecture of Bluetooth to CAN communication in the prior art;

[0024] Figure 3 This is a schematic diagram of the architecture of a transparent transmission system for Bluetooth to CAN communication according to an embodiment of the present invention;

[0025] Figure 4This is a schematic diagram of a data structure of a transparent transmission protocol layer data packet according to an embodiment of the present invention;

[0026] Figure 5 It is a data structure diagram of the filter configuration according to an embodiment of the present invention;

[0027] Figure 6 This is a schematic diagram of a data structure of a downlink CAN packet according to an embodiment of the present invention;

[0028] Figure 7 It is a data structure diagram of an uplink CAN packet according to an embodiment of the present invention. DETAILED DESCRIPTION

[0029] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is only an embodiment of a part of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work should fall within the scope of protection of the present invention.

[0030] Embodiment 1

[0031] See also Figure 1-Figure 7 The embodiment of the present invention provides a transparent transmission method for Bluetooth to CAN communication, including step S101, step S102, step S103 and step S104.

[0032] S101, defining a Bluetooth master device, wherein the Bluetooth master device comprises a master device CAN application layer, a master device transparent transmission protocol layer, and a master device Bluetooth transceiver, wherein the master device CAN application layer communicates with the master device transparent transmission protocol layer, and the master device transparent transmission protocol layer communicates with the master device Bluetooth transceiver;

[0033] S102, defining a CAN interface device, wherein the CAN interface device comprises an interface device CAN application layer and an interface device CAN transceiver, wherein the interface device CAN application layer communicates with the interface device CAN transceiver; the master device CAN application layer communicates with the interface device CAN application layer through a CAN application layer protocol;

[0034] S103, define a Bluetooth CAN box, the Bluetooth CAN box includes a transparent transmission protocol layer of the CAN box, a CAN box Bluetooth transceiver and a CAN box CAN transceiver, the transparent transmission protocol layer of the CAN box communicates with the CAN box Bluetooth transceiver and the CAN box CAN transceiver respectively, the transparent transmission protocol layer of the master device communicates with the transparent transmission protocol layer of the CAN box through a transparent transmission protocol, the CAN box Bluetooth transceiver communicates with the master device Bluetooth transceiver through a standard Bluetooth protocol, and the CAN box CAN transceiver communicates with the interface device CAN transceiver through a standard CAN protocol;

[0035] S104: Establish communication between the Bluetooth host device and the CAN interface device through the Bluetooth CAN box to transmit data packets.

[0036] It should be noted that, in the present embodiment, a Bluetooth master device is defined, the Bluetooth master device includes a master device CAN application layer, a master device transparent transmission protocol layer and a master device Bluetooth transceiver, the master device CAN application layer communicates with the master device transparent transmission protocol layer, the master device transparent transmission protocol layer communicates with the master device Bluetooth transceiver, a CAN interface device is defined, the CAN interface device includes an interface device CAN application layer and an interface device CAN transceiver, the interface device CAN application layer communicates with the interface device CAN transceiver; the master device CAN application layer communicates with the interface device CAN application layer through the CAN application layer protocol, a Bluetooth CAN box is defined, the Bluetooth CAN box includes the transparent transmission protocol layer of the CAN box, the CAN box Bluetooth transceiver and the CAN box CAN transceiver The transparent transmission protocol layer of the CAN box communicates with the CAN box Bluetooth transceiver and the CAN box CAN transceiver respectively, the transparent transmission protocol layer of the main device communicates with the transparent transmission protocol layer of the CAN box through the transparent transmission protocol, the CAN box Bluetooth transceiver communicates with the main device Bluetooth transceiver through the standard Bluetooth protocol, the CAN box CAN transceiver communicates with the interface device CAN transceiver through the standard CAN protocol, and communication is established between the Bluetooth main device and the CAN interface device through the Bluetooth CAN box to transmit data packets, thereby avoiding the need to additionally formulate a set of Bluetooth application layer protocols. When the upper CAN application layer protocol changes, there is no need to change the firmware of the Bluetooth CAN box, thereby improving development efficiency, reducing the frequency of Bluetooth CAN box firmware upgrades, and improving user experience.

[0037] It should be noted that, compared with the conventional Bluetooth to CAN protocol architecture, this embodiment can omit the Bluetooth application layer protocol. Although a transparent transmission protocol layer is added, the transparent transmission protocol layer is a protocol layer unrelated to the CAN application layer protocol. After the initial stage is completed, there is basically no need for subsequent maintenance, which can improve the project development efficiency.

[0038] It should be noted that the transparent transmission protocol layer does not depend on the specific protocol content of the CAN application layer. It mainly plays the role of data transmission and is responsible for encapsulating and transmitting the data of the upper CAN application layer. Through the transparent transmission protocol layer, changes in the CAN application layer do not affect the firmware of the Bluetooth CAN box. As long as the design of the transparent transmission protocol layer remains unchanged, the protocol changes of the CAN application layer will not affect the operation of the Bluetooth CAN box. Generally, the Bluetooth application layer involved in the Bluetooth communication protocol is to meet specific data formats, data identification and connection management requirements. If the Bluetooth application layer protocol needs to be modified every time the CAN application layer changes, and the firmware of the Bluetooth CAN box is re-upgraded, the complexity of development and maintenance will be increased. By using the transparent transmission protocol layer, the data transmission between the Bluetooth master device and the CAN interface device is not affected by the specific protocol of the CAN application layer, thereby reducing the need for firmware changes. In this embodiment, the CAN application layer, the transparent transmission protocol layer and the Bluetooth transceiver of the master device maintain a modular structure. Changes in the CAN application layer will not affect the implementation of the transparent transmission protocol layer and the Bluetooth transceiver, and the transparent transmission protocol layer is independent of the upper CAN application protocol. The transparent transmission protocol layer provides a "transparent" channel so that CAN data can be seamlessly transmitted in the Bluetooth network. The task of the transparent transmission protocol layer is to encapsulate the message of the CAN protocol and transmit it through Bluetooth. Therefore, no matter how the CAN application layer protocol changes, it is only necessary to ensure the correct encapsulation of the data, and the firmware implementation of the Bluetooth CAN box does not need to be changed. In this way, developers only need to pay attention to the changes in the CAN application layer, and do not need to frequently update the firmware of the Bluetooth CAN box, thereby improving development efficiency. In the prior art, in order to support Bluetooth and CAN communication, it is usually necessary to develop a Bluetooth application layer protocol to manage the communication between Bluetooth devices. If the CAN protocol changes, the Bluetooth application layer protocol may need to be modified. The introduction of the transparent transmission protocol layer makes the communication between the Bluetooth host device and the Bluetooth CAN box simpler, without the need to specially design a complex Bluetooth application layer protocol, and only needs to implement the encapsulation and decapsulation of data in the transparent transmission protocol layer, thereby greatly reducing the complexity of development and debugging. With the evolution of the CAN application layer protocol, users do not have to frequently update the Bluetooth CAN box firmware to adapt to the new protocol version. The reduction in the frequency of firmware updates means higher system stability and can reduce maintenance costs, thereby improving the overall experience of users. In this embodiment, the Bluetooth CAN box acts as a bridge, and it communicates through standard Bluetooth protocols and CAN protocols. During the transmission process, the transparent transmission protocol layer of the Bluetooth CAN box forwards the CAN application layer data from the main device to the CAN interface device, and vice versa. This process is completely carried out through standard protocols, thus ensuring the compatibility and flexibility of the system. Because the transparent transmission protocol layer does not depend on the protocol format of the CAN application layer, no matter how the CAN application layer protocol changes, the firmware of the Bluetooth CAN box (especially the Bluetooth and transparent transmission protocol parts) can remain unchanged.Just make corresponding adjustments to the CAN application layer protocol, and the frequency of firmware upgrades for the Bluetooth CAN box will be significantly reduced.

[0039] In some preferred embodiments, the data packet transmitted from the Bluetooth master device to the CAN interface device is a downlink CAN data packet. After the transparent transmission protocol layer of the master device communicates with the transparent transmission protocol layer of the CAN box through the transparent transmission protocol, the downlink CAN data packet is transmitted through the master device Bluetooth transceiver to the CAN box Bluetooth transceiver for reception. After the CAN box Bluetooth transceiver receives the downlink CAN data packet, it transmits the received downlink CAN data packet to the CAN box CAN transceiver through the transparent transmission protocol layer of the CAN box. The CAN box CAN transceiver receives the downlink CAN data packet transmitted by the transparent transmission protocol layer of the CAN box and then transmits it to the interface device CAN transceiver. Furthermore, the data packet transmitted from the CAN interface device to the Bluetooth master device is an uplink CAN data packet. After the transparent transmission protocol layer of the master device communicates with the transparent transmission protocol layer of the CAN box through the transparent transmission protocol, the uplink CAN data packet is transmitted to the CAN box CAN transceiver through the interface device CAN transceiver. The CAN box CAN transceiver transmits the uplink CAN data packet to the CAN box Bluetooth transceiver through the transparent transmission protocol layer of the CAN box. After receiving the uplink CAN data packet, the CAN box Bluetooth transceiver transmits it to the master device Bluetooth transceiver. It should be noted that after the downlink CAN data packet is transmitted between the transparent transmission protocol layer of the Bluetooth master device and the transparent transmission protocol layer of the CAN box, it is exchanged between the Bluetooth master device Bluetooth transceiver and the CAN box Bluetooth transceiver, and finally transmitted to the CAN transceiver of the CAN interface device through the CAN transceiver of the CAN box, ensuring the order and integrity of the data transmission from the master device to the interface device. The downlink CAN data packet is transmitted through Bluetooth communication, and the transparent transmission protocol layer provides a transparent protocol channel, so that the data transmission process is not affected by the complexity or changes of the CAN protocol itself. The uplink CAN data packet is transmitted from the CAN transceiver of the CAN interface device to the CAN transceiver of the CAN box, and then forwarded to the Bluetooth master device through the Bluetooth transceiver of the CAN box, ensuring the data transmission from the interface device to the master device. Similarly, the transparent transmission protocol layer provides the function of data encapsulation and decapsulation, so that data can be transmitted through the Bluetooth channel and does not depend on the specific CAN application layer protocol. In this embodiment, the forwarding of the data packet is processed by the transparent transmission protocol layer, and the content of the data itself will not be interfered by the Bluetooth and CAN protocols whether it is uplink or downlink. The introduction of the transparent transmission protocol layer makes the data transmission transparent, that is, the Bluetooth master device and the CAN interface device do not need to understand the specific communication protocol of the other party, but only need to encapsulate and decapsulate the data through the transparent transmission protocol. This independent transparent transmission method can greatly reduce the coupling degree of different protocol layers in the system. In addition, in this embodiment, the clear distinction between the downlink and uplink data packet flows helps to ensure that the two-way communication between the Bluetooth master device and the CAN interface device can be carried out in a predetermined order without confusion.Especially for complex multi-channel or multi-device systems, clear data flow helps reliable data transmission and synchronization. By distinguishing the transmission process of uplink and downlink data packets, conflicts between the two data directions (master device to interface device and interface device to master device) can be avoided during data transmission. Each forwarding link of the data packet maintains a clear order and flow direction to ensure the correctness and stability of data transmission.

[0040] In some preferred embodiments, the data packet structure of the transparent transmission protocol layer includes a header TAG, and the header TAG has fixed data for identifying the Bluetooth data frame header. Further, the data packet structure of the transparent transmission protocol layer includes a packet number FrameNo, and the packet number FrameNo is used for data transmission and reception response, retransmission and deduplication. It should be noted that in Bluetooth communication, especially in the case of multiple devices or multiple channels, the correct parsing and processing of data packets is crucial. The role of the header TAG is to provide a clear identifier for the data packet, so that the receiver can quickly identify which Bluetooth data frame header type the data packet belongs to, thereby helping to simplify the parsing process of the data frame and reduce the risk of mis-parsing. In addition, the packet number FrameNo is used as a unique identifier for the data packet to identify the sequence number of each data packet. Through the packet number, the receiver can respond to a specific data packet to confirm whether the packet is successfully received to avoid packet loss or repeated transmission. If a data packet is lost or an error occurs during transmission, the sender can identify the lost packet through the packet number and retransmit it. In some cases, the network environment may cause data packets to arrive repeatedly, and the packet number can help the receiver identify repeated packets and avoid repeated processing, thereby ensuring the consistency and integrity of the data. When the packet header TAG and the packet number FrameNo are used together, not only can the type and order of the data packet be clearly identified, but also the reliability and transmission efficiency of the entire communication system can be improved. Whether in the case of packet loss, retransmission or data packet duplication, this design can effectively reduce the additional overhead caused by erroneous or redundant data packets.

[0041] In some preferred embodiments, the data packet structure of the transparent transmission protocol layer includes a function code FuncCode, and the function code FuncCode is used to identify the type of the packet. Further, when the function code FuncCode identifies the type of the packet, it includes performing uplink transparent transmission or downlink transparent transmission of CAN data. Further, when performing uplink transparent transmission of CAN data, the function code FuncCode identifies the type of the packet including setting a filter, and the filter is used to filter out CAN data packets that are not required by the CAN application layer of the master device on the Bluetooth master device side. It should be noted that the main function of the function code FuncCode is to identify different types of data packets so that the receiver can perform different processing according to the type of the packet. By clearly distinguishing the function and type of the packet, data communication can be made more efficient and targeted. In a variety of communication protocols, especially transparent transmission protocols, different types of data packets are usually required to be processed. The function code FuncCode helps the receiver accurately understand the function of the current data packet by identifying the type of the packet (such as uplink transparent transmission, downlink transparent transmission, etc.), and then performs appropriate processing as needed. For example, a data packet may be used to transmit data, perform control commands, or trigger specific operations. Distinguishing different types of data packets can reduce the complexity of protocol layer parsing and improve the response speed of the system. CAN bus communication usually involves uplink (slave to master) and downlink (master to slave) data transmission. By clearly identifying uplink transparent transmission or downlink transparent transmission in the function code FuncCode, the protocol layer can perform different operations according to the data flow direction. In addition, in CAN bus communication, the transmitted data packet may contain a large amount of information, some of which is not important for specific applications (such as Bluetooth master devices), and may even affect communication efficiency or introduce redundancy. Through the function code FuncCode, the Bluetooth master device can actively set filters to specify which CAN data packets need to be transmitted and which can be filtered out, avoiding the transmission of a large number of irrelevant data packets, reducing the communication burden, and improving transmission efficiency.

[0042] In some preferred embodiments, the data packet structure of the transparent transmission protocol layer includes a response confirmation field NeedResp, and the response confirmation field NeedResp is used to inform the data receiver whether it needs to respond to the data packet transmitted by the transparent transmission protocol layer. It should be noted that the response confirmation field NeedResp can clearly indicate whether the data packet requires the receiver to respond. In some cases, the sender may want to confirm whether the data is successfully received or whether the receiver has processed the data. By setting this field, it is possible to control whether the receiver needs to return confirmation information, avoid unnecessary responses, and save communication resources. It is understandable that in some application scenarios, the sender may not care whether the receiver has successfully received the data, or in some protocols, only specific types of data packets need to be responded. For other data packets that do not require a response, the receiver can choose to directly discard or ignore them, which can effectively reduce unnecessary processing and load in the protocol stack. If each data packet requires the receiver to respond, it may cause additional network traffic and delay. For data packets that are not important or do not require confirmation, the sender and the receiver can avoid redundant responses through the NeedResp field. This can significantly reduce resource consumption and bandwidth occupancy during communication, especially in wireless communication environments with limited bandwidth.

[0043] In some further preferred embodiments, the data packet structure of the transparent transmission protocol layer includes a data length identification field DataLen and a data integrity check field CRC, wherein the data length identification field DataLen is used to identify the data length of the data part Data, and the data integrity check field CRC is used to perform data integrity check on the packet. It should be noted that the DataLen field is used to identify the length of the data part (Data) in the data packet, providing a clear data boundary identification so that the data part can be correctly extracted to avoid misinterpretation or data loss. The data integrity check field CRC can be used to perform data integrity check on the data packet to ensure that the data is not damaged or tampered with during the transmission process. The receiver verifies whether the data is complete and valid by performing a CRC check on the data packet.

[0044] In some further preferred embodiments, when performing uplink transparent transmission of CAN data, multiple filters are set to filter the CAN data, and the multiple filters use a mask mode, including a configuration parameter MASK and a configuration parameter ID. The configuration parameter MASK is used to identify which bits in the CAN data need to be involved in filtering, and the configuration parameter ID is used to identify the CAN ID value that needs to be filtered. It should be noted that multiple filters use a mask mode to screen and filter specific CAN data, which can ensure that only data packets that meet specific conditions can pass through the filter, thereby improving system efficiency and performance. By filtering unnecessary or irrelevant data, the amount of Bluetooth wireless transmission data and the processing burden are reduced. In the CAN bus protocol, the ID value of the data packet is an important identifier to distinguish different messages.

[0045] In this embodiment, by using filters and masks, the required CAN ID can be accurately screened out to avoid receiving irrelevant messages. This not only improves the data processing efficiency, but also saves system resources. The configuration parameter MASK is used to specify which bits in the CAN data need to be involved in the filtering. Masking is a bit-level operation that allows precise control of which bits (usually the ID part) need to be matched with the filter. The mask covers up unimportant bits and only focuses on the important parts, thereby providing a more flexible filtering mechanism. Through the mask, the filtering conditions can be set flexibly. For example, the mask can be used to filter out certain low- or high-bit CAN IDs that are not concerned, and only match the specified parts. This flexibility enables the system to support a variety of complex filtering requirements without having to perform a complete match in each data packet. In addition, the configuration parameter ID is used to specify the CAN ID value that needs to be filtered to ensure that only the data packets of the specified CAN ID can pass the filter. Tables 1, 2, and 3 below respectively give some examples of filters filtering CAN data. Among them, the "*" data represents that the filter does not pay attention to the value of the corresponding bit, which can be 0 or 1.

[0046]

[0047] Table 1

[0048]

[0049] Table 2

[0050]

[0051] Table 3

[0052] In some further preferred embodiments, the format of the downlink CAN data packet includes the number of downlink CAN packets CanPackNum and the downlink transparent transmission CAN packet data CanPackX; the downlink transparent transmission CAN packet data CanPackX includes a standard frame or extended frame identifier CanIDType, a CAN ID, a CAN packet data length DLC, and a data part Data. It should be noted that the CanPackNum field identifies the number of downlink CAN data packets, that is, how many CAN packets are included in a downlink data transmission process. It enables the receiver to know how many CAN packets to process, so that it can better manage the received data. It is understandable that due to the limited length of the data packet of the CAN protocol, larger data usually needs to be divided into multiple CAN packets for transmission. The CanPackNum field can help the receiver know how many packets need to be received by clearly informing the receiver of the total number of data packets, and ensure that all data packets arrive before the data integrity processing and further analysis are performed. When the data is packetized, the receiver can use CanPackNum to confirm whether all relevant data packets have been received. If the number of data packets is incorrect, the receiver can request retransmission, thereby improving the reliability of data transmission. After the data is split into multiple CAN packets, the receiver needs to reassemble these packets into complete data. Through CanPackNum, the receiver can know how many data packets need to be received to ensure the order and integrity of the final data. In addition, CanPackX is a structure containing specific CAN data, which carries the actual CAN data packet information. Each CanPackX (such as CanPack1, CanPack2, CanPackN, etc.) can contain various key information of the data, such as frame type, CAN ID, data length, and data content. CAN ID is a unique identifier for each CAN data packet, which is used to distinguish different types of messages and different communication sources. Through the CAN ID field, the system can correctly route and process data according to the ID value. For example, a specific device or module may only care about data within a specific CAN ID range, so through this ID field, the receiver can accurately identify the source and destination of the data. In addition, the CAN packet data length DLC, as an identifier of the data length, can indicate the length of the data part and is used to identify the number of bytes of valid data in the data packet. The existence of the DLC field enables the receiver to accurately parse the size of the data part without causing data loss or incorrect parsing due to inconsistent length. For application scenarios with variable-length data, the DLC field is very critical, which helps the receiver allocate sufficient buffer space to receive data according to the data length. The data part is the main content of the CAN packet, which contains the actual data to be transmitted. The data part can be various types of information, such as sensor data, control commands, status information, etc.The receiving party processes and analyzes the packet according to the data part and performs corresponding operations. It should be noted that the format of the uplink CAN data packet is substantially the same as the format of the downlink CAN data packet, and the format of the downlink CAN data packet can be referred to.

[0053] In some further embodiments, for important data that needs to be ensured to be received by the receiver, the response confirmation field NeedResp is set in the data packet, and the receiver needs to respond after receiving the data packet. If the receiver does not respond within the specified time, it is considered that the data packet is lost and retransmission is triggered; when the sender sends a data packet, the packet number FrameNo is accumulated. If the packet number FrameNo of the newly received data packet is less than or equal to the packet number FrameNo of the previously received data packet, it is considered that a duplicate data packet is received and is directly ignored and not processed. It should be noted that the response confirmation field NeedResp is used to indicate whether the receiver needs to respond to the received data packet. For important data that needs to ensure reliable data transmission, the sender requires the receiver to respond and confirm. If the receiver does not respond within the specified time, retransmission is triggered, thereby improving the reliability of the data, ensuring the timely and complete transmission of the data, and ensuring the robustness of the data in network transmission. In addition, the packet number FrameNo field is used to assign a unique number to each sent data packet to help the receiver identify the order of the data packets and ensure the correct reception and processing of the data packets. By accumulating packet numbers, the receiver can determine the order of packets and ensure orderly reception of data, thereby avoiding data confusion, repeated processing or erroneous operations, saving computing resources and improving system efficiency.

[0054] Embodiment 2

[0055] See also Figure 1-Figure 7This embodiment provides a Bluetooth-to-CAN communication transparent transmission system, including: a Bluetooth master device, a CAN interface device, and a Bluetooth CAN box, wherein the Bluetooth master device communicates with the CAN interface device through the Bluetooth CAN box; when the Bluetooth master device, the Bluetooth CAN box, and the CAN interface device communicate with each other, the above-mentioned Bluetooth-to-CAN communication transparent transmission method is used to transmit data packets. The Bluetooth-to-CAN communication transparent transmission method defines a Bluetooth master device, wherein the Bluetooth master device includes a master device CAN application layer, a master device transparent transmission protocol layer, and a master device Bluetooth transceiver, wherein the master device CAN application layer communicates with the master device transparent transmission protocol layer, wherein the master device transparent transmission protocol layer communicates with the master device Bluetooth transceiver, and defines a CAN interface device, wherein the CAN interface device includes an interface device CAN application layer and an interface device CAN transceiver, wherein the interface device CAN application layer communicates with the interface device CAN transceiver; wherein the master device CAN application layer communicates with the interface device CAN application layer through the CAN application layer protocol, and defines a Bluetooth CAN box, wherein the Bluetooth CAN box includes a CAN box transparent transmission protocol layer, a CAN box Bluetooth transceiver, and a CAN box CAN transceiver. The transparent transmission protocol layer of the CAN box communicates with the CAN box Bluetooth transceiver and the CAN box CAN transceiver respectively, the transparent transmission protocol layer of the main device communicates with the transparent transmission protocol layer of the CAN box through the transparent transmission protocol, the CAN box Bluetooth transceiver communicates with the main device Bluetooth transceiver through the standard Bluetooth protocol, the CAN box CAN transceiver communicates with the interface device CAN transceiver through the standard CAN protocol, and communication is established between the Bluetooth main device and the CAN interface device through the Bluetooth CAN box to transmit data packets, thereby avoiding the need to additionally formulate a set of Bluetooth application layer protocols. When the upper CAN application layer protocol changes, there is no need to change the firmware of the Bluetooth CAN box, thereby improving development efficiency, reducing the frequency of Bluetooth CAN box firmware upgrades, and improving user experience.

[0056] It should be pointed out that the above embodiments are only preferred specific implementation modes of the present invention, and the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention. The protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A transparent transmission method for Bluetooth to CAN communication, characterized in that: include: A Bluetooth master device is defined, wherein the Bluetooth master device comprises a master device CAN application layer, a master device transparent transmission protocol layer, and a master device Bluetooth transceiver, wherein the master device CAN application layer communicates with the master device transparent transmission protocol layer, and the master device transparent transmission protocol layer communicates with the master device Bluetooth transceiver; A CAN interface device is defined, wherein the CAN interface device comprises an interface device CAN application layer and an interface device CAN transceiver, and the interface device CAN application layer communicates with the interface device CAN transceiver; The master device CAN application layer communicates with the interface device CAN application layer via a CAN application layer protocol; A Bluetooth CAN box is defined, wherein the Bluetooth CAN box comprises a transparent transmission protocol layer of the CAN box, a CAN box Bluetooth transceiver and a CAN box CAN transceiver, wherein the transparent transmission protocol layer of the CAN box communicates with the CAN box Bluetooth transceiver and the CAN box CAN transceiver respectively, the transparent transmission protocol layer of the master device communicates with the transparent transmission protocol layer of the CAN box through a transparent transmission protocol, the CAN box Bluetooth transceiver communicates with the master device Bluetooth transceiver through a standard Bluetooth protocol, and the CAN box CAN transceiver communicates with the interface device CAN transceiver through a standard CAN protocol; Through the Bluetooth CAN box, communication is established between the Bluetooth main device and the CAN interface device to perform data packet transmission.

2. The transparent transmission method of Bluetooth to CAN communication as claimed in claim 1, characterized in that: The data packet transmitted from the Bluetooth master device to the CAN interface device is a downlink CAN data packet. After the transparent transmission protocol layer of the master device communicates with the transparent transmission protocol layer of the CAN box through the transparent transmission protocol, the downlink CAN data packet is transmitted through the master device Bluetooth transceiver to the CAN box Bluetooth transceiver for reception. After the CAN box Bluetooth transceiver receives the downlink CAN data packet, it transmits the received downlink CAN data packet to the CAN box CAN transceiver through the transparent transmission protocol layer of the CAN box. The CAN box CAN transceiver receives the downlink CAN data packet transmitted by the transparent transmission protocol layer of the CAN box and then transmits it to the interface device CAN transceiver.

3. The transparent transmission method of Bluetooth to CAN communication according to claim 1, characterized in that: The data packet transmitted from the CAN interface device to the Bluetooth master device is an uplink CAN data packet. After the transparent transmission protocol layer of the master device communicates with the transparent transmission protocol layer of the CAN box through the transparent transmission protocol, the uplink CAN data packet is transmitted to the CAN box CAN transceiver through the interface device CAN transceiver. The CAN box CAN transceiver transmits the uplink CAN data packet to the CAN box Bluetooth transceiver through the transparent transmission protocol layer of the CAN box. After receiving the uplink CAN data packet, the CAN box Bluetooth transceiver transmits it to the master device Bluetooth transceiver.

4. The transparent transmission method of Bluetooth to CAN communication as claimed in claim 1, characterized in that: The data packet structure of the transparent transmission protocol layer includes a packet header TAG, and the packet header TAG has fixed data and is used to identify a Bluetooth data frame header.

5. The transparent transmission method of Bluetooth to CAN communication as claimed in claim 1, characterized in that: The data packet structure of the transparent transmission protocol layer includes a packet number FrameNo, and the packet number FrameNo is used for data transmission and reception response, retransmission and deduplication.

6. The transparent transmission method of Bluetooth to CAN communication as claimed in claim 1, characterized in that: The data packet structure of the transparent transmission protocol layer includes a function code FuncCode, and the function code FuncCode is used to identify the type of the packet.

7. The transparent transmission method of Bluetooth to CAN communication as claimed in claim 6, characterized in that: When the function code FuncCode identifies the type of the packet, it includes uplink transparent transmission or downlink transparent transmission of CAN data.

8. The transparent transmission method of Bluetooth to CAN communication as claimed in claim 7, characterized in that: When performing uplink transparent transmission of CAN data, the type of the function code FuncCode identification packet includes setting a filter, and the filter is used to filter out CAN data packets that are not required by the master device CAN application layer on the Bluetooth master device side.

9. The transparent transmission method of Bluetooth to CAN communication as claimed in claim 1, characterized in that: The data packet structure of the transparent transmission protocol layer includes a response confirmation field NeedResp, and the response confirmation field NeedResp is used to inform the data receiver whether a response to the data packet transmitted by the transparent transmission protocol layer is required.

10. A Bluetooth to CAN communication transparent transmission system, characterized in that: include: A Bluetooth master device, a CAN interface device and a Bluetooth CAN box, wherein the Bluetooth master device communicates with the CAN interface device through the Bluetooth CAN box; When the Bluetooth master device, the Bluetooth CAN box and the CAN interface device communicate with each other, the transparent transmission method of Bluetooth to CAN communication as described in any one of claims 1 to 9 is used to transmit data packets.

Citation Information

Patent Citations

  • A vehicle data transmission system and method

    CN110191439A

  • Remote communication method and device, electronic equipment and storage medium

    CN118368605A