Message transmission method and device, equipment and medium

By storing the first response message in the LIN bus in advance, the problem of message cycle time jitter is solved, and the current frame message can be scheduled at the beginning of the N+1th message cycle, which improves the reliability of communication.

CN119544398APending Publication Date: 2025-02-28BEIJING CO WHEELS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311110252.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-30
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

In the local Internet network (LIN) bus, the copying action of the previous message occupies the message cycle of the next message during message transmission, resulting in message cycle time jitter, affecting the reliability of communication.

Method used

At the beginning of the Nth message cycle, the first header is sent to the first slave node and the first response message is received. After the first response message is received, the first response message is stored at the LIN application layer before the target time to obtain the first message. The target time is before the start time of the N+1 message cycle.

Benefits of technology

By storing the first response message in advance, the copying action is prevented from occupying the message cycle of the next frame message, so as to ensure that the current frame message can be scheduled at the beginning of the N+1 message cycle, which improves the time jitter problem of the LIN bus message cycle and improves the reliability of communication.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119544398A_ABST
    Figure CN119544398A_ABST
Patent Text Reader

Abstract

The invention discloses a message transmission method and device, equipment and a medium, and the method comprises the steps: transmitting a first header to a first slave node at the starting moment of an Nth message period, receiving a first response message returned by the first slave node based on the first header; after the first response message is received, the first response message is stored to an LIN application layer at the target moment, a first message is obtained, and the first message comprises a first header and the first response message; wherein the target moment is before the starting moment of the (N + 1) th message period. According to the embodiment of the invention, the problem of time jitter of the LIN bus message period can be improved, and the reliability of LIN bus communication is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of communication technology, and in particular, relates to a message transmission method, device, equipment and medium. Background Art

[0002] The Local Interconnect Network (LIN) bus is a low-cost serial communication network defined for automotive distributed electronic systems. It is a supplement to other automotive multi-channel networks such as the Controller Area Network (CAN) and is suitable for applications that do not have high requirements on network bandwidth, performance or fault tolerance.

[0003] In the related art, when transmitting messages on the LIN bus, a message cycle can be specified, which is the message sending cycle, and the timeliness of message transmission can be guaranteed by this message cycle. However, in the actual message transmission scenario, within the message cycle of the current frame message, before the transmission action of the current frame message begins, it is necessary to copy the data stored in the Lin driver when the previous frame message was transmitted, and this copying action is time-consuming and occupies the message cycle of the current frame message, resulting in a time error when actually sending the message on the LIN bus. The current frame message cannot be scheduled at the beginning of the message cycle of the current frame message, resulting in time jitter of the message cycle, thereby affecting the reliability of LIN bus communication. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a message transmission method and device thereof, which can improve the time jitter problem of the LIN bus message cycle and enhance the reliability of LIN bus communication.

[0005] In a first aspect, an embodiment of the present application provides a message transmission method, the method comprising: at the start time of the Nth message cycle, sending a first header to a first slave node; receiving a first response message returned by the first slave node based on the first header; after the first response message is received, storing the first response message to the LIN application layer at a target time to obtain a first message, wherein the first message includes a first header and a first response message; wherein the target time is before the start time of the N+1th message cycle.

[0006] In some implementations of the first aspect, before storing the first response message to the LIN application layer at the target time, the method also includes: obtaining an operating cycle of the LIN application layer; determining the operating period of the first time as the first operating cycle, wherein the first time is the time when the master node completes receiving the first response message; determining the operating cycle after the first operating cycle and before the N+1th message cycle as the second operating cycle, and obtaining at least one second operating cycle; and selecting the target time from the start time of at least one second operating cycle.

[0007] In some implementations of the first aspect, the second operating cycle includes multiple, and the target time is selected from the start time of at least one second operating cycle, including: determining the start time of the earliest second operating cycle as the target time; or determining the start time of any second operating cycle as the target time.

[0008] In some implementations of the first aspect, before receiving a first response message returned by the first slave node based on the first header, the method also includes: obtaining the message length of the first message from the first header; calculating the transmission duration corresponding to the first message based on the message length and the transmission rate of the first header and the first response message on the LIN bus; adding the second moment to the transmission duration to obtain the first moment when the first response message is received, wherein the second moment is the moment when the first header is started to be sent.

