Vehicle communication method and system

CN122933646APending Publication Date: 2026-10-16HEFEI SUNSHINE POWER TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611031406.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-10
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

这种主从机分工方式并不高效,主机仅承担广播作用,从机的重复性工作量大,系统的整体灵活度不高

Benefits of technology

上述车辆通信方法和系统,主节点负责接收和分发数据,并实现对自身的数据识别和刷写,在分发过程中,还能适配从属节点的数据接收能力进行分发,提高了节点之间的协作能力,使系统整体的灵活性提高。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122933646A_ABST
    Figure CN122933646A_ABST
Patent Text Reader

Abstract

The present disclosure provides a vehicle communication method and system; wherein the method is applied to a vehicle communication system, the vehicle communication system comprising: a master node and at least one slave node, the master node being in communication connection with the slave node, the method comprising: the master node receiving to-be-flashed data, identifying at least one target node to be flashed by the to-be-flashed data, wherein the target node is the master node or the slave node; in the case that the target node to be flashed by the to-be-flashed data is the slave node, the master node sends the corresponding to-be-flashed data to the target node according to the data receiving capacity of the target node, and the target node performs data flashing according to the received data; in the case that the target node to be flashed by the to-be-flashed data is the master node, the master node performs data flashing according to the corresponding to-be-flashed data. The present disclosure can improve the flexibility of the vehicle communication system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of vehicle communication technology, and in particular to a vehicle communication method and system. Background Technology

[0002] With the evolution of the electronic and electrical architecture of new energy vehicles, the number and complexity of on-board electronic control units continue to increase. Against this backdrop, online software upgrades have become a core component of vehicle lifecycle management.

[0003] Existing ECU flashing technology typically involves the master unit broadcasting data to each slave unit, which then analyzes the data and decides whether to flash it. This master-slave division of labor is inefficient, as the master unit only performs the broadcasting function, the slave units have a large amount of repetitive work, and the overall system flexibility is low. Summary of the Invention

[0004] In view of this, the purpose of this disclosure is to provide a vehicle communication method and system to improve the flexibility of vehicle communication systems.

[0005] In a first aspect, embodiments of this disclosure provide a vehicle communication method applied to a vehicle communication system, the vehicle communication system comprising: a master node and at least one slave node, the master node being communicatively connected to the slave node, the method comprising: the master node receiving data to be flashed, identifying at least one target node to which the data to be flashed is to be flashed, wherein the target node is either the master node or the slave node; when the target node to be flashed is a slave node, the master node sending the corresponding data to be flashed to the target node according to the data receiving capability of the target node, the target node flashing the data according to the received data; when the target node to be flashed is a master node, the master node flashing the data according to the corresponding data to be flashed.

[0006] Optionally, the step of the master node receiving the data to be written and identifying at least one target node to be written by the data to be written includes: the master node receiving the data to be written, wherein the data to be written includes writing address information; the master node segmenting the data to be written according to the writing address information to obtain at least one data segment, wherein the nodes to be written in the same data segment are the same; and the master node determining the nodes to be written in the data segment as the target nodes of the corresponding data segment.

[0007] Optionally, when the target node to be flashed is a slave node and the data to be flashed is to be flashed, the step of the master node sending the corresponding data to be flashed to the target node according to the data receiving capability of the target node includes: when the target node to be flashed is a slave node and the data to be flashed is to be flashed, the master node adapts and sends the corresponding data to be flashed to the target node according to the bus protocol followed by the target node.

[0008] Optionally, the bus protocol is used to indicate the data throughput of the node; the step of the master node adapting and sending the corresponding data to be written to the target node according to the bus protocol followed by the target node includes: the master node splitting the corresponding data to be written into sub-packets adapted to the data throughput according to the data throughput of the target node and sending them to the target node in sequence.

[0009] Optionally, the step of the master node splitting the corresponding data to be written into sub-packets adapted to the data throughput of the target node and sending them sequentially to the target node according to the data throughput of the target node includes: the master node determining whether the remaining unsent data of the corresponding data to be written is sufficient to fill the cache space of the target node according to the data throughput of the target node; if sufficient, the master node takes data of the cache space size from the remaining unsent data and sends it to the target node, and repeatedly determines whether the remaining unsent data is sufficient to fill the cache space of the target node; if insufficient, the master node determines whether the remaining unsent data is the last sub-packet according to the total size of the corresponding data to be written; if it is the last sub-packet, the master node sends all the remaining unsent data.

