A data transmission method, apparatus, device and medium
By introducing a transmission control module into the vehicle communication system, the frame transmission interval of the J1939 module is matched with the data receiving capability of the target module, thus solving the transmission instability problem when the J1939 module sends multiple data packets and achieving more stable data transmission.
Patent Information
- Application Number
- CN202510620664.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-14
- Publication Date
- 2026-11-17
AI Technical Summary
In the vehicle communication system, when the J1939 module sends multiple data packets, it fails to effectively consider the data receiving capability of the receiver, resulting in unstable data transmission.
By deploying a transmission control module in the vehicle communication system, the frame transmission interval of the J1939 module can be flexibly controlled to match the data receiving capability of the target module, thus ensuring stable transmission of data packets.
The J1939 module's data transmission stability has been improved, preventing situations where the receiver cannot receive data in a timely manner and enhancing the overall performance of the communication system.
Smart Images

Figure CN123123369A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of vehicle technology, and in particular to a data transmission method, apparatus, electronic device, and computer-readable storage medium. Background Technology
[0002] In vehicle communication systems, a J1939 module is typically deployed. The J1939 module enables communication between electronic control units (ECUs). Specifically, the J1939 module sends the data to be transmitted to the CAN bus, and the CAN bus then transmits the data to the receiver.
[0003] Typically, the data to be sent by the J1939 module consists of multiple data packets. Ensuring the stability of data transmission in scenarios where the J1939 module sends multiple data packets has become an urgent problem to be solved. Summary of the Invention
[0004] This application provides a data transmission method that improves the stability of data transmission in the J1939 module. This application also provides an apparatus, electronic device, and computer-readable storage medium corresponding to the above method.
[0005] In a first aspect, this application provides a data transmission method applied to a vehicle communication system, wherein the vehicle communication system is equipped with a transmission control module and a J1939 module, and the method includes:
[0006] The J1939 module in the vehicle communication system generates first data to be sent; wherein, the first data includes multiple data packets, and the recipient of the first data is the target module;
[0007] The J1939 module in the vehicle communication system notifies the transmission control module of the first data transmission request.
[0008] The transmission control module in the vehicle communication system determines the frame transmission interval corresponding to the target module, so that the J1939 module transmits the multiple data packets in the first data to the CAN bus multiple times at the frame transmission interval; wherein, the frame transmission interval corresponding to the target module is related to the data receiving capability of the target module, and the CAN bus is used to forward the first data to the target module.
[0009] In some possible implementations, the transmission control module provides a frame transmission and reception processing interface, and the J1939 module in the vehicle communication system notifies the transmission control module of the transmission request for the first data, including:
[0010] The J1939 module in the vehicle communication system calls the send confirmation function of the transmit / receive frame processing interface to notify the transmission control module of the first data transmission request.
[0011] In some possible implementations, the transmission control module provides a frame transmission and reception processing interface, and the J1939 module transmits the plurality of data packets in the first data to the CAN bus multiple times at the frame transmission interval, including:
[0012] For each data packet in the first data, the J1939 module performs the following steps:
[0013] In response to the timing unit of the transceiver frame processing interface determining that the time since the last data packet has been sent has reached the frame transmission interval, the data packet is sent to the CAN bus.
[0014] In some possible implementations, the transmission control module in the vehicle communication system determines the frame transmission interval corresponding to the target module, including:
[0015] When the target module adopts the interrupt reception mode, the transmission control module in the vehicle communication system determines that the frame transmission interval corresponding to the target module is the shortest frame transmission interval in the transmission protocol corresponding to the J1939 module.
[0016] When the target module adopts a polling reception method, the transmission control module in the vehicle communication system determines the frame transmission interval corresponding to the target module as the polling period of the target module.
[0017] In some possible implementations, the vehicle communication system is built on an open automotive system architecture, and the transmission control module is deployed in the basic software layer of the open automotive system architecture.
[0018] In some possible implementations, the transmission control module provides a frame transmission and reception processing interface, and the method further includes:
[0019] The name of the transceiver frame processing interface associated with the J1939 module in the automotive open system architecture is changed to the name of the transceiver frame processing interface provided by the transmission control module.
[0020] In some possible implementations, the J1939 module in the vehicle communication system generates first data to be transmitted, including:
[0021] The J1939 module in the vehicle communication system receives raw data sent by the sender;
[0022] The J1939 module in the vehicle communication system encapsulates the original data into multiple data packets to form the first data; wherein each data packet includes 8 bytes, the first byte is used to identify the sequence number of the data packet, and the other bytes are the data in the original data.
[0023] Secondly, this application provides a data transmission device deployed in a vehicle communication system, wherein the vehicle communication system is equipped with a transmission control module and a J1939 module, and the device includes:
[0024] A communication module, deployed in the J1939 module, is used to generate first data to be sent; wherein, the first data includes multiple data packets, and the recipient of the first data is the target module;
[0025] The notification module, deployed in the J1939 module, is used to notify the sending request of the first data;
[0026] The determination module, deployed in the transmission control module, is used to determine the frame transmission interval corresponding to the target module;
[0027] The communication module is further configured to send the plurality of data packets in the first data to the CAN bus multiple times at the frame transmission interval, and the CAN bus is configured to forward the first data to the target module.
[0028] In some possible implementations, the transmission control module provides a frame transmission and reception processing interface, and the notification module is specifically used for:
[0029] The send confirmation function of the send / receive frame processing interface is invoked to notify the transmission control module of the first data transmission request.
[0030] In some possible implementations, the transmission control module provides a frame transmission and reception processing interface, and the communication module is specifically used for:
[0031] For each data packet in the first data, perform the following steps:
[0032] In response to the timing unit of the transceiver frame processing interface determining that the time since the last data packet has been sent has reached the frame transmission interval, the data packet is sent to the CAN bus.
[0033] In some possible implementations, the determining module is specifically used for:
[0034] When the target module adopts the interrupt reception mode, the frame transmission interval corresponding to the target module is determined to be the shortest frame transmission interval in the transmission protocol corresponding to the J1939 module;
[0035] When the target module adopts a polling reception method, the frame transmission interval corresponding to the target module is determined as the polling period of the target module.
[0036] In some possible implementations, the vehicle communication system is built on an open automotive system architecture, and the transmission control module is deployed in the basic software layer of the open automotive system architecture.
[0037] In some possible implementations, the transmission control module provides a frame transmission and reception processing interface, and the device further includes a modification module deployed in the J1939 module for:
[0038] The name of the transceiver frame processing interface associated with the J1939 module in the automotive open system architecture is changed to the name of the transceiver frame processing interface provided by the transmission control module.
[0039] In some possible implementations, the communication module is specifically used for:
[0040] Receive the raw data sent by the sender;
[0041] The original data is encapsulated into multiple data packets to form the first data; wherein each data packet includes 8 bytes, the first byte is used to identify the sequence number of the data packet, and the other bytes are the data in the original data.
[0042] Thirdly, this application provides an electronic device. The electronic device includes a processor and a memory, the memory storing instructions, and the processor executing the instructions to cause the electronic device platform to perform the method as described in the first aspect of this application or any implementation thereof.
[0043] Fourthly, this application provides a computer-readable storage medium. The computer-readable storage medium stores instructions that, when executed on an electronic device, cause the electronic device to perform the method described in the first aspect or any implementation thereof.
[0044] Fifthly, this application provides a computer program product. The computer program product includes computer-readable instructions that, when executed on an electronic device, cause the electronic device to perform the method described in the first aspect or any implementation thereof.
[0045] Based on the implementation methods provided in the above aspects, this application can be further combined to provide more implementation methods.
[0046] Based on the above description, it can be seen that the technical solution of this application has the following beneficial effects:
[0047] Specifically, this method is applied to a vehicle communication system, which is equipped with a transmission control module and a J1939 module. The J1939 module in the vehicle communication system generates first data to be sent, which includes multiple data packets. The recipient of the first data is the target module. Then, the J1939 module in the vehicle communication system notifies the transmission control module of the first data transmission request. The transmission control module in the vehicle communication system determines the frame transmission interval corresponding to the target module, so that the J1939 module transmits the multiple data packets in the first data to the CAN bus multiple times at the frame transmission interval. The frame transmission interval corresponding to the target module is related to the data receiving capability of the target module. The CAN bus is used to forward the first data to the target module.
[0048] In this method, a custom transmission control module is deployed in the vehicle communication system. For the data transmission process of the J1939 module, the transmission control module flexibly controls the frame transmission interval, so that the frame transmission interval of the J1939 module sending multiple data packets matches the data receiving capability of the data receiver (i.e., the target module). This avoids the situation where the J1939 module sends too much data and the data receiver cannot receive it in time, thereby improving the stability of the data transmission of the J1939 module. Attached Figure Description
[0049] The above and other features, advantages, and aspects of the embodiments of this application will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.
[0050] Figure 1 A flowchart illustrating a data transmission method provided in an embodiment of this application;
[0051] Figure 2 This application provides a schematic diagram of the architecture of a vehicle communication system.
[0052] Figure 3 This is a schematic diagram of the structure of a data transmission device provided in an embodiment of this application;
[0053] Figure 4 This is a schematic diagram of the structure of an electronic device for transmitting data, provided in an embodiment of this application. Detailed Implementation
[0054] Embodiments of this application will now be described in more detail with reference to the accompanying drawings. While some embodiments of this application are shown in the drawings, it should be understood that this application can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this application. It should be understood that the drawings and embodiments of this application are for illustrative purposes only and are not intended to limit the scope of protection of this application.
[0055] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0056] It should be noted that the concepts of "first" and "second" mentioned in this application are only used to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0057] It should be noted that the terms "a" and "a plurality of" used in this application are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0058] To facilitate understanding of the technical solution of this application, the specific application scenarios in this application are described below.
[0059] In vehicle communication systems, the J1939 module is typically deployed. The J1939 module enables communication between electronic control units (ECUs). Specifically, the J1939 module is responsible for sending and receiving data on the CAN bus. For example, the J1939 module sends data to be sent to the CAN bus, and the CAN bus sends the data to be sent to the receiver.
[0060] Typically, the J1939 module uses the J1939 protocol to implement multi-message transmission, meaning that the data to be sent by the J1939 module includes multiple data packets. However, this method does not consider the data receiving capability of the receiver, and it is very easy for the receiver to be unable to reliably receive multiple data packets sent by the J1939. The industry urgently needs a method to control the frame transmission interval of data packets in scenarios where the J1939 module sends multiple data packets to ensure the stability of data transmission.
[0061] Based on this, this application provides a data transmission method. Specifically, the method is applied to a vehicle communication system, which is equipped with a transmission control module and a J1939 module. The J1939 module in the vehicle communication system generates first data to be transmitted, wherein the first data includes multiple data packets, and the receiver of the first data is a target module. Then, the J1939 module in the vehicle communication system notifies the transmission control module of the transmission request to transmit the first data. The transmission control module in the vehicle communication system determines the frame transmission interval corresponding to the target module, so that the J1939 module transmits the multiple data packets in the first data to the CAN bus multiple times at the frame transmission interval. The frame transmission interval corresponding to the target module is related to the data receiving capability of the target module, and the CAN bus is used to forward the first data to the target module.
[0062] In this method, a custom transmission control module is deployed in the vehicle communication system. For the data transmission process of the J1939 module, the transmission control module flexibly controls the frame transmission interval, so that the frame transmission interval of the J1939 module sending multiple data packets matches the data receiving capability of the data receiver (i.e., the target module). This avoids the situation where the J1939 module sends too much data and the data receiver cannot receive it in time, thereby improving the stability of the data transmission of the J1939 module.
[0063] Next, the data transmission method provided in the embodiments of this application will be described in detail with reference to the accompanying drawings. See also Figure 1 The diagram shows a data transmission method that can be applied to a vehicle communication system, which is equipped with a transmission control module and a J1939 module.
[0064] The transmission control module can be understood as a custom module used to control the frame transmission interval for data transmission from the J1939 module. In other words, by deploying the transmission control module in the vehicle communication system, frame transmission interval control for data transmission from the J1939 module is achieved.
[0065] In some embodiments, see Figure 2 The diagram shows an architecture of a vehicle communication system. The vehicle communication system is built on the automotive open system architecture (AUTOSAR), and the transmission control module and the J1939 module are deployed on the basic software layer of the automotive open system architecture.
[0066] Among them, the AUTOSAR architecture provides an open and standardized software architecture for vehicle communication systems. Through a layered software architecture, it separates the application layer software from the basic software layer, allowing application software to be developed and tested independently of the hardware, thereby improving the portability and reusability of the software.
[0067] Specifically, the AUTOSAR architecture is divided into three layers from top to bottom: the application layer, the runtime environment (RTE), and the basic software layer (BSW). The application layer contains application software related to vehicle functions, such as engine control, transmission control, and body electronic control. These software modules directly implement various vehicle functions but do not directly interact with the hardware. The RTE layer, located between the application layer and the basic software layer, provides the runtime environment for the application layer, manages communication between the application software and the basic software, and decouples modules, allowing the application software to be developed and tested independently of the basic software. The basic software layer is responsible for interacting with the hardware, providing abstraction and control over the hardware.
[0068] In this embodiment, by providing a transmission control module in the basic software layer of the AUTOSAR architecture, the transmission control module and the J1939 module are part of the basic software layer, enabling efficient communication between ECUs while controlling the transmission interval of data packets sent by the J1939 module.
[0069] The method specifically includes the following steps:
[0070] S101: The J1939 module in the vehicle communication system generates the first data to be sent.
[0071] In this context, the recipient of the first data is the target module. In other words, the first data can be understood as a data message generated by the sender, transmitted to the CAN bus via the J1939 module, and finally sent to the target module.
[0072] The first data may include multiple data packets. That is, the CAN communication packetization method of the J1939 module under the J1939 protocol encapsulates the data to be sent into multiple data packets for transmission.
[0073] In practice, the J1939 module in the vehicle communication system receives the raw data sent by the sender and encapsulates the raw data into multiple data packets to form the first data.
[0074] Each data packet consists of 8 bytes. The first byte is used to identify the sequence number of the data packet, and the other bytes are the data in the original data.
[0075] In other words, the data packetization method of the J1939 protocol can be understood as follows: for raw data longer than 8 bytes, it is split into multiple smaller data packets. The first byte of each data packet serves as the sequence number, and the following 7 bytes store the original data. In this way, data is transmitted in 8-byte data packets.
[0076] S102: The J1939 module in the vehicle communication system notifies the transmission control module of the first data transmission request.
[0077] In this embodiment, a transmission control module deployed in the vehicle communication system controls the transmission interval of multiple data packets sent by J1939. Therefore, when the J1939 module needs to transmit the first data to the CAN bus, it notifies the transmission control module to control the transmission interval.
[0078] In some possible implementations, the transmission control module provides a transmit / receive frame processing interface, and the J1939 module in the vehicle communication system calls the transmit / receive frame processing interface's send acknowledgment function to notify the transmission control module of the first data transmission request.
[0079] In other words, the transmit / receive frame processing interface of the transmission control module includes a transmit confirmation function. When the J1939 module needs to send data to the CAN bus, it calls the transmit / receive frame processing interface to trigger the transmit confirmation function, notifying the transmission control module of the first data transmission request, so that the transmission control module can control the transmission interval of multiple data packets in the first data.
[0080] In some embodiments, the vehicle communication system is built on the AUTOSAR architecture. In this case, the name of the transceiver frame processing interface associated with the J1939 module in the AUTOSAR architecture can be changed to the name of the transceiver frame processing interface provided by the transmission control module.
[0081] In other words, by modifying the name of the transceiver frame processing interface associated with the J1939 module under the AUTOSAR standard, the J1939 module is matched with the transmission control module. This ensures that when the J1939 module needs to transmit data to the CAN bus, it calls the transceiver frame processing interface provided by the transmission control module, thereby realizing the control of the transmission interval of multiple data packets without affecting the transceiver acknowledgment paths of other CAN channels under the AUTOSAR standard besides the J1939 module.
[0082] S103: The transmission control module in the vehicle communication system determines the frame transmission interval corresponding to the target module, so that the J1939 module can send multiple data packets in the first data to the CAN bus multiple times at the frame transmission interval.
[0083] The frame transmission interval corresponding to the target module is related to the data receiving capability of the target module, and the CAN bus is used to forward the first data to the target module.
[0084] In other words, the transmission control module determines the frame transmission interval based on the data receiving capability of the target module. The J1939 module sends multiple data packets of the first data multiple times at this frame transmission interval, so that the transmission interval of the J1939 module sending data matches the receiving capability of the receiver, and flexibly adjusts the frame transmission interval of the J1939 module for data exceeding 8 bytes.
[0085] In specific implementation, the transmission control module provides a transmit / receive frame processing interface. For each data packet in the first data, the J1939 module performs the following steps: in response to the timing unit of the transmit / receive frame processing interface, the time interval between sending the previous data packet and the frame transmission interval is determined, and the data packet is sent to the CAN bus.
[0086] In other words, the transmit / receive frame processing interface provided by the transmission control module adds a timing unit on top of the transmit confirmation function. The timing unit is used to time the time interval between transmitted data packets to determine whether the time since the last data packet was sent has reached the frame transmission interval. When the time since the last data packet was sent has reached the frame transmission interval, it indicates that the J1939 module can send the next data packet. In this way, by deploying the timing unit, based on the receiver's receiving capability, the J1939 module sends multiple data packets of the first data according to the receiver's frame transmission interval. Communication time control is achieved by only adding the timing unit, reducing the resource consumption of the central processing unit (CPU).
[0087] The embodiments of this application are applicable to both interrupt-based and polling-based transmission and reception modes used by the target module. In some embodiments, when the target module adopts interrupt-based reception mode, the transmission control module in the vehicle communication system determines that the frame transmission interval corresponding to the target module is the shortest frame transmission interval in the transmission protocol corresponding to the J1939 module.
[0088] Interrupt reception can be understood as follows: during CAN communication, when a specific event (such as a data reception event) occurs, the specific event is processed by sending an interrupt signal to the microcontroller unit (MCU). That is, the specific event is processed immediately after it occurs.
[0089] In this case, the target module usually has a strong data receiving capability. Therefore, the frame transmission interval corresponding to the target module can be the shortest frame transmission interval allowed by the J1939 protocol, so as to achieve fast and efficient data transmission.
[0090] In other embodiments, when the target module adopts a polling reception method, the transmission control module in the vehicle communication system determines the frame transmission interval corresponding to the target module as the polling period of the target module.
[0091] The polling receiving method can be understood as follows: during CAN communication, the receiving buffer is checked at a certain polling period to see if there is any new data to be read. If new data is detected, the data is read.
[0092] In this case, the data receiving capability of the target module is related to the polling period. Therefore, the frame sending interval corresponding to the target module can be the polling period of the target module. Match the frame sending interval with the data reading period of the target module, and adjust the frame sending interval according to the data reading period of the target module to ensure data reading stability.
[0093] Based on the above description, this application provides a data transmission method. This method is applied to a vehicle communication system, which includes a transmission control module and a J1939 module. The J1939 module generates first data to be transmitted, which includes multiple data packets. The receiver of the first data is a target module. Then, the J1939 module notifies the transmission control module of the first data transmission request. The transmission control module determines the frame transmission interval corresponding to the target module, so that the J1939 module transmits the multiple data packets in the first data to the CAN bus multiple times at the frame transmission interval. The frame transmission interval corresponding to the target module is related to the data receiving capability of the target module. The CAN bus is used to forward the first data to the target module.
[0094] In this method, a custom transmission control module is deployed in the vehicle communication system. For the data transmission process of the J1939 module, the transmission control module flexibly controls the frame transmission interval, so that the frame transmission interval of the J1939 module sending multiple data packets matches the data receiving capability of the data receiver (i.e., the target module). This avoids the situation where the J1939 module sends too much data and the data receiver cannot receive it in time, thereby improving the stability of the data transmission of the J1939 module.
[0095] Based on the methods provided in the embodiments of this application, the embodiments of this application also provide a data transmission device corresponding to the above methods. The units / modules described in the embodiments of this application can be implemented in software or hardware. The names of the units / modules do not, in certain circumstances, constitute a limitation on the unit / module itself.
[0096] See Figure 3The schematic diagram of the data transmission device shown is deployed in a vehicle communication system, which includes a transmission control module and a J1939 module. The device 300 includes:
[0097] Communication module 301, deployed in module J1939, is used to generate first data to be sent; wherein, the first data includes multiple data packets, and the recipient of the first data is the target module;
[0098] Notification module 302, deployed in module J1939, is used to notify the sending request of the first data;
[0099] The determination module 303, deployed in the transmission control module, is used to determine the frame transmission interval corresponding to the target module;
[0100] The communication module 301 is further configured to send the plurality of data packets in the first data to the CAN bus multiple times at the frame transmission interval, and the CAN bus is configured to forward the first data to the target module.
[0101] In some possible implementations, the transmission control module provides a frame transmission and reception processing interface, and the notification module 302 is specifically used for:
[0102] The send confirmation function of the send / receive frame processing interface is invoked to notify the transmission control module of the first data transmission request.
[0103] In some possible implementations, the transmission control module provides a frame transmission and reception processing interface, and the communication module 301 is specifically used for:
[0104] For each data packet in the first data, perform the following steps:
[0105] In response to the timing unit of the transceiver frame processing interface determining that the time since the last data packet has been sent has reached the frame transmission interval, the data packet is sent to the CAN bus.
[0106] In some possible implementations, the determining module 303 is specifically used for:
[0107] When the target module adopts the interrupt reception mode, the frame transmission interval corresponding to the target module is determined to be the shortest frame transmission interval in the transmission protocol corresponding to the J1939 module;
[0108] When the target module adopts a polling reception method, the frame transmission interval corresponding to the target module is determined as the polling period of the target module.
[0109] In some possible implementations, the vehicle communication system is built on an open automotive system architecture, and the transmission control module is deployed in the basic software layer of the open automotive system architecture.
[0110] In some possible implementations, the transmission control module provides a frame transmission and reception processing interface, and the device further includes a modification module deployed in the J1939 module for:
[0111] The name of the transceiver frame processing interface associated with the J1939 module in the automotive open system architecture is changed to the name of the transceiver frame processing interface provided by the transmission control module.
[0112] In some possible implementations, the communication module 301 is specifically used for:
[0113] Receive the raw data sent by the sender;
[0114] The original data is encapsulated into multiple data packets to form the first data; wherein each data packet includes 8 bytes, the first byte is used to identify the sequence number of the data packet, and the other bytes are the data in the original data.
[0115] The data transmission apparatus 300 according to the embodiments of this application can correspondingly execute the method described in the embodiments of this application, and the above and other operations and / or functions of each module / unit of the data transmission apparatus 300 are respectively for implementing Figure 1 For the sake of brevity, the corresponding processes of each method in the illustrated embodiments will not be described in detail here.
[0116] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. See also Figure 4 The schematic diagram shown is of the structure of the electronic device 400 that implements data transmission. It should be noted that... Figure 4 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0117] like Figure 4 As shown, electronic device 400 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 401, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 402 or a program loaded from storage device 408 into random access memory (RAM) 403. RAM 403 also stores various programs and data required for the operation of electronic device 400. Processing device 401, ROM 402, and RAM 403 are interconnected via bus 404. Input / output (I / O) interface 405 is also connected to bus 404.
[0118] Typically, the following devices can be connected to I / O interface 405: input devices 406 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 407 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 408 including, for example, magnetic tapes, hard disks, etc.; and communication devices 409. Communication device 409 allows electronic device 400 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 4 An electronic device 400 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0119] This application also provides a computer-readable storage medium, also known as a machine-readable medium. In the context of this application, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0120] In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0121] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device. When the computer program is executed by a processing device, it performs the functions defined in the methods of the embodiments of this application.
[0122] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
[0123] While several specific implementation details are included in the foregoing discussion, these should not be construed as limiting the scope of this application. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0124] The above description is merely a preferred embodiment of this application and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of disclosure in this application is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this application.
Claims
1. A data transmission method, characterized in that, Applied to a vehicle communication system, the vehicle communication system being deployed with a transmission control module and a J1939 module, the method includes: The J1939 module in the vehicle communication system generates first data to be sent; wherein, the first data includes multiple data packets, and the recipient of the first data is the target module; The J1939 module in the vehicle communication system notifies the transmission control module of the first data transmission request. The transmission control module in the vehicle communication system determines the frame transmission interval corresponding to the target module, so that the J1939 module transmits the multiple data packets in the first data to the CAN bus multiple times at the frame transmission interval; wherein, the frame transmission interval corresponding to the target module is related to the data receiving capability of the target module, and the CAN bus is used to forward the first data to the target module.
2. The method according to claim 1, characterized in that, The transmission control module provides a frame transmission and reception processing interface. The J1939 module in the vehicle communication system notifies the transmission control module of the first data transmission request, including: The J1939 module in the vehicle communication system calls the send confirmation function of the transmit / receive frame processing interface to notify the transmission control module of the first data transmission request.
3. The method according to claim 1, characterized in that, The transmission control module provides a frame transmission and reception processing interface. The J1939 module transmits the multiple data packets in the first data to the CAN bus multiple times at the frame transmission interval, including: For each data packet in the first data, the J1939 module performs the following steps: In response to the timing unit of the transceiver frame processing interface determining that the time since the last data packet has been sent has reached the frame transmission interval, the data packet is sent to the CAN bus.
4. The method according to claim 1, characterized in that, The transmission control module in the vehicle communication system determines the frame transmission interval corresponding to the target module, including: When the target module adopts the interrupt reception mode, the transmission control module in the vehicle communication system determines that the frame transmission interval corresponding to the target module is the shortest frame transmission interval in the transmission protocol corresponding to the J1939 module. When the target module adopts a polling reception method, the transmission control module in the vehicle communication system determines the frame transmission interval corresponding to the target module as the polling period of the target module.
5. The method according to claim 1, characterized in that, The vehicle communication system is built on the automotive open system architecture, and the transmission control module is deployed in the basic software layer of the automotive open system architecture.
6. The method according to claim 5, characterized in that, The transmission control module provides a frame transmission and reception processing interface, and the method further includes: The name of the transceiver frame processing interface associated with the J1939 module in the automotive open system architecture is changed to the name of the transceiver frame processing interface provided by the transmission control module.
7. The method according to any one of claims 1 to 6, characterized in that, The J1939 module in the vehicle communication system generates first data to be transmitted, including: The J1939 module in the vehicle communication system receives raw data sent by the sender; The J1939 module in the vehicle communication system encapsulates the original data into multiple data packets to form the first data; wherein each data packet includes 8 bytes, the first byte is used to identify the sequence number of the data packet, and the other bytes are the data in the original data.
8. A data transmission device, characterized in that, Deployed in a vehicle communication system, the vehicle communication system including a transmission control module and a J1939 module, the device includes: A communication module, deployed in the J1939 module, is used to generate first data to be sent; wherein, the first data includes multiple data packets, and the recipient of the first data is the target module; The notification module, deployed in the J1939 module, is used to notify the sending request of the first data; The determination module, deployed in the transmission control module, is used to determine the frame transmission interval corresponding to the target module; The communication module is further configured to send the plurality of data packets in the first data to the CAN bus multiple times at the frame transmission interval, and the CAN bus is configured to forward the first data to the target module.
9. An electronic device, characterized in that, The electronic device includes a processor and a memory, the memory storing instructions, and the processor executing the instructions to cause the electronic device to perform the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, It includes computer-readable instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in any one of claims 1 to 7.
