Scheduling method and device of LIN bus, computer device, readable storage medium and program product
By controlling the scheduling method of the master node in the LIN bus network and accurately scheduling and switching between silent states according to the slave node status, the problem of power consumption caused by master node wake-up and scheduling is solved, and efficient utilization of system resources and improved stability are achieved.
Patent Information
- Application Number
- CN202411345108.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2044-09-25
AI Technical Summary
In the existing LIN bus scheduling mechanism, master node wake-up and scheduling lead to unnecessary power consumption and increased system complexity.
By obtaining the initial state of the slave node when the master node is awake, starting scheduling only when the slave node responds normally, and controlling the network to enter a silent state when no data is needed, the master node is configured to obtain data from all slave nodes at the same time, the timer controls the initialization state, and enters a sleep or silent state when conditions are met.
It optimizes system resource utilization, reduces unnecessary waiting and idle time, enhances system stability and reliability, and reduces power consumption.
Smart Images

Figure CN119094270B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of automobile distributed electronic systems, and in particular to a scheduling method, apparatus, computer equipment, readable storage medium, and program product for a LIN bus. Background Art
[0002] The LIN bus network structure consists of a master node and multiple slave nodes. The master node is responsible for scheduling and managing the entire network. During a typical LIN communication process, the master node divides the LIN message into two parts: a header and a data field. The header contains key information such as the message ID, which identifies different communication tasks. The data field carries the specific transmission data and verification information. The master node sends the header in a sequential order according to a pre-set schedule. The corresponding slave node then fills in the data field based on the task type (master or slave). This mechanism ensures orderly data transmission and efficient processing.
[0003] However, the current scheduling mechanism for the LIN bus usually adopts the "master node wakes up and schedules" approach. In this mode, once the master node is powered on or woken up, it immediately starts the scheduling process, requiring the slave nodes to quickly complete initialization and prepare for data transmission, regardless of whether the data is actually needed in the current application scenario. This mechanical communication behavior not only increases the complexity of the system, but also leads to unnecessary energy consumption. Summary of the Invention
[0004] Based on this, it is necessary to provide a scheduling method, device, computer equipment, readable storage medium and program product for a LIN bus that can reduce power consumption in order to address the above technical problems.
[0005] In a first aspect, the present application provides a LIN bus scheduling method, comprising:
[0006] When the master node is in the awake state and needs to obtain node data of the slave node, obtain the initial state of the slave node;
[0007] When the initial state of the slave node is a normal response state, the node data of the slave node is obtained through the master node, and the master node is controlled to start scheduling;
[0008] When the master node starts scheduling and does not need to obtain node data from the slave node, the master node is controlled to stop scheduling and the LIN bus network structure is controlled to enter a silent state.
[0009] In one embodiment, the master node is configured to simultaneously obtain node data of all slave nodes.
[0010] In one embodiment, the method further comprises:
[0011] When the initial state of the slave node is the initialization state, the master node is controlled to enter a low level state;
[0012] When the duration of the master node being in the low level state reaches the preset duration, the timer is started;
[0013] When the timer reaches the initialization time, the master node obtains the node data of the slave node and controls the master node to start scheduling.
[0014] In one embodiment, the method further comprises:
[0015] When the master node is in the awake state and does not need to obtain node data of the slave node, the LIN bus network structure is controlled to enter the silent state.
[0016] In one embodiment, the method further comprises:
[0017] When the LIN bus network structure is in a silent state and the master node needs to obtain node data of the slave node, the master node obtains the node data of the slave node and controls the master node to start scheduling.
[0018] In one embodiment, the method further comprises:
[0019] When the master node meets the local sleep condition, the master node is controlled to enter the sleep state until the master node is awakened again;
[0020] When the master node does not meet the local sleep condition, the LIN bus network structure is controlled to maintain a silent state until the master node meets the local sleep condition.
[0021] In a second aspect, the present application further provides a LIN bus scheduling device, comprising:
[0022] The node awakening module is used to obtain the initial state of the slave node when the master node is in the awakened state and needs to obtain the node data of the slave node;
[0023] The scheduling startup module is used to obtain the node data of the slave node through the master node when the initial state of the slave node is a normal response state, and control the master node to start scheduling;
[0024] The scheduling control module is used to control the master node to stop scheduling when the master node starts scheduling and does not need to obtain node data from the slave node, and to control the LIN bus network structure to enter a silent state.
[0025] In a third aspect, the present application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements any one of the method steps in the first aspect when executing the computer program.
[0026] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which implements any one of the method steps in the first aspect when the computer program is executed by a processor.
[0027] In a fifth aspect, the present application further provides a computer program product, comprising a computer program, which implements any one of the method steps in the first aspect when executed by a processor.
[0028] The above-mentioned LIN bus scheduling method, device, computer equipment, readable storage medium and program product obtain the initial state of the slave node when the master node is in the awake state and needs to obtain the node data of the slave node. When the initial state of the slave node is a normal response state, the node data of the slave node is obtained through the master node, and the master node is controlled to start scheduling. When the master node starts scheduling and the master node does not need to obtain the node data of the slave node, the master node is controlled to stop scheduling and the LIN bus network structure is controlled to enter a silent state. It can accurately control the data exchange and scheduling process between the master node and the slave node, ensure the efficient use of system resources, reduce unnecessary waiting and idle time, and thus enhance the stability and reliability of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments of the present application or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying any creative work.
[0030] Figure 1 FIG. 1 is an application environment diagram of a scheduling method for a LIN bus in one embodiment;
[0031] Figure 2 1 is a flow chart of a scheduling method for a LIN bus in one embodiment;
[0032] Figure 3 Schematic diagram of a flow chart of a scheduling method for a LIN bus in another embodiment;
[0033] Figure 4 1 is a block diagram of a scheduling device for a LIN bus in one embodiment;
[0034] Figure 5Fig. 1 is a schematic diagram of an internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0035] For the purpose, technical solutions and advantages of the present application to be more clear, the present application is further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, and are not used to limit the present application.
[0036] The scheduling method of the LIN bus provided by the embodiments of the present application can be applied to the application environment as shown in Figure 1 . The terminal 102 communicates with the server 104 through a network. The data storage system can store data required to be processed by the server 104. The data storage system can be integrated on the server 104, or placed on a cloud or other network server. The terminal 102 is used to receive a wake-up signal of the server 104. In a case where the master node is in a wake-up state and node data of the slave node needs to be acquired, the initial state of the slave node is acquired. In a case where the initial state of the slave node is a normal response state, the node data of the slave node is acquired through the master node, and the master node is controlled to start scheduling. In a case where the master node does not need to acquire the node data of the slave node during the process of starting scheduling, the process of scheduling is stopped, and the LIN bus network structure is controlled to enter a silent state. The terminal 102 can be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things device can be a smart speaker, a smart television, a smart air conditioner, a smart vehicle device, a projection device, etc. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, etc. The head-mounted device can be a virtual reality (VR) device, an augmented reality (AR) device, smart glasses, etc. The server 104 can be a stand-alone physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.
[0037] In one exemplary embodiment, as shown in Figure 2 , a scheduling method of a LIN bus is provided. The terminal 102 in Figure 1 is taken as an example to illustrate the method, which includes the following steps 202 to 206. Wherein:
[0038] S202: In a case where the master node is in a wake-up state and node data of the slave node needs to be acquired, the initial state of the slave node is acquired.
[0039] The LIN (Local Interconnect Network) bus network structure typically consists of a master node and at least one slave node. The master node controls communications on the network and also sends message headers, which contain the slave node's address and message length, allowing the slave nodes to identify messages intended for them. Slave nodes are passive in a LIN network, listening to communications on the bus and determining whether to respond based on the address information in the message header. When a slave node identifies a message as intended, it performs an action based on the message content and may send a response data over the bus. Slave nodes typically do not communicate directly with each other and only communicate with the master node.
[0040] Optionally, the master node will first check its own status (make sure it is awake or active) when needed (such as starting a new task, checking system status, etc.), and then try to establish communication with the slave node (the node being controlled or managed) to obtain the initial status information of the slave node.
[0041] S204: When the initial state of the slave node is a normal response state, the node data of the slave node is obtained through the master node, and the master node is controlled to start scheduling.
[0042] Optionally, after the slave node responds normally to the master node's request, the master node will further request detailed data from the slave node (such as status parameters, configuration information, etc.). After obtaining this data, the master node will start the corresponding scheduling process according to the preset algorithm or rules to optimize system performance, resource allocation or task execution.
[0043] S206: When the master node starts scheduling and does not need to obtain node data of the slave node, the master node is controlled to stop scheduling and the LIN bus network structure is controlled to enter a silent state.
[0044] Optionally, during the scheduling process, the master node may decide whether to continue scheduling based on real-time conditions (such as task completion, error occurrence, insufficient resources, etc.). If it determines that it no longer needs to obtain data from the slave node, the master node will stop scheduling. At the same time, to save energy, reduce interference, or meet other network management requirements, the master node may also control the LIN bus network structure to enter a silent state, that is, suspend or reduce communication activities on the network.
[0045] In the scheduling method of the LIN bus, in the case that the master node is in the wake-up state and needs to acquire the node data of the slave node, the initial state of the slave node is acquired, in the case that the initial state of the slave node is the normal response state, the node data of the slave node is acquired by the master node, and the master node is controlled to start the scheduling, in the case that the master node does not need to acquire the node data of the slave node in the process that the master node starts the scheduling, the process that the master node stops the scheduling is controlled, and the LIN bus network structure is controlled to enter the silent state, the data exchange and the scheduling process between the master node and the slave node can be accurately controlled, the system resources can be efficiently utilized, the unnecessary waiting and idle time can be reduced, and therefore the stability and reliability of the system are enhanced.
[0046] In an exemplary embodiment, the master node is configured to acquire the node data of all the slave nodes at the same time.
[0047] Optionally, in the LIN network structure, the master node establishes a connection with all the slave nodes through the LIN bus or other communication protocols, the master node sends a broadcast message or a specific request message to all the slave nodes, and requests them to send their respective node data. After receiving the request of the master node, the slave node prepares and sends a response message containing the node state, data, configuration information and the like of the slave node to the master node. The master node receives the response message from all the slave nodes, and parses the data to acquire the node data of the slave nodes. It should be noted that, in order to ensure the uniformity of the scheduling, the master node is configured to acquire the node data of all the slave nodes at the same time, that is, the master node needs to acquire the node data of all the slave nodes at the same time, or does not need to acquire the node data of any slave node, so that the master node can make all the slave nodes silent at the same time when the LIN bus network structure is controlled to enter the silent state.
[0048] In this embodiment, by configuring the master node to acquire the node data of all the slave nodes at the same time, the master node can schedule all the slave nodes at the same time, ensure the consistency of the slave nodes, and further improve the scheduling efficiency.
[0049] In an exemplary embodiment, the method further includes: in the case that the initial state of the slave node is the initialization state, controlling the master node to enter the low-level state; in the case that the duration of the master node in the low-level state reaches the preset duration, starting the timer to time; in the case that the duration of the timer reaches the initialization duration, acquiring the node data of the slave node by the master node, and controlling the master node to start the scheduling.
[0050] Optionally, after a slave node is powered on, reset, or awakened from sleep mode, it enters the initialization state. During this phase, the slave node performs necessary initialization operations to prepare for subsequent LIN communication. The master node controls the bus to a low level by sending specific signals (such as a wake-up signal or synchronization signal). In the LIN bus, a low level typically represents a dominant level and is used to transmit data or control signals.
[0051] Furthermore, when the duration of the master node being in a low-level state reaches a preset duration, this indicates that the slave node has completed the initialization operation or is ready to receive data. At this point, the master node will start a timer to accurately control the subsequent operation time to ensure that the master node starts to obtain the data of the slave node at the appropriate time. When the timer duration reaches the initialization duration, this indicates that the slave node is fully ready and the master node can safely start to obtain the node data of the slave node. The master node requests the slave node to send its node data by sending a request message or a broadcast message. After receiving the request, the slave node will send a response message containing its status, configuration, data and other information to the master node. After obtaining the node data of all slave nodes, the master node will start the scheduling operation based on this data.
[0052] In this embodiment, by obtaining data only after the slave node initialization is completed, it can be ensured that the obtained data is the latest and consistent, thereby avoiding errors or conflicts caused by data inconsistency. By precisely controlling the time point and data acquisition process, the stability and reliability of the entire LIN bus network can be improved.
[0053] In an exemplary embodiment, the method further includes: when the master node is in an awake state and does not need to obtain node data of the slave node, controlling the LIN bus network structure to enter a silent state.
[0054] Optionally, the master node continuously monitors its own status and network activity. When the master node is awake but determines that communication with slave nodes is not currently necessary, it evaluates whether the network should enter a silent state based on pre-defined conditions or policies. Once the decision is made to enter a silent state, the master node ceases all non-essential communication signals and may notify slave nodes to also enter silent mode by sending specific silent commands or control signals. In the silent state, all nodes on the LIN bus network reduce or cease their communication activity, thereby entering a low-power mode.
[0055] In the embodiment, the LIN bus network structure is controlled to enter the silent state when the master node is in the wake-up state and the node data of the slave node is not needed, so that unnecessary communication activities are reduced and the power consumption of hardware components is lowered, thereby optimizing the utilization of system resources to ensure that the system can be flexibly adapted to different application scenarios and requirements.
[0056] In an exemplary embodiment, the method further comprises: when the LIN bus network structure is in the silent state and the master node needs to acquire the node data of the slave node, acquiring the node data of the slave node by the master node and controlling the master node to start scheduling.
[0057] Optionally, when the LIN bus network is in the silent state, the communication activities between the master node and the slave node are reduced or stopped to save energy and reduce electromagnetic interference. The master node monitors its own state and the activities in the network to determine whether to recover from the silent state to acquire the data of the slave node. When the master node determines that the node data of the slave node is needed, it sends a wake-up signal to the LIN bus, and the slave node wakes up from the silent state and prepares to receive the communication request from the master node after receiving the wake-up signal. The master node sends a data request message to the slave node after sending the wake-up signal, and the slave node prepares the corresponding data and sends it to the master node through the LIN bus after receiving the request. The master node receives the data sent by the slave node and processes it, and starts scheduling according to the data after acquiring all the required data.
[0058] In the embodiment, when the LIN bus network structure is in the silent state and the master node needs to acquire the node data of the slave node, the node data of the slave node is acquired by the master node and the master node is controlled to start scheduling, so that the LIN bus network can be flexibly switched between the silent state and the active state to meet different communication requirements. When the master node needs data, the network can be quickly woken up and the required information can be acquired without always keeping the network communication active, thereby reducing the overall power consumption of the system.
[0059] In an exemplary embodiment, the method further comprises: when the master node meets the local sleep condition, controlling the master node to enter the sleep state until the master node reenters the wake-up state; and when the master node does not meet the local sleep condition, controlling the LIN bus network structure to maintain the silent state until the master node meets the local sleep condition.
[0060] Optionally, a series of local sleep conditions are set in the master node. When the master node detects that the local sleep conditions are met, it performs a series of operations to prepare to enter the sleep state, such as shutting down unnecessary hardware components, saving current state information, sending a sleep command to the slave nodes (if applicable), and the like. Then, the master node enters a low-power sleep mode. If the master node does not meet the local sleep conditions, but there is also no current data transmission requirement, it controls the LIN bus network structure to enter a silent state. In the silent state, the communication activity between the master node and the slave nodes is reduced or stopped, but the master node remains in the wake-up state to monitor whether the sleep conditions are met or whether there is a new data transmission requirement. When the master node needs to resume data transmission or meets other wake-up conditions, it is awakened. After being awakened, the master node re-evaluates the local sleep conditions and resumes communication with the slave nodes as needed.
[0061] In this embodiment, the master node is allowed to enter the sleep state or maintain the silent state when there is no need for data transmission, which can significantly reduce the power consumption of the system. When the master node is in the wake-up state, it can quickly respond to new data transmission requirements or system events. By intelligently controlling the sleep and wake-up states of the master node and the silent state of the LIN bus network structure, the utilization of system resources can be optimized, and the stability of the system can be enhanced.
[0062] In an exemplary embodiment, as shown in Figure 3 a scheduling method for a LIN bus is provided, which comprises the following steps:
[0063] S302: When the master node is in the wake-up state and needs to obtain the node data of the slave nodes, the initial state of the slave nodes is obtained. When the initial state of the slave nodes is the normal response state, the node data of the slave nodes is obtained by the master node, and the master node is controlled to start scheduling. When the master node does not need to obtain the node data of the slave nodes during the process of starting scheduling, the master node is controlled to stop the process of scheduling, and the LIN bus network structure is controlled to enter the silent state.
[0064] In this embodiment, the master node is configured to obtain the node data of all slave nodes at the same time.
[0065] S304: When the initial state of the slave nodes is the initialization state, the master node is controlled to enter the low-power state. When the duration of the master node in the low-power state reaches the preset duration, a timer is started. When the duration of the timer reaches the initialization duration, the node data of the slave nodes is obtained by the master node, and the master node is controlled to start scheduling.
[0066] S306: When the master node is in the wake-up state and does not need to obtain the node data of the slave nodes, the LIN bus network structure is controlled to enter the silent state.
[0067] S308: In the case that the LIN bus network structure is in the silent state and the master node needs to acquire the node data of the slave node, acquiring the node data of the slave node by the master node, and controlling the master node to start the scheduling.
[0068] S310: In the case that the master node satisfies the local sleep condition, controlling the master node to enter the sleep state until the master node reenters the wake-up state; in the case that the master node does not satisfy the local sleep condition, controlling the LIN bus network structure to maintain the silent state until the master node satisfies the local sleep condition.
[0069] In the embodiment, in the case that the master node is in the wake-up state and needs to acquire the node data of the slave node, the initial state of the slave node is acquired, in the case that the initial state of the slave node is the normal response state, the node data of the slave node is acquired by the master node, and the master node is controlled to start the scheduling, in the case that the master node does not need to acquire the node data of the slave node in the process that the master node starts the scheduling, the process that the master node stops the scheduling is controlled, and the LIN bus network structure is controlled to enter the silent state, the data exchange and the scheduling process between the master node and the slave node can be accurately controlled, the system resources can be efficiently utilized, the unnecessary waiting and idle time can be reduced, and thus the stability and reliability of the system are enhanced.
[0070] It should be understood that although each step in the flowchart involved in the above embodiments is shown in sequence according to the arrow, the steps are not necessarily executed in sequence according to the arrow. Unless otherwise specified herein, the execution of the steps is not strictly limited in sequence, and the steps can be executed in other sequences. Moreover, at least part of the steps in the flowchart involved in the above embodiments can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence of the steps or stages is not necessarily sequential, but can be executed in rotation or alternation with at least part of other steps or steps or stages in other steps.
[0071] Based on the same inventive concept, the embodiments of the present application also provide a LIN bus scheduling device for implementing the above-mentioned LIN bus scheduling method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, and therefore the specific limitations in one or more LIN bus scheduling device embodiments provided below can refer to the limitations of the LIN bus scheduling method in the foregoing, which will not be described here again.
[0072] In one exemplary embodiment, as Figure 4As shown, a scheduling device for a LIN bus is provided, comprising: a node wake-up module 10, a scheduling start module 20 and a scheduling control module 30, wherein:
[0073] The node awakening module 10 is used to obtain the initial state of the slave node when the master node is in the awakened state and needs to obtain the node data of the slave node.
[0074] The scheduling start module 20 is used to obtain the node data of the slave node through the master node when the initial state of the slave node is a normal response state, and control the master node to start scheduling.
[0075] The scheduling control module 30 is used to control the master node to stop scheduling and control the LIN bus network structure to enter a silent state when the master node starts scheduling and does not need to obtain node data of the slave node.
[0076] In an exemplary embodiment, the master node involved in the node awakening module 10 is configured to simultaneously obtain node data of all slave nodes.
[0077] In an exemplary embodiment, the scheduling control module 30 is also used to control the master node to enter a low-level state when the initial state of the slave node is the initialization state; start the timer when the duration of the master node in the low-level state reaches a preset duration; when the timer duration reaches the initialization duration, obtain the node data of the slave node through the master node, and control the master node to start scheduling.
[0078] In an exemplary embodiment, the scheduling control module 30 is further configured to control the LIN bus network structure to enter a silent state when the master node is in an awake state and does not need to obtain node data of the slave node.
[0079] In an exemplary embodiment, the scheduling control module 30 is also used to obtain the node data of the slave node through the master node and control the master node to start scheduling when the LIN bus network structure is in a silent state and the master node needs to obtain the node data of the slave node.
[0080] In an exemplary embodiment, the scheduling control module 30 is also used to control the master node to enter a sleep state when the master node meets the local sleep condition until the master node is awake again; when the master node does not meet the local sleep condition, control the LIN bus network structure to maintain a silent state until the master node meets the local sleep condition.
[0081] Each module in the above-mentioned LIN bus scheduling device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.
[0082] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 5 As shown. The computer device includes a processor, memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals via wired or wireless means, and the wireless means can be implemented via Wi-Fi, a mobile cellular network, near field communication (NFC), or other technologies. When executed by the processor, the computer program implements a LIN bus scheduling method. The display unit of the computer device is used to form a visually visible image, and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse.
[0083] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0084] In one example embodiment, a computer device is provided, comprising a memory and a processor, the memory storing a computer program, and the processor implementing the following steps when executing the computer program: in a case that the master node is in a wake-up state and needs to acquire node data of the slave node, acquiring an initial state of the slave node; in a case that the initial state of the slave node is a normal response state, acquiring the node data of the slave node by the master node, and controlling the master node to start scheduling; in a case that the master node does not need to acquire the node data of the slave node during the process that the master node starts scheduling, controlling the master node to stop the process of scheduling, and controlling the LIN bus network structure to enter a silent state.
[0085] In one embodiment, the master node involved when the processor executes the computer program is configured to acquire the node data of all the slave nodes at the same time.
[0086] In one embodiment, the processor executing the computer program further implements the following steps: in a case that the initial state of the slave node is an initialization state, controlling the master node to enter a low-level state; in a case that the duration of the master node being in the low-level state reaches a preset duration, starting a timer to time; in a case that the duration of the timer reaches an initialization duration, acquiring the node data of the slave node by the master node, and controlling the master node to start scheduling.
[0087] In one embodiment, the processor executing the computer program further implements the following steps: in a case that the master node is in a wake-up state and does not need to acquire the node data of the slave node, controlling the LIN bus network structure to enter a silent state.
[0088] In one embodiment, the processor executing the computer program further implements the following steps: in a case that the LIN bus network structure is in a silent state and the master node needs to acquire the node data of the slave node, acquiring the node data of the slave node by the master node, and controlling the master node to start scheduling.
[0089] In one embodiment, the processor executing the computer program further implements the following steps: in a case that the master node meets a local sleep condition, controlling the master node to enter a sleep state until the master node reenters a wake-up state; in a case that the master node does not meet the local sleep condition, controlling the LIN bus network structure to maintain a silent state until the master node meets the local sleep condition.
[0090] In one embodiment, a computer readable storage medium is provided, having stored thereon a computer program which, when executed by a processor, implements the following steps: in the case that the master node is in an awake state and needs to acquire node data of the slave node, acquiring an initial state of the slave node; in the case that the initial state of the slave node is a normal response state, acquiring the node data of the slave node by the master node, and controlling the master node to start scheduling; in the case that the master node does not need to acquire the node data of the slave node during the process that the master node starts scheduling, controlling the master node to stop the process of scheduling, and controlling the LIN bus network structure to enter a silent state.
[0091] In one embodiment, the master node involved when the computer program is executed by the processor is configured to acquire the node data of all slave nodes at the same time.
[0092] In one embodiment, the computer program, when executed by the processor, further implements the following steps: in the case that the initial state of the slave node is an initialization state, controlling the master node to enter a low level state; in the case that the duration that the master node is in the low level state reaches a preset duration, starting a timer to time; in the case that the duration of the timer reaches an initialization duration, acquiring the node data of the slave node by the master node, and controlling the master node to start scheduling.
[0093] In one embodiment, the computer program, when executed by the processor, further implements the following steps: in the case that the master node is in an awake state and does not need to acquire the node data of the slave node, controlling the LIN bus network structure to enter a silent state.
[0094] In one embodiment, the computer program, when executed by the processor, further implements the following steps: in the case that the LIN bus network structure is in a silent state and the master node needs to acquire the node data of the slave node, acquiring the node data of the slave node by the master node, and controlling the master node to start scheduling.
[0095] In one embodiment, the computer program, when executed by the processor, further implements the following steps: in the case that the master node satisfies a local sleep condition, controlling the master node to enter a sleep state until the master node is in an awake state again; in the case that the master node does not satisfy the local sleep condition, controlling the LIN bus network structure to maintain a silent state until the master node satisfies the local sleep condition.
[0096] In one embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the following steps: in the case that the master node is in an awake state and needs to acquire node data of the slave node, acquiring an initial state of the slave node; in the case that the initial state of the slave node is a normal response state, acquiring the node data of the slave node by the master node, and controlling the master node to start scheduling; in the case that the master node does not need to acquire the node data of the slave node during the process that the master node starts scheduling, controlling the master node to stop the process of scheduling, and controlling the LIN bus network structure to enter a silent state.
[0097] In one embodiment, the master node involved when the computer program is executed by the processor is configured to acquire the node data of all slave nodes at the same time.
[0098] In one embodiment, the computer program, when executed by the processor, further implements the following steps: in the case that the initial state of the slave node is an initialization state, controlling the master node to enter a low level state; in the case that the duration that the master node is in the low level state reaches a preset duration, starting a timer to time; in the case that the duration of the timer reaches an initialization duration, acquiring the node data of the slave node by the master node, and controlling the master node to start scheduling.
[0099] In one embodiment, the computer program, when executed by the processor, further implements the following steps: in the case that the master node is in an awake state and does not need to acquire the node data of the slave node, controlling the LIN bus network structure to enter a silent state.
[0100] In one embodiment, the computer program, when executed by the processor, further implements the following steps: in the case that the LIN bus network structure is in a silent state and the master node needs to acquire the node data of the slave node, acquiring the node data of the slave node by the master node, and controlling the master node to start scheduling.
[0101] In one embodiment, the computer program, when executed by the processor, further implements the following steps: in the case that the master node meets a local sleep condition, controlling the master node to enter a sleep state until the master node is in an awake state again; in the case that the master node does not meet the local sleep condition, controlling the LIN bus network structure to maintain a silent state until the master node meets the local sleep condition.
[0102] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), quantum computing-based data processing logic devices, artificial intelligence (AI) processors, and the like.
[0103] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0104] The above-described embodiments are merely illustrative of several embodiments of the present application, and the description is relatively specific and detailed, but should not be understood as a limitation on the scope of the patent. It should be noted that for those skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are all within the scope of the present application. Therefore, the scope of protection of the present application should be subject to the appended claims.
Claims
1. A LIN bus scheduling method, characterized in that: Applicable to a LIN bus network structure; the LIN bus network structure includes a master node and at least one slave node; the method includes: When the master node is in an awake state and needs to obtain node data of the slave node, obtaining an initial state of the slave node; When the initial state of the slave node is a normal response state, obtaining node data of the slave node through the master node, and controlling the master node to start scheduling; When the master node starts scheduling and does not need to obtain node data of the slave node, the master node is controlled to stop scheduling and the LIN bus network structure is controlled to enter a silent state.
2. The method according to claim 1, characterized in that The master node is configured to simultaneously obtain node data of all slave nodes.
3. The method according to claim 1, characterized in that The method further comprises: When the initial state of the slave node is the initialization state, controlling the master node to enter a low level state; When the duration of the master node being in the low level state reaches a preset duration, starting a timer; When the duration of the timer reaches the initialization duration, the node data of the slave node is obtained through the master node, and the master node is controlled to start scheduling.
4. The method according to claim 1, wherein The method further comprises: When the master node is in the awake state and does not need to obtain the node data of the slave node, the LIN bus network structure is controlled to enter a silent state.
5. The method according to claim 1, wherein The method further comprises: When the LIN bus network structure is in a silent state and the master node needs to obtain the node data of the slave node, the node data of the slave node is obtained through the master node, and the master node is controlled to start scheduling.
6. The method according to claim 1, characterized in that The method further comprises: When the master node meets the local sleep condition, controlling the master node to enter a sleep state until the master node is awake again; In the case that the master node does not meet the local sleep condition, the LIN bus network structure is controlled to maintain a silent state until the master node meets the local sleep condition.
7. A LIN bus scheduling device, characterized in that: The device comprises: A node awakening module is used to obtain the initial state of the slave node when the master node is in the awakened state and needs to obtain the node data of the slave node; a scheduling startup module, configured to, when the initial state of the slave node is a normal response state, obtain the node data of the slave node through the master node and control the master node to start scheduling; The scheduling control module is used to control the process of the master node stopping scheduling when the master node starts scheduling and the master node does not need to obtain the node data of the slave node, and control the LIN bus network structure to enter a silent state.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Vehicle-mounted electronic control unit LIN bus communication automatic testing device and system
CN104267715A
Flexible Scheduling Method And Apparatus In LIN Communication
CN105591853A