[0010] Optionally, the method further includes: if it is not the last sub-packet, the master node continues to request and receive data to be written for the size of the pre-allocated, specified size of the write cache space.

[0011] Optionally, the master node is communicatively connected to the first gateway, and the master node requests and receives the data to be flashed from the first gateway, and the data to be flashed is sent to the master node by the first gateway.

[0012] Optionally, the data to be written includes verification information; the step of the target node writing data based on the received data includes: the target node erasing and writing the received data to the corresponding backup write address in memory according to the write address information in the received data; the target node verifying the data to be written according to the verification information; when the data to be written passes the verification, the target node erases and writes the data at the backup write address to the target write address.

[0013] Optionally, the method further includes: when the data to be written fails the verification, the master node broadcasts a write failure message to all slave nodes; the slave nodes respond to the write failure message by not erasing the data of the backup write address to the target write address, so as to maintain the original version.

[0014] Secondly, this disclosure provides a vehicle communication system, comprising: a master node and at least one slave node, the master node being communicatively connected to the slave node, wherein the master node is configured to: receive data to be flashed, identify at least one target node to which the data to be flashed is to be flashed, wherein the target node is either the master node or the slave node; when the target node to be flashed is a slave node, the master node is configured to: send the corresponding data to be flashed to the target node according to the data receiving capability of the target node, the target node being configured to: flash the data according to the received data; when the target node to be flashed is a master node, the master node is configured to: flash the data according to the corresponding data to be flashed.

[0015] Thirdly, embodiments of this disclosure provide an electronic device, including a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the above-described vehicle communication method.

[0016] Fourthly, embodiments of this disclosure provide a computer-readable storage medium storing computer-executable instructions. When the computer-executable instructions are invoked and executed by a processor, the computer-executable instructions cause the processor to implement the aforementioned vehicle communication method.

[0017] The embodiments disclosed herein bring the following beneficial effects: In the aforementioned vehicle communication method and system, the master node is responsible for receiving and distributing data, and can identify and write its own data. During the distribution process, it can also adapt to the data receiving capabilities of subordinate nodes for distribution, thereby improving the cooperation capabilities between nodes and enhancing the overall flexibility of the system.

[0018] Other features and advantages of this disclosure will be set forth in the following description and will be apparent in part from the description or may be learned by practicing the disclosure. The objects and other advantages of this disclosure are realized and obtained through the structures particularly pointed out in the description, claims and drawings.

[0019] To make the above-mentioned objects, features and advantages of this disclosure more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in the specific embodiments of this disclosure or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0021] Figure 1 This is a flowchart of one embodiment of the vehicle communication method in this disclosure; Figure 2 A schematic diagram of a vehicle communication system provided in an embodiment of this disclosure; Figure 3 A schematic diagram of a data segment in a vehicle communication method provided in an embodiment of this disclosure; Figure 4 This is a schematic diagram illustrating how the host performs packet disassembly and reassembly for transmission when the cache space sizes used for writing by the master node and slave node are inconsistent in the vehicle communication method provided in this embodiment of the disclosure. Figure 5 The data transmission process of a complete flashing task in the vehicle communication method provided in this embodiment of the disclosure; Figure 6 This is a schematic diagram illustrating the interaction between the diagnostic instrument, the host, and any one of the slave devices in the vehicle communication method provided in this embodiment of the disclosure. Figure 7 This describes a complete software upgrade process performed by the vehicle communication system in the vehicle communication method provided in this embodiment of the disclosure. Figure 8 A schematic diagram of a vehicle communication system provided in an embodiment of this disclosure; Figure 9 This is a schematic diagram of an electronic device provided in an embodiment of the present disclosure. Detailed Implementation

[0022] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0023] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in this disclosure, claims, and accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” or “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0024] For ease of understanding, the specific process of the embodiments of this disclosure is described below. Please refer to [link / reference]. Figure 1 One embodiment of the vehicle communication method disclosed herein is applied to a vehicle communication system, the vehicle communication system comprising: a master node and at least one slave node, the master node being communicatively connected to the slave node, and comprising the following steps: Step S10: The master node receives the data to be written and identifies at least one target node to which the data to be written is to be written, wherein the target node is the master node or the slave node. The data to be written can include the target data to be written to the specified node and the writing attribute information. The writing attribute information can be used to indicate the attributes of the specified node, the attributes of the target data, and other information used to indicate the data writing method. The specifics are not limited here.