[0009] In some implementation methods of the first aspect, calculating the transmission duration corresponding to the first message includes: determining the ratio of the message length to the transmission rate as the transmission duration; wherein the transmission duration includes the total duration of the master node sending the first header to the first slave node and the first slave node sending the first response message to the master node.

[0010] In some implementations of the first aspect, receiving a first response message returned by the first slave node based on the first header includes: receiving the first response message by interrupt receiving.

[0011] In some implementation methods of the first aspect, after receiving the first response message through an interrupt reception method, the method may also include: storing the first response message to the LIN driver layer; storing the first response message to the LIN application layer at the target time, including: copying the first response message in the LIN driver layer to the LIN application layer at the target time.

[0012] In a second aspect, an embodiment of the present application provides a message transmission device, which includes: a sending module, used to send a first header to a first slave node at the start time of the Nth message cycle; a receiving module, used to receive a first response message returned by the first slave node based on the first header; a storage module, used to store the first response message to the LIN application layer at a target time after the first response message is received, to obtain a first message, wherein the first message includes a first header and a first response message; the sending module is also used wherein the target time is before the start time of the N+1th message cycle.

[0013] In some implementation methods of the second aspect, the device also includes: an acquisition module, used to acquire the operation cycle of the LIN application layer before storing the first response message to the LIN application layer at the target time; a determination module, used to determine the operation period of the first time as the first operation cycle, wherein the first time is the time when the master node completes receiving the first response message; the determination module is also used to determine the operation cycle after the first operation cycle and before the N+1th message cycle as the second operation cycle, and obtain at least one second operation cycle; a selection module, used to select the target time from the start time of at least one second operation cycle.

[0014] In some implementations of the second aspect, the second operation cycle includes multiple ones, and the selection module is specifically used to: determine the earliest start time of the second operation cycle as the target time; or determine the start time of any one of the second operation cycles as the target time.

[0015] In some implementations of the second aspect, the device also includes: an acquisition module, used to obtain the message length of the first message from the first header before receiving the first response message returned by the first slave node based on the first header; a calculation module, used to calculate the transmission duration corresponding to the first message based on the message length and the transmission rate of the first header and the first response message on the LIN bus; the calculation module is also used to add the second moment to the transmission duration to obtain the first moment when the first response message is received, wherein the second moment is the moment when the first header is started to be sent.

[0016] In some implementation methods of the second aspect, the calculation module is specifically used to: determine the ratio of the message length to the transmission rate as the transmission duration; wherein the transmission duration includes the total duration of the master node sending the first header to the first slave node and the first slave node sending the first response message to the master node.

[0017] In some implementations of the second aspect, the receiving module is specifically used to: receive the first response message through an interrupt receiving mode.

[0018] In some implementation methods of the second aspect, the device may also include: a storage module, which is also used to store the first response message to the LIN driver layer after receiving the first response message through an interrupt reception method; the storage module is specifically used to: copy the first response message in the LIN driver layer to the LIN application layer at the target time.

[0019] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the steps of the message transmission method of the first aspect are implemented.

[0020] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the steps of the message transmission method of the first aspect are implemented.

[0021] In a fifth aspect, an embodiment of the present application provides a computer program product, which is stored in a non-volatile storage medium and is executed by at least one processor to implement the steps of the message transmission method of the first aspect.

[0022] In a sixth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface, wherein the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the steps of the message transmission method of the first aspect.

[0023] The present application provides a message transmission method, device, equipment and medium. At the beginning of the Nth message cycle, the master node sends a first header to the first slave node and receives a first response message returned by the first slave node. After the first response message is received, the master node can store the first response message to the LIN application layer at the target time to obtain the first message. Taking the message cycle of the previous frame message as the Nth message cycle and the message cycle of the current frame message as the N+1th message cycle as an example, in the related art, the copy action of the previous frame message needs to occupy the N+1th message cycle, so the transmission step of the current frame message cannot be performed at the beginning of the N+1 message cycle, that is, the current frame message cannot be scheduled at the beginning of the message cycle of the current frame message, so the message cycle time jitter is generated. The present application stores the first response message in the LIN application layer at the target time before the N+1th message cycle, that is, before the N+1th message cycle, thereby obtaining the first message based on the first response message, completing the current frame message transmission in the Nth message cycle, and avoiding the storage action of the current frame occupying the time of the N+1th message cycle. Therefore, it can be ensured that the current frame message can be scheduled at the beginning of the N+1th message cycle, avoiding the impact on the scheduling timing of the current frame message, and can improve the time jitter problem of the LIN bus message cycle and enhance the reliability of LIN bus communication. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application.

