Message forwarding method, system, device, medium, program product and vehicle
By adding data processing and verification information to the CAN message, a second message is generated for verification by the receiver, the problem of high error rate in traditional CAN message transmission is solved, and more accurate and efficient data transmission is achieved.
Patent Information
- Application Number
- CN202510400276.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2025-08-12
AI Technical Summary
In vehicle network communication, traditional CAN packet transmission based on AUTOSAR architecture is prone to data error reception and loss, resulting in a high packet transmission error rate.
By processing data on the CAN message to be forwarded, a second message including verification information and part of the information is generated and sent to the message receiver for data verification, specifically including verification means such as adding a timestamp and verification code.
It reduces the error rate of packet transmission, improves the accuracy and transmission efficiency of data reception, and reduces data loss and delay.
Smart Images

Figure CN120475042A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of in-vehicle network communications, and in particular to a message forwarding method, system, device, medium, program product and vehicle. Background Art
[0002] At present, with the increasing size of in-vehicle network communications, the number of traditional messages of the Controller Area Network (CAN) control communication protocol based on the Automotive Open System Architecture (AUTOSAR) is increasing, which is prone to data reception errors and data loss, resulting in a high message transmission error rate. Summary of the Invention
[0003] The embodiments of the present application provide a message forwarding method, system, device, medium, program product and vehicle, which aim to reduce the message transmission error rate and at least partially solve the above-mentioned technical problems.
[0004] To achieve the above-mentioned object, according to a first aspect of the present application, a message forwarding method is provided, the message forwarding method comprising:
[0005] Performing data processing on the first message to be forwarded to obtain a second message, where the second message includes verification information generated based on the first message and at least part of the information of the first message;
[0006] The second message is sent to a message receiver, so that the message receiver performs data verification based on the second message.
[0007] According to a second aspect of the present application, there is provided an electronic device, comprising:
[0008] a processing module, configured to perform data processing on the first message to be forwarded to obtain a second message, where the second message includes verification information generated based on the first message and at least part of the information of the first message;
[0009] A sending module is used to send the second message to a message receiver, so that the message receiver performs data verification based on the second message.
[0010] According to the third aspect of the present application, an electronic device is also provided, including a processor, the processor is connected to a memory, the memory stores a computer program, and the processor is used to run the computer program in the memory to execute any of the above-mentioned message forwarding methods.
[0011] According to a fourth aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, any of the above-mentioned message forwarding methods is implemented.
[0012] According to a fifth aspect of the present application, a computer program product is provided, which includes a computer program, and the computer program is executed by a processor to implement any of the above-mentioned message forwarding methods.
[0013] According to a sixth aspect of the present application, a vehicle is provided, which executes the message forwarding method described above, or includes the electronic device or electronic equipment described above.
[0014] To sum up, in the embodiment of the present application, through the above-mentioned technical solution, data processing is performed on the first message to be forwarded to obtain a second message including verification information generated based on the first message and at least part of the information of the first message. When the second message is sent to the message receiver, it is convenient for the message receiver to perform data verification based on the second message to ensure the accuracy of the message it receives, and the error rate of message transmission can be reduced.
[0015] Other features and advantages of the present application will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] To more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present application. Those skilled in the art can also derive other drawings based on these drawings without inventive effort.
[0017] In order to more completely understand the present application and its beneficial effects, the following description will be given in conjunction with the accompanying drawings, wherein the same drawing numbers represent the same parts in the following description.
[0018] Figure 1 This is a flow chart of an embodiment of a message forwarding method provided in an embodiment of the present invention;
[0019] Figure 2 Schematic diagram of the message forwarding process provided in an embodiment of the present invention;
[0020] Figure 3 Schematic diagram of the structure of the message forwarding module provided in an embodiment of the present invention;
[0021] Figure 4 is a schematic diagram of a vehicle open system provided in an embodiment of the present invention;
[0022] Figure 5is a schematic structural diagram of an electronic device provided in an embodiment of the present invention;
[0023] Figure 6 2 is a schematic structural diagram of an electronic device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0024] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the embodiments described are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0025] Based on the problems mentioned in the above background technology, the number of traditional messages is increasing, and data erroneous reception and data loss are prone to occur, resulting in a high message transmission error rate.
[0026] Specifically, under the premise of limited hardware resources, if the CAN messages that are not directly connected are obtained and the recipient of the forwarded messages has specific requirements, but the forwarded messages cannot be screened and classified, it will bring a lot of useless load to the recipient; under the premise that the number and frequency of messages increase, if the forwarded messages are not complete and correct, the risk of receiving erroneous data and data loss will increase; if parallel sending channels cannot be supported, a large amount of data generated at the same time will be delayed in sending, and timeliness cannot be guaranteed; in addition, the single field in the reorganized data is not conducive to the message receiver to analyze and troubleshoot problems.
[0027] In order to solve the above problems, the embodiments of the present application propose a message forwarding method, system, device, medium, program product and vehicle. The second message sent to the message recipient by the embodiments of the present application includes verification information generated based on the first message, and a second message containing at least part of the information of the first message. This can facilitate the message recipient to perform data verification based on the second message to ensure the accuracy of the message it receives, and can reduce the error rate of message transmission.
[0028] Specifically, the embodiments of the present application verify the integrity and correctness of forwarded messages, thereby reducing the risk of receiving erroneous data and data loss. During the forwarding process, CAN messages are screened and classified, filtering only valid data. The filtered data is then sent through multiple channels via the data forwarding module, thereby reducing unnecessary data transmission, lowering system load, and increasing forwarding timeliness. Timestamps are added to the reconstructed forwarded data, and the message receiver can use this information for, for example, link timeliness and stability analysis.
[0029] The message forwarding method in this application can be applied to vehicles, and the execution subject of the message forwarding method can be a vehicle, such as a car, an electric car, a hybrid car, etc. The following takes the execution subject of the message forwarding method as an example of a vehicle to explain each embodiment in detail.
[0030] This application provides a message forwarding method, please refer to Figure 1 The message forwarding method provided in the embodiment of the present application includes steps S10 to S20, which are described in detail below.
[0031] S10. Process the first message to be forwarded to obtain a second message, where the second message includes verification information generated based on the first message and at least part of the information of the first message;
[0032] In this embodiment, the communication layer (COM layer) in the vehicle's AUTOSAR can obtain CAN messages that need to be forwarded at a certain moment. These messages can serve as first messages. There can be one or more first messages to be forwarded. Data processing is performed on the forwarded first messages, including verification processing and timestamp addition, so that the second message includes verification information generated based on the first message and at least part of the information of the first message.
[0033] S20. Send the second message to a message receiver, so that the message receiver performs data verification based on the second message.
[0034] In this embodiment, the second message is sent to the message receiver so that the message receiver can extract at least part of the information of the first message and verification information generated based on the first message based on the second message, and perform data verification based on the verification information and at least part of the information of the first message to verify the integrity, timeliness, etc. of the first message, thereby ensuring that the message is accurately transmitted to the message receiver.
[0035] In the technical solution disclosed in this embodiment, data processing is performed on the first message to be forwarded to obtain a second message, which includes verification information generated based on the first message and at least part of the information of the first message. The second message is sent to the message receiver so that the message receiver performs data verification based on the second message. This can facilitate the message receiver to perform data verification based on the second message to ensure the accuracy of the message it receives, and can reduce the error rate of message transmission.
[0036] In one embodiment, the verification information includes at least one of the following:
[0037] a first timestamp for indicating a time at which the first message was received;
[0038] a second timestamp for indicating a sending time of the second message;
[0039] A check code generated based on the first message.
[0040] In this embodiment, the verification information includes at least one of a first timestamp indicating the time the first message was received, a second timestamp indicating the time the second message was sent, and a check code generated based on the first message. The first timestamp is a timestamp indicating the time the first message was received. This first timestamp can be a first message sent by the bus that needs to be forwarded, i.e., generated upon receipt of the first message. The second timestamp is a timestamp indicating the time the first message was sent to the message recipient after data processing and conversion to the second message. It is understood that due to data processing, the time the first message was sent and the time the second message was sent are not necessarily the same. The first timestamp and / or the second timestamp are added to the second message and sent to the message recipient. The message recipient can use the first timestamp and / or the second timestamp to analyze link timeliness and stability, etc. The check code is generated based on the first message. The content of the check code is related to the first message. The message recipient can use the check code to verify the integrity and correctness of at least part of the information of the first message included in the second message, thereby reducing the risk of erroneous message reception and message data loss.
[0041] In one embodiment, the verification information includes a check code, and the data processing of the first message to be forwarded to obtain the second message includes:
[0042] Performing a check calculation based on the first message to be forwarded to obtain the check code;
[0043] Based on the verification code, a second message corresponding to the first message is generated.
[0044] In this embodiment, a checksum calculation can be performed on the first message to be forwarded to obtain a checksum. The checksum algorithm can be a CRC32 (Cyclic Redundancy Check 32) algorithm, which is a data integrity check algorithm that verifies whether errors or corruption occurred during data transmission or storage by calculating a 32-bit checksum value. Using the CRC32 algorithm, a checksum is calculated based on at least a portion of the information in the first message to be added to the second message, resulting in a 32-bit checksum. This checksum is then inserted into a data segment containing at least a portion of the information in the first message to generate a second message corresponding to the first message. After receiving the second message with the checksum, the message receiver can use the same checksum algorithm to perform a checksum calculation based on at least a portion of the information in the first message contained in the second message to obtain a new checksum. This new checksum is then compared with the checksum in the second message to verify the integrity of at least a portion of the information in the received first message, thereby ensuring the integrity and accuracy of the data segment.
[0045] In one embodiment, performing a check calculation based on the first message to be forwarded to obtain the check code includes:
[0046] Reassembling the first message to be forwarded to obtain a reassembled message;
[0047] Performing a checksum calculation on the reassembled message to obtain the checksum.
[0048] In this embodiment, the first message may consist of one or more messages. The received first message is reassembled according to a protocol pre-agreed between the sender and receiver. This reassembly aims to merge multiple first messages to address the forwarding difficulties caused by multiple messages being simultaneously received during high concurrency based on the AUTOSAR architecture. It can also include formatting the first message into a format that the message receiver can parse and read, enabling the second message to be parsed. After reassembling the first message, a reassembled message is generated, and a checksum calculation is performed on the reassembled message to generate a checksum. This checksum can then verify the integrity and correctness of more data.
[0049] In one embodiment, generating a second message corresponding to the first message based on the check code includes:
[0050] Generate the second message according to the check code and the reassembled message.
[0051] In this embodiment, a second message can be obtained by splicing the reassembled message with the check code generated based on the reassembled message. In this way, the second message can contain the reassembled message, which also contains at least part of the information of the first message, and also contains the check code, which can be used to verify the integrity of the reassembled message.
[0052] In one embodiment, the verification information further includes a first timestamp, and the first timestamp is in the reassembled message.
[0053] In this embodiment, the verification information includes a first timestamp. When the first message is received, the first timestamp can be generated. During reassembly, the first timestamp can be added to the reassembled message so that the first timestamp is in the reassembled message. In this way, the first timestamp generated in real time is more accurate. Subsequently, verification calculations can be performed based on the first timestamp and the first message, which can further improve the effectiveness of data verification.
[0054] In one embodiment, the verification information further includes a second timestamp, and generating the second message according to the check code and the reassembled message includes:
[0055] The second message is generated based on the check code, the reassembled message and the second timestamp.
[0056] In this embodiment, the second timestamp can be obtained by determining the transmission time of the second message. In some embodiments, when determining to transmit the message to the message recipient, the real-time time can be determined as the transmission time of the second message to obtain the second timestamp. Combining the check code, the reassembled message, and the second timestamp to generate the second message allows for greater flexibility in the composition of the second message, resolving issues in traditional forwarding methods where timestamps are not recorded, thereby increasing the risk of uncontrollable data delays at the message recipient and the risk of unreliable data on the bus due to the lack of verification of data integrity and accuracy by a data verification module.
[0057] In one embodiment, the second message further includes at least one of a data header, the number of the first messages, a hardware channel number, a message identifier, and a data length.
[0058] In this embodiment, the second message includes at least one of a data header, a first timestamp, a second timestamp, the number of first messages, a hardware channel number, a message identifier, a data length and the first message (which may be the message data of the first message).
[0059] In one embodiment, when the second message includes a data header, the check code is set in the data header, so that the data receiver can preferentially obtain the check code from the data header to complete the check.
[0060] In some embodiments, after processing the first message, the second message containing the above data is obtained, which is more versatile and flexible. An example is used below to illustrate:
[0061] Taking the example of the first message being two CAN2.0 messages, if two CAN messages to be forwarded are obtained:
[0062] CAN0 message 1: ID 0x123, data: 0xAA 0xBB 0xCC 0xDD 0xEE 0xFF 0xFF 0xFF;
[0063] CAN0 message 2: ID 0x456, data: 0xFF 0xFF 0xFF 0xEE 0xDD 0xCC 0xBB 0xAA;
[0064] After data processing, the second message forwarded should conform to the following format:
[0065] Data header (E2E Header) + first timestamp t1 when the CAN message is obtained + second timestamp t2 when the CAN message is sent + number of CAN messages contained in the second message + (hardware channel number of the CAN message + CAN message identifier (CANID) + CAN message data length + CAN message data) * N, that is:
[0066] E2E Header (12 bytes) + first timestamp t1 (10 bytes) of the time when the CAN message is obtained + second timestamp t2 (10 bytes) of the time when the CAN message is sent + 0x00, 0x02 (number of CAN messages) 0x00 (hardware channel number) + 0x00, 0x00, 0x01, 0x23 (CANID) + 0x08 (CAN message data length) + 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0xFF, 0xFF (message data of the first message) + 0x00 (hardware channel number) + 0x00, 0x00, 0x04, 0x56 (CANID) + 0x08 (CAN message data length) + 0xFF, 0xFF, 0xFF, 0xEE, 0xDD, 0xCC, 0xBB, 0xAA (data).
[0067] In one embodiment, sending the second message to the message receiver includes:
[0068] The second message is sent to the message receiver through a target transmission channel corresponding to the second message.
[0069] In this embodiment, when multiple second messages are to be forwarded, multiple transmission channels can be used for parallel transmission. A target transmission channel corresponding to the second message is determined from the multiple transmission channels, and the second message is transmitted through this target transmission channel. The receiver, based on its needs, selects the transmission channel corresponding to the desired message to receive. This enables parallel transmission of messages and offloads forwarding, reducing the data load associated with traditional methods of sending all data to the bus and significantly improving transmission efficiency.
[0070] In one embodiment, before sending the second message to the message receiver through the target transmission channel corresponding to the second message, the method further includes:
[0071] Determining a target transmission channel corresponding to the second message based on the message identifier of the second message and a preset mapping relationship;
[0072] The preset mapping relationship includes a mapping relationship between a preset message identifier and a transmission channel.
[0073] In this embodiment, the target transmission channel corresponding to the second message can be determined based on the message identifier of the second message and a preset mapping relationship. The preset mapping relationship includes at least one preset mapping relationship between a preset message identifier and a transmission channel. The preset mapping relationship is a transmission rule pre-agreed upon by the message forwarder and the message receiver. Both parties have the preset mapping relationship. For the message forwarder, the target transmission channel corresponding to each second message to be forwarded can be determined based on the preset mapping relationship for transmission. For the message receiver, the target transmission channel can be determined based on the preset mapping relationship for transmission of the message it needs to receive, thereby selectively receiving the target transmission channel corresponding to the message it needs to receive for data reception, so as to only receive messages that meet its needs, thereby improving the diversion and targeting of data forwarding.
[0074] In some embodiments, each transmission channel may correspond to one or more preset message identifiers. The preset message identifiers corresponding to each transmission channel are not exactly the same and are set according to specific needs.
[0075] In some embodiments, the transmission channel corresponding to the second message may be the same as the transmission channel corresponding to the first message.
[0076] In this embodiment, the first message may include a message identifier of the first message, and the transmission channel corresponding to the first message can be determined through a preset mapping relationship. After the first message is reorganized and processed, the target transmission channel corresponding to the message identifier contained in the second message obtained can be the same as the transmission channel corresponding to the first message, so that when the first message is received, it can be accurately transmitted to its corresponding transmission channel through the second message, thereby improving forwarding efficiency.
[0077] In one embodiment, the sending of the second message to the message receiver through a target transmission channel corresponding to the second message includes:
[0078] Broadcasting subscribeable events of the target transmission channel;
[0079] In case of receiving a subscription instruction from the message receiver for the subscribable event, the second message is sent to the message receiver through the target transmission channel.
[0080] In this embodiment, the reassembled message obtained by reassembling the first message can be stored in the data cache space, and the subscribeable event of the target transmission channel corresponding to the second message can be broadcast. In the case of multiple transmission channels, multiple event groups of subscribeable events can be broadcast to provide different subscription services. The message receiver can subscribe to at least one subscribeable event in the event group according to the broadcasted subscribeable event group and its needs, and send a subscription instruction. When receiving the subscription instruction for the subscribeable event from the message receiver, the message forwarder can read the reassembled message from the data cache space, perform a verification algorithm to obtain a verification code, and add the verification code and the second timestamp to the reassembled message to obtain a second message, and send the second message to the message receiver that subscribes to the subscribeable event through the target transmission channel corresponding to the subscribeable event. A transmission channel can connect to multiple message receivers. After the message receiver subscribes to the subscribeable event corresponding to the transmission channel according to its needs, it can receive the corresponding message. By setting the subscription event, the technical requirements of one-to-many characteristics can be met, and the application scenarios of message forwarding can be improved.
[0081] In some embodiments, the first message can be forwarded based on the SOME / IP communication protocol. Through the event group supported by the SOME / IP communication protocol, 1 to n SOME / IP broadcast messages are provided for one or more message recipients to subscribe to. By subscribing to an event in the SOME / IP event group, the transmission of the specified channel is realized, the data load on the bus is reduced, and the transmission efficiency is improved.
[0082] According to calculations, a frame of SOME / IP data at a certain moment can contain the forwarding support of 200 frames of CAN2.0 messages.
[0083] In one embodiment, before performing data processing on the first message to be forwarded to obtain the second message, the method further includes:
[0084] At least two messages with the same receiving time are determined from the received messages to obtain the first message to be forwarded.
[0085] In this embodiment, at least two messages received from a COM layer module or the like are determined as first messages. This allows the second message to transmit data corresponding to at least two first messages, and all messages are forwarded at the same time, thereby improving the consistency of information contained in the second message and enhancing forwarding efficiency.
[0086] In one embodiment, determining at least two messages with the same reception time from the received messages to obtain the first message to be forwarded includes:
[0087] At least two messages with the same receiving time and the same transmission channel are determined from the received messages to obtain the first message to be forwarded.
[0088] In this embodiment, in addition to having the same reception time, at least two messages that can serve as the first message must also meet reassembly conditions. These reassembly conditions may include requirements-based conditions and also include the messages corresponding to the same transmission channel. This allows the second message to be transmitted over the same transmission channel as the first message, thus reducing the load on the transmission channel and improving transmission efficiency.
[0089] In one embodiment, before processing the first message to be forwarded to obtain the second message, the method further includes:
[0090] At least two messages with the same transmission channel are determined from the received messages to obtain the first message to be forwarded.
[0091] In this embodiment, at least two messages with the same transmission channel are used as the first message, and are subsequently reassembled to obtain the second message, so that the transmission channel of the first message corresponding to the second message is unified, and the second message only needs to be transmitted through one transmission channel, which further reduces the transmission channel load and improves the transmission efficiency.
[0092] In some embodiments, the message forwarding method is applied to the application software layer of the vehicle open system architecture.
[0093] In this embodiment, the message forwarding method can be specifically applied to the application software layer (ASW layer) of the vehicle AUTOSAR architecture. The message forwarding method is applied to specific callback functions and the ASW layer that can be modified in the AUTOSAR architecture without affecting the original architecture. It can be ported, tailored, and adapted in software that complies with the AUTOSAR architecture.
[0094] For a better understanding, the following is explained with a specific example. Figure 2 :
[0095] In the AUTOSAR architecture, received CAN messages that need to be forwarded are typically one or more. The COM layer module in AUTOSAR can capture these CAN messages at a specific moment and obtain the first timestamp t1. According to the pre-agreed protocol, the captured CAN messages are assigned a transmission channel based on the configured CAN ID and reassembled into a format that the message receiver can parse and read. The reassembled messages are then placed in the data buffer for subsequent processing. Based on the multi-transmission channel forwarding mechanism, the target transmission channel for one or more reassembled messages is determined. Through the event groups supported by the SOME / IP communication protocol, one to n SOME / IP broadcast messages are provided for subscription by the receiver. By subscribing to an event in the SOME / IP event group, transmission is achieved on the specified channel. After receiving the subscription instruction, the corresponding reassembled message is extracted from the target transmission channel selected by the subscription instruction and from the data cache space, and a check code is calculated to obtain the check code. The check code and the second timestamp t2 are added to the reassembled message to obtain the second message, and the second message is sent to the subscribed message receiver through the target transmission channel. The message receiver extracts the second message to obtain a forwarded CAN message, and performs data verification on it through the check code, the first timestamp t1 and the second timestamp t2 to verify the integrity and timeliness of the CAN message.
[0096] In one example, a message forwarding module is provided to perform the above steps, referring to Figure 3 The message forwarding module includes: a CAN message acquisition module 201, configured to acquire CAN forwarding messages at a specific moment; a CAN data reassembly module 202, configured to reassemble one or more CAN forwarding messages from the CAN message acquisition module 201 according to a mutually agreed-upon protocol to obtain a reassembled message; a data allocation and verification module 203, configured to allocate corresponding transmission channels to the reassembled messages and to verify data integrity and correctness; and a SOME / IP data forwarding module 204, configured to transmit the verified data from the data allocation and verification module 203 via a target transmission channel among multiple transmission channels determined based on the SOME / IP communication protocol.
[0097] In one example, the module that performs the above steps is in the ASW layer in the AUTOSAR architecture, such as Figure 4As shown, the vehicle's AUTOSAR architecture can include a COM module and a SOME / IP module. CAN messages received from the CAN hardware driver (CAN Driver) that need to be forwarded are distributed to the router (PDUR) via the CAN interface (CAN IF), and then distributed from the PDUR to the COM module. A CAN message acquisition module 201 is incorporated into the COM module to acquire the CAN messages to be forwarded. The CAN messages transmitted by the COM module are then timestamped, reassembled, verified, and a second time stamped to generate a second message. Based on the second message, the corresponding target SOME / IP channel is selected and forwarded via the SOME / IP data forwarding module 204, the Ethernet interface (ETHIF), and the Ethernet hardware driver (ETH Driver). Simultaneously, the message receiver receives the forwarded data through the ETH Driver and, using pre-agreed rules, subscribes to different SOME / IP events provided by the sender, receiving only the SOME / IP messages that correspond to the desired second message, thus filtering the data.
[0098] Based on the above embodiment, this embodiment further provides a message forwarding system, which includes: a data processing module, configured to process a first message to be forwarded to obtain a second message, wherein the second message includes verification information generated based on the first message and at least part of the information of the first message;
[0099] A data forwarding module, which may be any of the above-mentioned SOME / IP data forwarding modules, is configured to send the second message to a message receiver, so that the message receiver performs data verification based on the second message.
[0100] In one embodiment, the data processing module includes:
[0101] A message acquisition module, which may be any of the above-mentioned CAN message acquisition modules, is configured to acquire the first message to be forwarded;
[0102] A data reassembly module, which may be any of the above-mentioned CAN data reassembly modules, is configured to reassemble the first message to be forwarded to obtain a reassembled message;
[0103] A data distribution and verification module, which may be any of the above-mentioned data distribution and verification modules, is configured to perform verification calculations on the reassembled message to obtain a verification code, and generate a second message corresponding to the first message based on the verification code.
[0104] In one embodiment, the data allocation and verification module further determines the target transmission channel corresponding to the second message based on the message identifier of the second message and a preset mapping relationship; wherein the preset mapping relationship includes a mapping relationship between a preset message identifier and a transmission channel.
[0105] In one embodiment, the data forwarding module is further configured to broadcast a subscribable event of the target transmission channel, and upon receiving a subscription instruction from the message recipient for the subscribable event, send the second message to the message recipient via the target transmission channel.
[0106] In some embodiments, any of the above-mentioned message forwarding systems is set in the application software layer of the vehicle open system architecture to facilitate program coding and data debugging.
[0107] The specific implementation of each of the above modules can be found in the previous embodiments and will not be described again here.
[0108] This embodiment also provides an electronic device, which can be integrated into a vehicle, for example, Figure 5 As shown, the electronic device may include:
[0109] A processing module 1001 is configured to perform data processing on a first message to be forwarded to obtain a second message, where the second message includes verification information generated based on the first message and at least part of the information of the first message;
[0110] The sending module 1002 is used to send the second message to a message receiver, so that the message receiver performs data verification based on the second message.
[0111] Optionally, the verification information includes at least one of the following:
[0112] a first timestamp for indicating a time at which the first message was received;
[0113] a second timestamp for indicating a sending time of the second message;
[0114] A check code generated based on the first message.
[0115] Optionally, the verification information includes a check code, and the processing module 1001 is further configured to:
[0116] Performing a check calculation based on the first message to be forwarded to obtain the check code;
[0117] Based on the verification code, a second message corresponding to the first message is generated.
[0118] Optionally, the processing module 1001 is further configured to:
[0119] Reassembling the first message to be forwarded to obtain a reassembled message;
[0120] Performing a checksum calculation on the reassembled message to obtain the checksum.
[0121] Optionally, the generating, based on the check code, a second message corresponding to the first message includes:
[0122] Generate the second message according to the check code and the reassembled message.
[0123] Optionally, the verification information further includes a first timestamp, and the first timestamp is in the reassembled message.
[0124] Optionally, the verification information further includes a second timestamp. The processing module 1001 is further configured to:
[0125] The second message is generated based on the check code, the reassembled message and the second timestamp.
[0126] Optionally, the second message further includes at least one of a data header, the number of the first messages, a hardware channel number, a message identifier and a data length.
[0127] Optionally, the second message includes a data header, and the check code is set in the data header.
[0128] Optionally, the sending module 1002 is further configured to send the second message to the message receiver through a target transmission channel corresponding to the second message.
[0129] Optionally, the sending module 1002 is further configured to determine the target transmission channel corresponding to the second message from multiple transmission channels before sending the second message to the message receiver through the target transmission channel corresponding to the second message.
[0130] Optionally, the sending module 1002 is further configured to:
[0131] Determining a target transmission channel corresponding to the second message based on the message identifier of the second message and a preset mapping relationship;
[0132] The preset mapping relationship includes a mapping relationship between a preset message identifier and a transmission channel.
[0133] Optionally, the sending module 1002 is further configured to:
[0134] Broadcasting subscribeable events of the target transmission channel;
[0135] In case of receiving a subscription instruction from the message receiver for the subscribable event, the second message is sent to the message receiver through the target transmission channel.
[0136] Optionally, the processing module 1001 is further configured to:
[0137] At least two messages with the same receiving time are determined from the received messages to obtain the first message to be forwarded.
[0138] Optionally, the processing module 1001 is further configured to:
[0139] At least two messages with the same receiving time and the same transmission channel are determined from the received messages to obtain the first message to be forwarded.
[0140] Optionally, the processing module 1001 is further configured to:
[0141] At least two messages with the same transmission channel are determined from the received messages to obtain the first message to be forwarded.
[0142] Optionally, the processing module 1001 is further configured to:
[0143] At least two messages with the same transmission channel are determined from the received messages to obtain the first message to be forwarded.
[0144] Optionally, the message forwarding method is applied to the application software layer of the vehicle open system architecture.
[0145] This embodiment performs data processing on the first message to be forwarded to obtain a second message including verification information generated based on the first message and at least part of the information of the first message. When sending the second message to the message receiver, it is convenient for the message receiver to perform data verification based on the second message to ensure the accuracy of the message it receives, and can reduce the error rate of message transmission.
[0146] The specific implementation of the above operations can be found in the previous embodiments and will not be repeated here.
[0147] Accordingly, an embodiment of the present application further provides an electronic device, such as Figure 6 As shown, Figure 6Schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 1100 also includes a processor 1101 having one or more processing cores, a memory 1102 having one or more computer-readable storage media, and a computer program stored on the memory 1102 and executable on the processor. The processor 1101 is electrically connected to the memory 1102. Those skilled in the art will understand that the electronic device structure shown in the figure does not constitute a limitation of the electronic device, and may include more or fewer components than shown, or combine certain components, or arrange the components differently.
[0148] The processor 1101 is the control center of the electronic device 1100. It uses various interfaces and lines to connect the various parts of the entire electronic device 1100. By running or loading software programs and / or units stored in the memory 1102 and calling data stored in the memory 1102, it executes various functions of the electronic device 1100 and processes data, thereby monitoring the electronic device 1100 as a whole. The processor 1101 can be a processor (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU), a network processor (Network Processor, NP), etc., and can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of this application.
[0149] In the embodiment of the present application, the processor 1101 in the electronic device 1100 loads instructions corresponding to one or more application processes into the memory 1102 according to the following steps, and the processor 1101 runs the application stored in the memory 1102 to implement various functions, such as:
[0150] Performing data processing on the first message to be forwarded to obtain a second message, where the second message includes verification information generated based on the first message and at least part of the information of the first message;
[0151] The second message is sent to a message receiver, so that the message receiver performs data verification based on the second message.
[0152] The specific implementation of the above operations can be found in the previous embodiments and will not be repeated here.
[0153] Optional, such as Figure 6As shown, the electronic device 1100 further includes: a touch screen 1103, a radio frequency circuit 1104, an audio circuit 1105, an input unit 1106, and a power supply 1107. Among them, the processor 1101 is electrically connected to the touch screen 1103, the radio frequency circuit 1104, the audio circuit 1105, the input unit 1106, and the power supply 1107 respectively. Those skilled in the art will understand that Figure 6 The electronic device structure shown in the figure does not constitute a limitation to the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0154] The touch display screen 1103 can be used to display a graphical user interface and receive operation instructions generated by the user acting on the graphical user interface. The touch display screen 1103 may include a display panel and a touch panel. Among them, the display panel can be used to display information input by the user or information provided to the user and various graphical user interfaces of the electronic device, and these graphical user interfaces can be composed of graphics, text, icons, videos and any combination thereof. Optionally, the display panel can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. The touch panel can be used to collect the user's touch operation on or near it (such as the user uses any suitable object or accessory such as a finger, a stylus, etc. on the touch panel or near the touch panel) and generate corresponding operation instructions, and the operation instructions execute the corresponding program. Optionally, the touch panel may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch direction, detects the signal caused by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into touch point coordinates, and then sends it to the processor 1101, and can receive commands sent by the processor 1101 and execute them. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it is transmitted to the processor 1101 to determine the type of touch event. The processor 1101 then provides a corresponding visual output on the display panel according to the type of touch event. In an embodiment of the present invention, the touch panel and the display panel can be integrated into the touch display screen 1103 to realize input and output functions. However, in some embodiments, the touch panel and the touch panel can be used as two independent components to realize input and output functions. That is, the touch display screen 1103 can also be used as part of the input unit 1106 to realize the input function.
[0155] The radio frequency circuit 1104 may be used to transmit and receive radio frequency signals, thereby establishing wireless communication with network medical devices or other electronic devices through wireless communication, and transmitting and receiving signals between network medical devices or other electronic devices.
[0156] The audio circuit 1105 can be used to provide an audio interface between the user and the electronic device through a speaker and a microphone. The audio circuit 1105 can convert the received audio data into an electrical signal and transmit it to the speaker, which then converts it into a sound signal for output. On the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 1105 and converted into audio data. The audio data is then output to the processor 1101 for processing, and then sent to another electronic device through the radio frequency circuit 1104, or the audio data is output to the memory 1102 for further processing. The audio circuit 1105 may also include an earphone jack to provide communication between external headphones and the electronic device.
[0157] The input unit 1106 may be configured to receive input digital, character information, or user feature information (such as fingerprint, iris, or facial information), and to generate keyboard, mouse, joystick, optical, or trackball signal input related to user settings and function control.
[0158] Power supply 1107 is used to supply power to various components of electronic device 1100. Optionally, power supply 1107 can be logically connected to processor 1101 via a power management device, thereby enabling the power management device to manage charging, discharging, and power consumption. Power supply 1107 can also include one or more DC or AC power supplies, a recharging device, a power failure detection circuit, a power converter or inverter, a power status indicator, and other arbitrary components.
[0159] although Figure 6 Not shown, the electronic device 1100 may further include a camera, a sensor, a wireless fidelity module, a Bluetooth module, etc., which will not be described in detail here.
[0160] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0161] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be accomplished by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0162] To this end, an embodiment of the present application provides a computer-readable storage medium storing a plurality of computer programs. The computer programs can be loaded by a processor to execute any one of the message forwarding methods provided in the embodiments of the present application. The computer program can execute the following steps of the message forwarding method:
[0163] Performing data processing on the first message to be forwarded to obtain a second message, where the second message includes verification information generated based on the first message and at least part of the information of the first message;
[0164] The second message is sent to a message receiver, so that the message receiver performs data verification based on the second message.
[0165] The specific implementation of the above operations can be found in the previous embodiments and will not be repeated here.
[0166] The computer-readable storage medium may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0167] Since the computer-readable storage medium can implement the beneficially stored computer program that can be implemented by any message forwarding method provided in the embodiments of the present application, and can execute any message forwarding method provided in the embodiments of the present application, the effects are detailed in the previous embodiments and will not be repeated here.
[0168] Optionally, an embodiment of the present application further provides a vehicle, which includes any of the above message forwarding systems, electronic devices, electronic devices, computer-readable storage media, and computer program products, and executes any of the above methods.
[0169] In the description of this application, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more features. In the description of this application, "plurality" means two or more, unless otherwise specifically defined.
[0170] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0171] The embodiments, implementation methods and related technical features of the present application can be combined and replaced with each other without conflict.
[0172] The above are merely preferred embodiments of the present application and do not constitute any form of limitation to the present application. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present application without departing from the content of the technical solution of the present application are still within the scope of the technical solution of the present application.
Claims
1. A message forwarding method, characterized in that: The message forwarding method includes: Performing data processing on the first message to be forwarded to obtain a second message, where the second message includes verification information generated based on the first message and at least part of the information of the first message; The second message is sent to a message receiver, so that the message receiver performs data verification based on the second message.
2. The message forwarding method according to claim 1, wherein: The verification information includes at least one of the following: a first timestamp for indicating a time at which the first message was received; a second timestamp for indicating a sending time of the second message; A check code generated based on the first message.
3. The message forwarding method according to claim 2, wherein: The verification information includes a check code, and the data processing of the first message to be forwarded to obtain the second message includes: Performing a check calculation based on the first message to be forwarded to obtain the check code; Based on the verification code, a second message corresponding to the first message is generated.
4. The message forwarding method according to claim 3, wherein: The performing a check calculation based on the first message to be forwarded to obtain the check code includes: Reassembling the first message to be forwarded to obtain a reassembled message; Performing a checksum calculation on the reassembled message to obtain the checksum.
5. The message forwarding method according to claim 4, wherein: The generating, based on the check code, a second message corresponding to the first message includes: Generate the second message according to the check code and the reassembled message.
6. The message forwarding method according to claim 5, wherein: The verification information further includes a first timestamp, which is in the reassembled message.
7. The message forwarding method according to claim 6, wherein: The verification information further includes a second timestamp, and generating the second message according to the check code and the reassembled message includes: The second message is generated based on the check code, the reassembled message and the second timestamp.
8. The message forwarding method according to claim 7, wherein: The second message further includes at least one of a data header, the number of the first messages, a hardware channel number, a message identifier, and a data length.
9. The message forwarding method according to claim 8, wherein: The second message includes a data header, and the check code is set in the data header.
10. The message forwarding method according to any one of claims 1 to 9, wherein: The sending the second message to the message receiver includes: The second message is sent to the message receiver through a target transmission channel corresponding to the second message.
11. The message forwarding method according to claim 10, wherein: Before sending the second message to the message receiver through the target transmission channel corresponding to the second message, the method further includes: Determining a target transmission channel corresponding to the second message based on the message identifier of the second message and a preset mapping relationship; The preset mapping relationship includes a mapping relationship between a preset message identifier and a transmission channel.
12. The message forwarding method according to claim 10, wherein: The sending the second message to the message receiver through the target transmission channel corresponding to the second message includes: Broadcasting subscribeable events of the target transmission channel; In case of receiving a subscription instruction from the message receiver for the subscribable event, the second message is sent to the message receiver through the target transmission channel.
13. The message forwarding method according to any one of claims 1 to 9, wherein: Before the first message to be forwarded is processed to obtain the second message, the method further includes: At least two messages with the same receiving time are determined from the received messages to obtain the first message to be forwarded.
14. The message forwarding method according to claim 13, wherein: The determining, from the received messages, at least two messages with the same reception time to obtain the first message to be forwarded includes: At least two messages with the same receiving time and the same transmission channel are determined from the received messages to obtain the first message to be forwarded.
15. The message forwarding method according to any one of claims 1 to 9, wherein: Before the first message to be forwarded is processed to obtain the second message, the method further includes: At least two messages with the same transmission channel are determined from the received messages to obtain the first message to be forwarded.
16. The message forwarding method according to any one of claims 1 to 9, characterized in that: The message forwarding method is applied to the application software layer of the vehicle open system architecture.
17. A message forwarding system, characterized in that: The message forwarding system includes: a data processing module, configured to perform data processing on the first message to be forwarded to obtain a second message, wherein the second message includes verification information generated based on the first message and at least part of the information of the first message; A data forwarding module is used to send the second message to a message receiver, so that the message receiver performs data verification based on the second message.
18. The message forwarding system according to claim 17, wherein: The data processing module includes: A message acquisition module, configured to acquire the first message to be forwarded; a data reassembly module, configured to reassemble the first message to be forwarded to obtain a reassembled message; The data distribution and verification module is used to perform verification calculation on the reorganized message to obtain a verification code, and generate a second message corresponding to the first message based on the verification code.
19. The message forwarding system according to claim 18, wherein: The data allocation and verification module is further configured to determine a target transmission channel corresponding to the second message based on the message identifier of the second message and a preset mapping relationship; wherein the preset mapping relationship includes a mapping relationship between a preset message identifier and a transmission channel.
20. The message forwarding system according to claim 19, wherein: The data forwarding module is further configured to broadcast a subscribable event of the target transmission channel, and upon receiving a subscription instruction from the message recipient for the subscribable event, send the second message to the message recipient via the target transmission channel.
21. The message forwarding system according to any one of claims 17 to 20, wherein: The message forwarding system is arranged in the application software layer of the vehicle open system architecture.
22. An electronic device, characterized in that: The method comprises a processor connected to a memory, wherein the memory stores a computer program, and the processor is used to run the computer program in the memory to execute the message forwarding method according to any one of claims 1 to 16.
23. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the message forwarding method according to any one of claims 1 to 16 is implemented.
24. A computer program product, characterized in that It includes a computer program, which is executed by a processor to implement the message forwarding method described in any one of claims 1 to 16.
25. A vehicle, characterized in that: The vehicle executes the message forwarding method according to any one of claims 1 to 16, or includes the message forwarding system according to any one of claims 17 to 21 or the electronic device according to claim 22.