[0025] This disclosure can be used for a master node to distribute data to a slave node, and the slave node to refresh the data based on the received data. It can also be used for the master node to receive data and refresh the data itself. The data to be refreshed can be any data that needs to be written to the master node or the slave node, such as software upgrade data, repair data, diagnostic data, control data, or instruction data, etc., and is not limited here.

[0026] In this embodiment, both the master node and the slave node have bidirectional data transmission capabilities. They can receive data / instructions from the upper-level node / device and send data / instructions to the lower-level node / device, following the communication protocol between the upper and lower level nodes, such as the bus protocol CAN (Controller Area Network) or the bus protocol CANFD (Controller Area Network with Flexible Data-rate), etc., and are not specifically limited here.

[0027] In one implementation, the master node and slave node can be the vehicle's electronic control unit (ECU), such as the engine management system (EMS), automatic transmission control unit (TCU), body control module (BCM), battery management system (BMS), and vehicle control unit (VCU).

[0028] Specifically, the master node can be a VCU, and the slave node can be any type of ECU other than a VCU; there is no limitation here. In addition to the data relay function provided in the embodiments of this disclosure, the master node can also have other functions, such as acting as the vehicle's central controller or central gateway; there is no specific limitation here.

[0029] Different nodes (including master and slave nodes) can be distributed in different network domains / segments and can use different communication protocols. For example, EMS is in the power domain, BCM is in the body domain, and network domains can also include intelligent driving domains, etc. Different network domains / segments have different communication bandwidths and can use different communication protocols. For example, the ECU in the power domain can use the CAN 2.0B protocol, while the ECU in the intelligent driving domain can use the CAN FD or Ethernet protocol, etc. The specifics are not limited here.

[0030] In one implementation, the master node can communicate with external devices. For example, the master node can connect to external devices via a CANFD bus and receive data to be written from the external devices based on the CANFD protocol. The data to be written in the external devices can come from local or cloud sources, and no specific limitation is made here.

[0031] External devices can act as gateways to communicate with the master node. In practical applications, external devices can be terminal devices such as vehicle diagnostic tools and over-the-air (OTA) updaters. They can connect to the master node through the on-board diagnostics (OBD) interface to communicate and interact with the master node.

[0032] In one implementation, the master node can identify at least one target node to be flashed based on the node information and flashing address information of the data to be flashed. The node information and flashing address information can be included in the data to be flashed or determined based on a flashing command received by the master node. The data to be flashed can contain more than one node and may include the master node and / or slave nodes; specific details are not limited here.

[0033] Step S20: When the target node to be written is a slave node, the master node sends the corresponding data to be written to the target node according to the data receiving capability of the target node, and the target node performs data writing according to the received data. When the target node to be flushed is a slave node with data to be flushed, the master node adaptively distributes the corresponding data to the target node. Adaptive distribution refers to using a distribution method that adapts to the data receiving capabilities of the target node. After receiving the data from the master node, the target node can flush the data and report the flushing status back to the master node, instructing the master node to continue distributing data, stop distributing, or perform other processing. Specific details are not limited here.

[0034] In one implementation, the data receiving capability can be indicated by one or more of the following information: the communication protocol used by the target node, protocol stack, buffer size, buffer depth, message queue length, maximum transmission unit (MTU), bandwidth, data throughput, maximum load, baud rate, response time, block size, frame format, ECU type, and ECU attributes. The specific details are not limited here.

[0035] In one implementation, the master node pre-stores a configuration information table for all slave nodes, and can obtain indication information of the target node's data receiving capability based on this pre-stored configuration information table, thereby... Based on the data receiving capability of the target node, a distribution method adapted to the data receiving capability of the target node is used to send the corresponding data to be written to the target node.

[0036] When the master node sends the corresponding data to be flashed to the target node according to the target node's data receiving capability, the master node can segment the data to be flashed according to the target node's data receiving capability, and encapsulate the segmented data into data segments to obtain at least one data segment. The encapsulation method of the data segment can be encapsulated according to the target node's data processing format. Each data segment can contain the address information to be flashed, such as the flashing start address, flashing end address, data segment length, and other flashing attributes. The specifics are not limited here.

[0037] After receiving data from the master node, the slave node can write the received data to a specified address. The specified address can be extracted from the received data or determined according to the write command sent by the master node. The specific address is not limited here.

[0038] Step S30: When the target node to be written is the master node and the data to be written is to be written, the master node performs data writing according to the corresponding data to be written.