[0025] Figure 1 It is a flowchart of a message transmission method provided by an embodiment of the present application;

[0026] Figure 2 It is a schematic diagram of an example of a message transmission process provided by an embodiment of the present application;

[0027] Figure 3 It is a flowchart of a message transmission method provided by another embodiment of the present application;

[0028] Figure 4 It is a flowchart of a message transmission method provided in yet another embodiment of the present application;

[0029] Figure 5 is a schematic diagram of an example of a message transmission process provided by another embodiment of the present application;

[0030] Figure 6 It is a structural schematic diagram of a message transmission device provided in an embodiment of the present application;

[0031] Figure 7 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0032] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.

[0033] The Local Interconnect Network (LIN) bus is a low-cost serial communication network defined for automotive distributed electronic systems. It is a supplement to other automotive multi-channel networks such as the Controller Area Network (CAN) and is suitable for applications that do not have high requirements on network bandwidth, performance or fault tolerance.

[0034] The message transmission method provided in the embodiment of the present application is described in detail below through specific embodiments and their application scenarios in conjunction with the accompanying drawings.

[0035] Figure 1 It is a flow chart of a message transmission method provided by an embodiment of the present application. The execution subject of the message transmission method can be a master node, wherein the master node is connected to at least one slave node through a LIN bus, and the at least one slave node includes a first slave node and a second slave node.

[0036] The following takes the execution subject of the message transmission method as the main node as an example to illustrate the message transmission method of the present application. It should be noted that the above execution subject and application scenario do not constitute a limitation on the present application.

[0037] like Figure 1 As shown, the message transmission method provided in the embodiment of the present application may include steps 110 to 130.

[0038] Step 110: at the beginning of the Nth message cycle, send a first header to the first slave node.

[0039] Step 120: Receive a first response message returned by the first slave node based on the first header.

[0040] Step 130, after the first response message is received, the first response message is stored in the LIN application layer at the target time to obtain the first message.

[0041] The first message includes a first header and a first response message, and the target time is before the start time of the N+1th message cycle.

[0042] For example, the message period is 20ms, the operation period of the LIN application layer is 5ms, and the Nth message period can be Figure 2 The 0th ms to 20th ms, N+1th message period can be Figure 2 The 20th ms to the 40th ms shown. In the related art, the master node sends the header header to the LIN bus via the application layer and the driver layer at the beginning of the message cycle and the operation cycle, that is, the 0th ms. After the header is transmitted to the first slave node through the LIN bus, the first slave node returns the first response message slave response1 through the LIN bus. The driver layer of the master node can receive and store the slave response1, and the slave response1 is stored in the driver layer. Finally, the master node copies the slave response1 of the driver layer to the application layer at the beginning of the next message cycle, that is, the 20th ms, but the copying process will take time, for example, it takes 2ms, then the master node will copy the slave response1 at the 22nd ms, and combine the header and slave response1 to obtain the first message. In this way, it will take up the next message cycle (20th ms to 40th ms) to complete the transmission of the first message, resulting in the message cycle of the first message exceeding the originally specified 20ms, and the message cycle has time jitter.

[0043] Compared with the related art that stores the first response message in the LIN application layer at the beginning of the 20ms, the present application advances this time to the target time, which is before the start time of the N+1 message cycle. For example, if the master node completes receiving at the 7.5ms, the present application can store the first response message in the LIN application layer at the target time after the 7.5ms and before the 20ms, thereby completing the message transmission of the first message in the Nth message cycle (0ms-20ms), avoiding occupying the time of the N+1th message cycle (20ms-40ms), and ensuring that the second header can be sent at the beginning of the N+1th message cycle, which will not affect the transmission and scheduling of the next frame message.