[0039] In this implementation, if the master node identifies itself as the target node for the data to be written, it can directly write the data based on the corresponding data to be written. For example, if the write address of part / all of the data to be written points to the master node, then this part of the data is the data to be written to the master node, which is the target node for the data to be written.

[0040] After the master node has sent all the data to be flashed, steps S10-S30 can be repeated until all the data to be flashed has been received and sent. The data to be flashed received by the master node each time can be a part of the vehicle ECU upgrade package, specifically a flashing package file in hex or s19 format, used for OTA upgrades of the vehicle ECU. The data to be flashed can also be part of other function packages; specific details are not limited here.

[0041] As an example, and not a limitation, Figure 2 The diagram shown is a structural schematic of a vehicle communication system provided in an embodiment of this disclosure. Figure 2 In this embodiment, the host (i.e., master node) is connected to X slave devices (i.e., slave nodes) via a CAN bus, and to the diagnostic tool via a CANFD bus. Through the vehicle communication method provided in this embodiment, the host sends the data to be written via a distribution method adapted to the data receiving capabilities of the slave devices. This can overcome the bus incompatibility problem existing in different buses in the figure, and allow different slave devices to use different communication protocols, thereby improving the flexibility and scalability of the vehicle communication system.

[0042] The vehicle communication method provided by the above implementation method is that the master node is responsible for receiving and distributing data, and can identify and write its own data. During the distribution process, it can also adapt to the data receiving capabilities of the subordinate nodes for distribution, thereby improving the cooperation capability between nodes and improving the overall flexibility of the system.

[0043] Next, the vehicle communication method will be explained in detail.

[0044] In one implementation, the step of the master node receiving data to be written and identifying at least one target node to which the data to be written is to be written includes: the master node receiving the data to be written, wherein the data to be written includes writing address information; the master node performing segmentation processing on the data to be written according to the writing address information to obtain at least one data segment, wherein the nodes to be written in the same data segment are the same; and the master node determining the nodes to be written in the data segment as the target nodes of the corresponding data segment.

[0045] In this embodiment, the data to be written received by the master node includes writing address information. The master node segments the data to be written according to the writing address information to obtain at least one data segment. Each data segment belongs to the same node, that is, the data to be written belongs to the same node. The target node to be written can be determined according to the writing address corresponding to the data segment.

[0046] Different data segments can belong to the same write address or different write addresses. When segmenting the data to be written, the segmentation can be ordered. For example, if the data to be written is divided into ordered data segments 1-3 after segmentation, then data segment 1 can belong to target node A, data segment 2 can belong to target node B, and data segment 3 can belong to target node A, the same as data segment 1. No specific restrictions are made here.

[0047] Figure 3 The image shown is a schematic diagram of a data segment. Figure 3 In the diagram, Blocks 0-3 are all data segments to be written to the same target node. Each data segment contains indications such as the start and end addresses of the write operation, and the data length. The data segment also contains the actual data to be written to memory, such as... Figure 3 In the text, the data following "80130000" refers to the data in the memory space starting at address 0x80130000, and can be called valid data.

[0048] In one implementation, when the target node to be flashed is the slave node's data to be flashed, the step of the master node sending the corresponding data to be flashed to the target node according to the data receiving capability of the target node includes: when the target node to be flashed is the slave node's data to be flashed, the master node adapts and sends the corresponding data to be flashed to the target node according to the bus protocol followed by the target node.

[0049] In this embodiment, the data receiving capability of the target node is indicated by the communication protocol it uses, specifically by the bus protocol it follows. The master node adapts and sends the data segments belonging to the target node to the target node according to the bus protocol followed by the target node. That is, it sends the data to the target node in a distribution method adapted to the data receiving capability of the target node, thereby making it compatible with slave nodes using different bus protocols and improving the flexibility and scalability of the system.

[0050] Different bus protocols, such as CAN and CANFD, mainly need to be adapted in terms of speed, maximum data field length, and frame format. When the master node adapts and sends the corresponding data to be written to the target node according to the bus protocol followed by the target node, if the bus protocol followed by the target node is different from that of the master node, the transmission rate, maximum data field length, and frame format of the corresponding data to be written (the data segment belonging to the target node) can be adapted and sent to the target node.

[0051] In one implementation, the bus protocol is used to indicate the data throughput of the node; the step of the master node adapting and sending the corresponding data to be written to the target node according to the bus protocol followed by the target node includes: the master node splitting the corresponding data to be written into sub-packets adapted to the data throughput according to the data throughput of the target node and sending them to the target node in sequence.

[0052] In this embodiment, the data throughput of the target node indicates the data receiving capability of the target node. When the master node adapts and sends the corresponding data to be written to the target node according to the bus protocol followed by the target node, the data segment belonging to the target node is divided into sub-packets that do not exceed its data throughput capability according to the data throughput of the target node, and then sent to the target node accordingly, thereby realizing the adaptive data transmission of the master node.

[0053] The data throughput of the target node, or attribute information that can be used to indicate the data throughput of the target node, can be recorded in a preset configuration information table. The master node can quickly determine the data throughput of the target node by looking up the table, thereby improving the writing efficiency.

[0054] In one implementation, the step of the master node splitting the corresponding data to be written into sub-packets adapted to the data throughput of the target node and sending them sequentially to the target node includes: the master node determining whether the remaining unsent data of the corresponding data to be written is sufficient to fill the target node's cache space based on the target node's data throughput; if sufficient, the master node takes data the size of the cache space from the remaining unsent data and sends it to the target node, and repeatedly determines whether the remaining unsent data is sufficient to fill the target node's cache space; if insufficient, the master node determines whether the remaining unsent data is the last sub-packet based on the total size of the corresponding data to be written; if it is the last sub-packet, the master node sends all the remaining unsent data.

[0055] In this embodiment, the master node adaptively and cyclically sends data to be written or sub-packets of data segments to the target nodes based on their data throughput, thereby achieving bus compatibility. In this embodiment, the data throughput of the target node is determined by its cache space. The master node sends only a data amount less than or equal to the target node's cache space to the target node each time. After receiving the data to be written from the master node, the target node moves the received data into a designated memory space (such as a backup space) and reports its own cache space size back to the master node. The master node then determines whether to continue sending data.

[0056] Each time the master node sends data to any target node, it first determines whether the remaining data to be flushed to that target node is sufficient to fill the target node's cache space. If it is sufficient, it continues to send data to the target node in an amount less than or equal to the target node's cache space. If it is insufficient, it determines whether the remaining data to be flushed is the last sub-packet, in order to decide whether the master node continues to send the next sub-packet or sends all the remaining unsent data, i.e., all data to be flushed is sent.

[0057] In one implementation, the method further includes: if it is not the last sub-packet, the master node continues to request and receive data to be written based on a pre-allocated, specified size of write cache space.

[0058] In this embodiment, the master node does not receive all the data to be written in one go for this writing task. Instead, it receives the data in segments or packets. For example, if the writing task is to upgrade the software of all slave nodes, the upgrade package can be sent to the master node in segments or packets, and the master node can then distribute it to the target nodes in segments or packets.

[0059] As an example, and not a limitation, Figure 4The diagram illustrates how the host reassembles and resends data packets when the cache sizes used for writing by the master and slave nodes are inconsistent. The host long packet is the data to be written received by the host, and the data size of the host long packet matches the data size of the master cache. The host reassembles the host long packet into slave long packets and sends them to the slave in sequence. The data size of the slave long packet matches the data throughput and cache size of the corresponding slave, but the specifics are not limited here.

[0060] For ease of understanding, Figure 5 The diagram illustrates the data transmission process of a complete flashing task. First, the host records the total length of the file to be flashed on the slave device, which is the amount of data to be flashed in this task, i.e., the total amount of data to be flashed. Next, the host receives the Nth long packet, which is the Nth data to be flashed. After receiving the data, the host checks if there is any remaining data, i.e., whether there is any unsent data remaining from the previously received long packet. If so, the host first assembles the remaining data and then takes the data from the current long packet to fill it into the slave long packet. In other words, the unsent data from the previously received long packet and the data to be flashed received this time are assembled into the size of the slave long packet and then filled into the slave long packet. If the host determines that there is no remaining data, it will directly take data from the current long packet and fill it into the slave long packet. That is, it will take the amount of data corresponding to the slave's cache space from the data to be written received this time and fill it into the slave's cache as the slave long packet. After the slave receives the data sent by the host, it will move the data in the cache space to other memory space and send a positive response to the host. After the host receives the positive response from the slave, it will determine whether the remaining data is enough to fill the slave long packet. That is, it will determine whether the remaining unsent data in the data to be written received this time is enough to fill the target node's cache space. If it is enough, the host will repeatedly determine whether there is any remaining data. In other words, the host will repeatedly determine whether the remaining unsent data is enough to fill the target node's cache space in order to send the next slave long packet. If it is not enough, continue to compare with the total length to determine if it is the last long packet. If not, record and update the remaining data, and receive the N+1th long packet. If it is, send the remaining data, that is, send all the remaining unsent data. At this point, the data transmission of a complete flashing task is completed.