[0044] In the message transmission method provided by the embodiment of the present application, the master node sends a first header to the first slave node at the beginning of the Nth message cycle, and receives the first response message returned by the first slave node. After the first response message is received, the master node can store the first response message to the LIN application layer at the target time to obtain the first message. Taking the message cycle of the previous frame message as the Nth message cycle and the message cycle of the current frame message as the N+1th message cycle as an example, in the related art, the copy action of the previous frame message needs to occupy the N+1th message cycle, so the transmission step of the current frame message cannot be performed at the beginning of the N+1 message cycle, that is, the current frame message cannot be scheduled at the beginning of the message cycle of the current frame message, so the message cycle time jitter is generated. The present application stores the first response message in the LIN application layer at the target time before the N+1th message cycle, that is, before the N+1th message cycle, thereby obtaining the first message based on the first response message, completing the current frame message transmission in the Nth message cycle, and avoiding the storage action of the current frame occupying the time of the N+1th message cycle. Therefore, it can be ensured that the current frame message can be scheduled at the beginning of the N+1th message cycle, avoiding the impact on the scheduling timing of the current frame message, and can improve the time jitter problem of the LIN bus message cycle and enhance the reliability of LIN bus communication.

[0045] The specific implementation of the above steps will be described in detail below in conjunction with specific embodiments.

[0046] Involving step 110, at the beginning of the Nth message cycle, a first header is sent to the first slave node.

[0047] Among them, the message period can be specified according to actual needs, for example, the message period can be set to other values ​​such as 10ms, 20ms, 50ms, etc., and this application does not make specific restrictions on this. N is a positive integer, the Nth message period is used to transmit the first message, the N+1th message period is the Nth message period, and the N+1th message period is used to transmit the next frame message of the first message.

[0048] In some embodiments, the LIN bus protocol layered structure may include a LIN application layer and a LIN driver layer, and step 210 may include: the master node sends the first header to the LIN driver layer through the LIN application layer, and then sends the first header to the first slave node through the LIN driver layer.

[0049] Involving step 120, receiving a first response message returned by the first slave node based on the first header.

[0050] Specifically, the first header may include an identifier (Protected ID, PID) field, the first 6 bits of the identifier field are the identifier, and the last 2 bits are the parity check symbol. The identifier field can mark which slave nodes need to respond to the first header. In the present application, the first slave node is a slave node that needs to respond to the first header, that is, the identifier field of the first header is related to the first slave node. Therefore, by sending the first header to at least one slave node, the first slave node can respond to the first header. Specifically, the first slave node parses the first header, confirms that the first header is related to itself, receives and responds to the first header, and returns a first response message to the master node.

[0051] Involving step 130, after the first response message is received, the first response message is stored in the LIN application layer at the target time to obtain the first message.

[0052] Specifically, the first header is the header of the first message. The master node stores the first response message to the LIN application layer at the target time corresponding to the first header, so that at the beginning of the N+1th cycle, the second header can be sent to the second slave node to obtain the next frame message of the first message based on the second header.

[0053] In some embodiments of the present application, the above-mentioned step 120 may specifically include: receiving a first response message through an interrupt reception method; after receiving the first response message through an interrupt reception method, the method may also include: storing the first response message to the LIN driver layer; the above-mentioned step 130 may specifically include: copying the first response message in the LIN driver layer to the LIN application layer at the target time.

[0054] In an embodiment of the present application, the copying step of copying the first response message in the LIN driver layer to the LIN application layer takes time. Therefore, by advancing this copying step to the target time, that is, before the next message cycle, it is possible to avoid occupying the time of the next message cycle, thereby ensuring that the second header can be sent at the beginning of the next message cycle, and will not affect the transmission and scheduling of the next frame message.

[0055] In some embodiments of the present application, Figure 3 is a flow chart of a message transmission method provided by another embodiment of the present application. Before step 130, the method may further include: Figure 3 Steps 310 to 340 are shown.

[0056] Step 310, obtaining the operation cycle of the LIN application layer;

[0057] Step 320, determining the operation period at the first moment as the first operation cycle;

[0058] Step 330, determining the operation cycle after the first operation cycle and before the N+1th message cycle as the second operation cycle, and obtaining at least one second operation cycle;

[0059] Step 340: Select a target time from the start time of at least one second operation cycle.

[0060] The first moment is the moment when the master node completes receiving the first response message.

[0061] In the embodiment of the present application, if the LIN application layer has a set operation cycle, for example Figure 1 The operation cycle shown is 5ms, so the master node can determine the target time to store the first response message in the LIN application layer according to the operation cycle of the LIN application layer after obtaining the time when the master node completes receiving the first response message.

[0062] For example, Figure 5 As shown, the operating cycle of the LIN application is 5ms, and the first moment is 7.5ms. Therefore, the first operating cycle of the first moment is 5ms-10ms, and the N+1th message cycle is 20ms-40ms. Therefore, 10ms-15ms and 15ms-20ms are the second operating cycle, and the 10ms or 15ms can be used as the target moment.