[0061] In one implementation, the master node is communicatively connected to a first gateway. The master node requests and receives data to be flashed from the first gateway, and the data to be flashed is sent to the master node by the first gateway. In this implementation, the master node is communicatively connected to a first gateway, and the data to be flashed is sent to the master node by the first gateway. The first gateway can be a diagnostic tool, but its specific functionality is not limited here.

[0062] In one implementation, the data to be written includes verification information; the step of the target node writing data according to the received data includes: the target node erases and writes the received data to the corresponding backup write address in memory according to the write address information in the received data; the target node verifies the data to be written according to the verification information; when the data to be written passes the verification, the target node erases and writes the data at the backup write address to the target write address.

[0063] After receiving the data to be flashed, the target node first erases and writes the received data to the backup flashing address in memory according to the flashing address information in the received data. Then, the target node verifies the received data according to the verification information in the data to be flashed. Only when the verification passes will the data in the backup flashing address be erased and written to the target flashing address. The target flashing address is the target storage address for this flashing task. For example, for a software upgrade, the target flashing address is the storage address of the software upgrade program. Specifically, the data to be flashed is part / all of the software upgrade package for the vehicle's electronic control unit.

[0064] During verification, algorithms such as Cyclic Redundancy Check (CRC), Hash, and RSA can be used. Verification information can be pre-stored on the master or slave node, or it can be carried by the data to be written. The specifics are not limited here.

[0065] In one implementation, the method further includes: when the data to be written fails the verification, the master node broadcasts a write failure message to all slave nodes; the slave nodes respond to the write failure message by not erasing the data of the backup write address to the target write address, so as to maintain the original version.

[0066] This implementation uses a rollback mechanism for data flashing. If the data to be flashed on any slave node fails verification, all data received by all slave nodes in this flashing operation will be rolled back to the original data. Specifically, in this implementation, if the data to be flashed on any slave node fails verification, the master node broadcasts a flashing failure message to all slave nodes. After receiving the flashing failure message, the slave nodes do not erase the data received at the backup flashing address to the target flashing address, thus maintaining the original data version.

[0067] Taking the host receiving the data to be flashed from the diagnostic tool as an example, Figure 6 The diagram shows the interaction between the diagnostic instrument, the host, and any one of the slave devices. Figure 7 The diagram shows a complete software upgrade process for the vehicle communication system. The following section will combine... Figure 6 and Figure 7 Explanation: When a software upgrade begins, the diagnostic tool sends a pre-programming request to the host computer, initiating a handshake to establish a communication connection between the two. The host computer responds, and both enter a programming request and response mode. Based on this, the host computer requests the diagnostic tool to download the first record segment, which is the first request to download the data to be written. Figure 5 The first long bump.

[0068] After receiving a record segment, the host determines whether it is a slave address, that is, whether the target node to be written to by the record segment is a slave node. If not, it means that it is a host address, that is, the target node to be written to by the record segment is a master node. If it is, it means that the target node to be written to by the record segment is a slave node.

[0069] If the address is a slave address, the master initiates a pre-programming request to the corresponding slave, performs a pre-programming handshake with the slave, establishes a communication connection between the master and the slave, and the slave enters programming mode. The master adaptively forwards data packets from the master based on the slave's buffer and executes actions such as... Figure 5 This shows the data transmission process of a complete flashing task.

[0070] During this process, the host records the slave devices that have downloaded the data. For each slave device that has downloaded the data, the host forwards the dependency verification to the corresponding slave device. That is, the slave device verifies the received data. If the slave device verifies the data successfully, the host that downloaded the data also performs the verification until all slave devices and the host have passed the verification. If any slave device or host fails the verification, the host broadcasts a message that the upgrade has failed. The slave devices that were upgraded then perform a rollback. That is, the recorded slave nodes respond to the flash failure message and do not erase the data of the backup flash address to the target flash address in order to maintain the original version.

[0071] For the corresponding method embodiments described above, see [link to relevant documentation]. Figure 8 The diagram illustrates a vehicle communication system, comprising a master node and at least one slave node, the master node being communicatively connected to the slave node. The master node is configured to: receive data to be flashed; identify at least one target node to which the data to be flashed is to be flashed, wherein the target node is either the master node or the slave node; when the target node to be flashed is a slave node, the master node is configured to: send the corresponding data to be flashed to the target node according to the target node's data receiving capability; the target node is configured to: flash the data based on the received data; when the target node to be flashed is a master node, the master node is configured to: flash the data based on the corresponding data to be flashed.