[0063] In the embodiment of the present application, since at least one second operating cycle is before the N+1th message cycle, no matter which start time of the second operating cycle is selected as the target time, the message transmission of the first message can be completed before the N+1th message cycle, without occupying the time of the N+1th message cycle, thereby solving the jitter problem of the message cycle and improving the reliability of LIN bus transmission.

[0064] It should be noted that the first moment may be after step 120, when the master node automatically obtains the first moment after receiving the first response message, or it may be before step 110 or step 120, when the master node automatically calculates the first moment based on the message length of the first message and the LIN bus transmission rate. The master node may determine the first moment in any of the above methods, and the present application does not make any specific limitation on this.

[0065] In some embodiments of the present application, the master node can automatically calculate the first moment, Figure 4 is a flow chart of a message transmission method provided by another embodiment of the present application. Before step 120, the method may also include Figure 4 Steps 410 - 430 are shown.

[0066] Step 410, obtaining the message length of the first message from the first header;

[0067] Step 420, calculating the transmission duration corresponding to the first message based on the message length and the transmission rate of the first header and the first response message on the LIN bus;

[0068] Step 430, adding the second moment to the transmission duration to obtain the first moment when the first response message is received, wherein the second moment is the moment when the first header starts to be sent.

[0069] Specifically, the transmission rate of the first header and the first response message on the LIN bus is the same, for example, 19200 bit / s, or other values, which are not specifically limited in this application. The transmission duration corresponding to the first message can be a ratio of the message length to the transmission rate, which includes the total duration of the master node sending the first header to the first slave node and the first slave node sending the first response message to the master node.

[0070] In some embodiments of the present application, the above-mentioned calculation of the transmission duration corresponding to the first message may specifically include:

[0071] Determine the ratio of message length to transmission rate as transmission time;

[0072] The transmission duration includes the total duration for the master node to send the first header to the first slave node and the total duration for the first slave node to send the first response message to the master node.

[0073] In an embodiment of the present application, the master node can obtain the message length from the first header sent, and calculate the time required to transmit the first message based on the message length and the transmission rate, and then determine the moment when the master node completes receiving the first response message based on the transmission time, so that the master node can start storing the first response message to the LIN application layer only after receiving the first response message.

[0074] In some embodiments of the present application, the second operation cycle may include multiple ones. In order to determine the target time, the above step 340 may specifically include:

[0075] Determine the earliest start time of the second operation cycle as the target time; or

[0076] The start time of any second operation cycle is determined as the target time.

[0077] Continue to refer Figure 5 , if the earliest second operation cycle is determined to be the target second operation cycle, that is, the 10ms-15ms is the target second operation cycle, then Figure 5As shown, at the 10th ms (i.e., the target time), the first response message slave response1 is stored in the LIN application layer, that is, the first response message stored in the LIN driver layer is copied to the LIN application layer. In this way, the master node can obtain the complete first message and complete the transmission of the first message.

[0078] In the embodiment of the present application, by determining the earliest start time of the second operation cycle as the target time, the storage of the first response message can be performed quickly and immediately at the start time of the next operation cycle after the first response message is received, thereby ensuring that the storage of the first response message starts and is completed as early as possible in the current message cycle, so that the time of the next message cycle will not be occupied, and the transmission of the next frame message can be started at the start time of the next message cycle, further improving the reliability of LIN bus communication. By determining the start time of any second operation cycle as the target time, the selectivity of the message storage time can be made higher, which can improve the flexibility of the solution.

[0079] In another example, if the latest second operation cycle is determined to be the target second operation cycle, then Figure 5 The 15 ms to 20 ms shown are the target second operation cycle, and the 15 ms is the target time.

[0080] In some embodiments of the present application, after step 130, the method may further include: at the beginning of the N+1th message cycle, sending a second header to the second slave node to obtain the next frame message of the first message based on the second header.

[0081] Specifically, after sending the second header to the second slave node, the master node can receive the second response message sent by the second slave node based on the second header, and after the first response message is received, at the target time corresponding to the second header, store the second response message to the LIN application layer, obtain the second message, complete the transmission of the second message, and at the beginning time of the N+2th message cycle, send the third header to the third slave node to obtain the next frame message of the second message based on the third header.

[0082] It is understandable that the message transmission method provided in the embodiment of the present application can be executed by an electronic device or a control module in a message transmission device for executing the message transmission method. The message transmission device is described in detail below.

[0083] Figure 6 Schematic diagram of the structure of a message transmission device provided in an embodiment of the present application. Figure 6 As shown, the message transmission device 600 may include: a sending module 610 , a receiving module 620 and a storage module 630 .

[0084] Among them, the sending module 610 is used to send a first header to the first slave node at the start time of the Nth message cycle; the receiving module 620 is used to receive a first response message returned by the first slave node based on the first header; the storage module 630 is used to store the first response message to the LIN application layer at a target time after the first response message is received, to obtain a first message, wherein the first message includes a first header and a first response message; the sending module 610 is also used wherein the target time is before the start time of the N+1th message cycle.

[0085] The message transmission device provided by the present application, at the beginning of the Nth message cycle, the master node sends a first header to the first slave node, and receives the first response message returned by the first slave node. After the first response message is received, the master node can store the first response message to the LIN application layer at the target time to obtain the first message. Taking the message cycle of the previous frame message as the Nth message cycle and the message cycle of the current frame message as the N+1th message cycle as an example, in the related art, the copy action of the previous frame message needs to occupy the N+1th message cycle, so the transmission step of the current frame message cannot be performed at the beginning of the N+1 message cycle, that is, the current frame message cannot be scheduled at the beginning of the message cycle of the current frame message, so the message cycle time jitter is generated. The present application stores the first response message in the LIN application layer at the target time before the N+1th message cycle, that is, before the N+1th message cycle, thereby obtaining the first message based on the first response message, completing the current frame message transmission in the Nth message cycle, and avoiding the storage action of the current frame occupying the time of the N+1th message cycle. Therefore, it can be ensured that the current frame message can be scheduled at the beginning of the N+1th message cycle, avoiding the impact on the scheduling timing of the current frame message, and can improve the time jitter problem of the LIN bus message cycle and enhance the reliability of LIN bus communication.

[0086] In some embodiments of the present application, the device also includes: an acquisition module, used to acquire the operation cycle of the LIN application layer before storing the first response message to the LIN application layer at the target time; a determination module, used to determine the operation period of the first time as the first operation cycle, wherein the first time is the time when the master node completes receiving the first response message; the determination module is also used to determine the operation cycle after the first operation cycle and before the N+1th message cycle as the second operation cycle, and obtain at least one second operation cycle; a selection module is used to select the target time from the start time of at least one second operation cycle.

[0087] In some embodiments of the present application, the second operation cycle includes multiple ones, and the selection module is specifically used to: determine the start time of the earliest second operation cycle as the target time; or determine the start time of any second operation cycle as the target time.

[0088] In some embodiments of the present application, the device also includes: an acquisition module, which is used to obtain the message length of the first message from the first header before receiving the first response message returned by the first slave node based on the first header; a calculation module, which is used to calculate the transmission duration corresponding to the first message based on the message length and the transmission rate of the first header and the first response message on the LIN bus; the calculation module is also used to add the second moment to the transmission duration to obtain the first moment when the first response message is received, wherein the second moment is the moment when the first header is started to be sent.

[0089] In some embodiments of the present application, the calculation module is specifically used to: determine the ratio of the message length to the transmission rate as the transmission duration; wherein the transmission duration includes the total duration of the master node sending the first header to the first slave node and the first slave node sending the first response message to the master node.

[0090] In some embodiments of the present application, the receiving module 620 is specifically used to: receive the first response message through an interrupt receiving mode.

[0091] In some embodiments of the present application, the device may also include: a storage module 630, which is also used to store the first response message to the LIN driver layer after receiving the first response message through an interrupt reception method; the storage module 630 is specifically used to: copy the first response message in the LIN driver layer to the LIN application layer at the target time.

[0092] The message transmission device provided in the embodiment of the present application can realize Figure 1-Figure 5 The various processes implemented by the electronic device in the method embodiment can achieve the same technical effect, and to avoid repetition, they will not be described here.

[0093] Figure 7 It is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application.

[0094] like Figure 7 As shown, the electronic device 700 in this embodiment may include a processor 701 and a memory 702 storing computer program instructions.