[0072] In the aforementioned vehicle communication system, the master node is responsible for receiving and distributing data, and can identify and write its own data. During the distribution process, it can also adapt to the data receiving capabilities of subordinate nodes for distribution, thereby improving the cooperation capabilities between nodes and enhancing the overall flexibility of the system.

[0073] Optionally, when the master node receives data to be written and identifies at least one target node to be written to the data to be written, the process includes: the master node receiving data to be written, wherein the data to be written includes writing address information; the master node segmenting the data to be written according to the writing address information to obtain at least one data segment, wherein the nodes to be written to the same data segment are the same; and the master node determining the nodes to be written to the data segment as the target nodes of the corresponding data segment.

[0074] Optionally, when the target node to be flashed is a slave node and the data to be flashed is to be sent to the target node according to the data receiving capability of the target node, the master node is used to: when the target node to be flashed is a slave node and the data to be flashed is to be sent to the target node in an adapted manner according to the bus protocol followed by the target node.

[0075] Optionally, the bus protocol is used to indicate the data throughput of the node; the master node is used to: adapt and send the corresponding data to be written to the target node according to the bus protocol followed by the target node, including: the master node is used to: split the corresponding data to be written into sub-packets adapted to the data throughput according to the data throughput of the target node and send them to the target node in sequence.

[0076] Optionally, when the master node is configured to split the corresponding data to be written into sub-packets adapted to the data throughput of the target node and send them sequentially to the target node, the master node is configured to: determine whether the remaining unsent data of the corresponding data to be written is sufficient to fill the cache space of the target node based on the data throughput of the target node; if sufficient, the master node is configured to: take data of the size of the cache space from the remaining unsent data and send it to the target node, and repeatedly determine whether the remaining unsent data is sufficient to fill the cache space of the target node; if insufficient, the master node is configured to: determine whether the remaining unsent data is the last sub-packet based on the total size of the corresponding data to be written; if it is the last sub-packet, the master node is configured to: send all the remaining unsent data.

[0077] Optionally, if it is not the last sub-packet, the master node is used to: continue to request and receive data to be flushed in the size of the pre-allocated, specified size of the flush cache space.

[0078] Optionally, the master node is communicatively connected to the first gateway, and the master node is used to: request and receive the data to be flashed from the first gateway, wherein the data to be flashed is sent from the first gateway to the master node.

[0079] Optionally, the data to be written includes verification information; the target node is used to: when writing data based on the received data, include: the target node is used to: erase and write the received data to the corresponding backup write address in memory according to the write address information in the received data; verify the data to be written according to the verification information; when the data to be written passes the verification, the target node is used to: erase and write the data at the backup write address to the target write address.

[0080] Optionally, when the data to be written fails the verification, the master node is used to: broadcast a write failure message to all slave nodes; the slave nodes are used to: respond to the write failure message and not erase the data of the backup write address to the target write address, so as to maintain the original version.

[0081] This embodiment also provides an electronic device, including a processor and a memory. The memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the above-described vehicle communication method. This electronic device can be a server or a terminal device.

[0082] See Figure 9 As shown, the electronic device includes a processor 100 and a memory 101. The memory 101 stores machine-executable instructions that can be executed by the processor 100. The processor 100 executes the machine-executable instructions to implement the above-described vehicle communication method.

[0083] Furthermore, Figure 9 The electronic device shown also includes a bus 102 and a communication interface 103, with the processor 100, the communication interface 103 and the memory 101 connected via the bus 102.

[0084] The memory 101 may include high-speed random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 103 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc. The bus 102 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 9 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0085] The processor 100 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 100 or by instructions in software form. The processor 100 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this disclosure. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this disclosure can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a readily available storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 101, and the processor 100 reads the information from memory 101 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.

[0086] This embodiment also provides a computer-readable storage medium storing computer-executable instructions. When the computer-executable instructions are invoked and executed by a processor, the computer-executable instructions cause the processor to implement the above-described vehicle communication method.

[0087] The computer program products of the vehicle communication method, system, electronic device and storage medium provided in the embodiments of this disclosure include a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments. For specific implementation, please refer to the method embodiments, which will not be repeated here.