[0095] Specifically, the processor 701 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0096] The memory 702 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 702 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 702 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 702 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 702 is a non-volatile solid-state memory. The memory may include a read-only memory (ROM), a random access memory (RAM), a disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Thus, typically, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) having software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the methods according to the embodiments of the present application.

[0097] The processor 701 implements any one of the message transmission methods in the above embodiments by reading and executing computer program instructions stored in the memory 702.

[0098] In one example, the electronic device 700 may further include a communication interface 703 and a bus 710. Figure 7 As shown, the processor 701, the memory 702, and the communication interface 703 are connected via a bus 710 and communicate with each other.

[0099] The communication interface 703 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.

[0100] Bus 710 includes hardware, software or both, and the parts of online data flow billing equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front-end bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 710 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the present application considers any suitable bus or interconnection.

[0101] The electronic device provided in the embodiment of the present application can realize Figure 1-Figure 5 The various processes implemented by the electronic device in the method embodiment can achieve the same technical effect, and to avoid repetition, they will not be described here.

[0102] In combination with the message transmission method in the above embodiment, the embodiment of the present application can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, the steps of any one of the message transmission methods in the above embodiment are implemented.

[0103] In combination with the message transmission method in the above embodiment, the embodiment of the present application can provide a computer program product for implementation. The (computer) program product is stored in a non-volatile storage medium, and when the program product is executed by at least one processor, it implements the steps of any one of the message transmission methods in the above embodiment.

[0104] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned message transmission method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0105] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0106] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.

[0107] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), appropriate firmware, plug-in, function card, etc. When implemented in software, the elements of the present application are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.

[0108] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.

[0109] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.

[0110] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.

Claims

1. A message transmission method, characterized in that: The method comprises: At the beginning of the Nth message cycle, sending a first header to the first slave node; receiving a first response message returned by the first slave node based on the first header; After the first response message is received, the first response message is stored in the LIN application layer at the target time to obtain a first message, wherein the first message includes the first header and the first response message; The target time is before the start time of the N+1th message cycle.

2. The method according to claim 1, characterized in that: Before storing the first response message in the LIN application layer at the target time, the method further includes: Obtaining the operation cycle of the LIN application layer; Determine the running period of the first moment as the first running cycle, wherein the first moment is the moment when the master node completes receiving the first response message; Determine an operation cycle after the first operation cycle and before the N+1th message cycle as a second operation cycle, and obtain at least one second operation cycle; The target time is selected from the start time of the at least one second operation cycle.

3. The method according to claim 2, characterized in that The second operation cycle includes a plurality of cycles, and the step of selecting a target time from the start time of at least one second operation cycle includes: Determine the earliest start time of the second operation cycle as the target time; or The start time of any second operation cycle is determined as the target time.

4. The method according to claim 2, characterized in that: Before receiving the first response message returned by the first slave node based on the first header, the method further includes: Acquire a message length of the first message from the first header; Calculate the transmission duration corresponding to the first message based on the message length and the transmission rate of the first header and the first response message on the LIN bus; The second moment is added to the transmission duration to obtain the first moment when the first response message is received, wherein the second moment is the moment when the first header starts to be sent.

5. The method according to claim 4, characterized in that The calculating the transmission duration corresponding to the first message includes: Determine the ratio of the message length to the transmission rate as the transmission duration; The transmission duration includes the total duration for the master node to send the first header to the first slave node and the total duration for the first slave node to send the first response message to the master node.

6. The method according to claim 1, characterized in that The receiving a first response message returned by the first slave node based on the first header includes: The first response message is received by interrupt receiving mode.

7. The method according to claim 6, characterized in that: After receiving the first response message in the interrupt receiving mode, the method further includes: Storing the first response message in the LIN driver layer; The storing the first response message to the LIN application layer at the target time includes: The first response message in the LIN driver layer is copied to the LIN application layer at the target time.

8. A message transmission device, characterized in that: The device comprises: A sending module, used for sending a first header to a first slave node at the beginning of an Nth message cycle; A receiving module, configured to receive a first response message returned by the first slave node based on the first header; A storage module, configured to store the first response message to the LIN application layer at a target time after the first response message is received, to obtain a first message, wherein the first message includes the first header and the first response message; The target time is before the start time of the N+1th message cycle.

9. An electronic device, characterized in that: The device comprises: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the steps of the message transmission method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by the processor, the steps of the message transmission method according to any one of claims 1 to 7 are implemented.