[0088] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system and apparatus described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0089] Furthermore, in the description of the embodiments of this disclosure, unless otherwise expressly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this disclosure based on the specific circumstances.

[0090] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0091] In the description of this disclosure, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, and are only for the convenience of describing this disclosure and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this disclosure. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0092] Finally, it should be noted that the above embodiments are merely specific implementations of this disclosure, used to illustrate the technical solutions of this disclosure, and not to limit it. The protection scope of this disclosure is not limited thereto. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this disclosure. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this disclosure, and should all be covered within the protection scope of this disclosure. Therefore, the protection scope of this disclosure should be determined by the protection scope of the claims.

Claims

1. A method for vehicle communication, characterized in that, Applied to a vehicle communication system, the vehicle communication system comprising: a master node and at least one slave node, the master node being communicatively connected to the slave node, the method comprising: The master node receives the data to be written and identifies at least one target node to which the data to be written is to be written, wherein the target node is the master node or the slave node; When the target node to be written is a slave node, the master node sends the corresponding data to be written to the target node according to the data receiving capability of the target node, and the target node performs data writing according to the received data. When the target node to be written is the master node and the data to be written is to be written, the master node performs data writing according to the corresponding data to be written.

2. The method according to claim 1, characterized in that, The steps of the master node receiving the data to be written and identifying at least one target node to which the data is to be written include: The master node receives the data to be written, wherein the data to be written includes the writing address information; The master node segments the data to be written according to the writing address information to obtain at least one data segment, wherein the node to be written for the same data segment is the same. The master node determines the node to be written to the data segment as the target node of the corresponding data segment.

3. The method according to claim 1, characterized in that, When the target node to be written is a slave node, the step of the master node sending the corresponding data to be written to the target node according to the data receiving capability of the target node includes: When the target node to be flashed is a slave node and the data to be flashed is to be flashed, the master node adapts and sends the corresponding data to be flashed to the target node according to the bus protocol followed by the target node.

4. The method according to claim 3, characterized in that, The bus protocol is used to indicate the data throughput of a node; The step of the master node adapting and sending the corresponding data to be written to the target node according to the bus protocol followed by the target node includes: The master node splits the corresponding data to be written into sub-packets adapted to the data throughput of the target node and sends them to the target node in sequence.

5. The method according to claim 4, characterized in that, The step of the master node splitting the corresponding data to be written into sub-packets adapted to the data throughput of the target node and sending them sequentially to the target node includes: The master node determines, based on the data throughput of the target node, whether the remaining unsent data corresponding to the data to be written is sufficient to fill the cache space of the target node; If sufficient, the master node takes data of the size of the cache space from the remaining unsent data and sends it to the target node, and repeatedly checks whether the remaining unsent data is sufficient to fill the cache space of the target node; If not enough, the master node determines whether the remaining unsent data is the last sub-packet based on the total size of the corresponding data to be written; If it is the last sub-packet, then the master node sends all remaining unsent data.

6. The method according to claim 5, characterized in that, The method further includes: If it is not the last sub-packet, the master node continues to request and receive data to be written based on the pre-allocated, specified size of the write cache space.

7. The method according to claim 1, characterized in that, The master node is communicatively connected to the first gateway. The master node requests and receives the data to be written from the first gateway. The data to be written is sent to the master node by the first gateway.

8. The method according to claim 1, characterized in that, The data to be written includes verification information; The steps for the target node to flush data based on the received data include: The target node erases and writes the received data to the corresponding backup write address in memory according to the write address information in the received data; The target node verifies the data to be written based on the verification information; When the data to be written passes the verification, the target node erases and writes the data from the backup write address to the target write address.

9. The method according to claim 8, characterized in that, The method further includes: When the data to be written fails the verification, the master node broadcasts a write failure message to all slave nodes; The slave node responds to the flash failure message by not erasing the data of the backup flash address to the target flash address, in order to maintain the original version.

10. A vehicle communication system, characterized in that, The system includes: a master node and at least one slave node, wherein the master node and the slave node are communicatively connected. The master node is used to: receive data to be written and identify at least one target node to which the data to be written is to be written, wherein the target node is the master node or the slave node; When the target node to be written is a slave node and the data to be written is to be written, the master node is used to: send the corresponding data to be written to the target node according to the data receiving capability of the target node, and the target node is used to: perform data writing according to the received data; When the target node to be written is the master node and the data to be written is to be written, the master node is used to: write data according to the corresponding data to be written.