Device management method and device on LIN bus, system, storage medium, and electronic device
By using the scheduler to manage the mapping relationship between device identification and communication message identification on the LIN bus, the problem of LIN bus devices being unable to be hot-swap, real-time discovery and recognition of devices are realized, and the intelligence and user experience of the car are improved.
Patent Information
- Application Number
- CN202510887623.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2045-06-30
AI Technical Summary
In the prior art, the LIN bus cannot realize hot plugging of the device, resulting in poor flexibility and cannot support communication between smart IOT devices and cars, and additional wireless communication modules are required to increase material costs.
By using the scheduler to manage the mapping relationship between the device identification and communication message identification of the pluggable device on the master node controller of the LIN bus, the device access status is monitored in real time, and the scheduler is updated to support device identification and communication.
It realizes hot swapping of devices on the LIN bus, improves the intelligence and automation of the car, saves resources, meets safety and performance needs, and improves the user experience.
Smart Images

Figure CN120389926B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of vehicle technology, and in particular to a method and device for managing equipment on a LIN bus, a system, a storage medium, and an electronic device. Background Art
[0002] Among related technologies, the automotive LIN (Local Interconnect Network) bus is a crucial component and a key technology in automotive development. It's frequently used in basic vehicle control systems, typically for communication between integrated switch modules and controllers, such as steering wheel switches. It's also used for communication between specialized sensors and controllers, such as rain sensors. However, these uses are designed in advance, with communication nodes and interaction protocols clearly defined during vehicle development. These interactions are performed by fixed components, making hot-swappable functionality impossible on the LIN bus, resulting in poor flexibility. Communication between smart IoT devices and vehicles cannot be achieved via the LIN bus. IoT devices typically rely on Bluetooth Low Energy (BLE), WiFi (Wireless Fidelity), or other wireless communication protocols as their foundation, requiring the installation of additional communication modules and increasing vehicle material costs.
[0003] For the above-mentioned problems existing in related technologies, no efficient and accurate solutions have been found yet. Summary of the Invention
[0004] The present invention provides a method and device for managing equipment on a LIN bus, a system, a storage medium, and an electronic device to solve technical problems in related technologies.
[0005] According to one embodiment of the present invention, a method for managing devices on a LIN bus is provided, which is applied to a controller of a master node of the LIN bus, and includes: reading a first scheduling table stored locally in the controller of the vehicle's LIN bus according to a first scheduling period, wherein the first scheduling table is used to store a mapping relationship between device identifiers of all pluggable devices and LIN communication message identifiers; sending a first scheduling request to all pluggable devices on the LIN bus in sequence according to the first scheduling table, wherein the first scheduling request carries the LIN communication message identifier of the pluggable device in the first scheduling table; monitoring a reply message returned by the first device based on the first scheduling request; and determining, based on the reply message, whether the first device is connected to the LIN bus.
[0006] Optionally, determining that the first device is connected to the LIN bus based on the reply message includes: parsing the padding data and the first message identifier in the reply message; determining whether the padding data is empty; if the padding data is not empty, searching the first device identifier that matches the first message identifier in the first scheduling table; and determining that the corresponding first device has been connected to the LIN bus based on the first device identifier.
[0007] Optionally, after determining that the first device is connected to the LIN bus based on the reply message, the method further includes: searching for matching first LIN attribute information based on the first device identifier of the first device; updating the first message identifier and the first LIN attribute information to a second scheduling table locally stored in the controller, wherein the second scheduling table is used to store the mapping relationship between the LIN communication message identifiers and LIN attribute information of all pluggable devices currently connected to the vehicle.
[0008] Optionally, updating the device identifier to the locally stored second scheduling table includes: determining whether the first message identifier exists in the second scheduling table; if the first message identifier does not exist in the second scheduling table, associating the first message identifier and the first LIN attribute information and storing them in the second scheduling table.
[0009] Optionally, the method further includes: reading a second scheduling table locally stored in the controller according to a second scheduling period, wherein the second scheduling table is used to store a mapping relationship between LIN communication message identifiers and LIN attribute information of all pluggable devices currently connected to the vehicle; sending a second scheduling request to all pluggable devices on the LIN bus in sequence according to the second scheduling table, wherein the second scheduling request carries the LIN communication message identifier of the pluggable device in the second scheduling table; monitoring the message response status of the second device to the second scheduling request; and determining that the second device is in an offline state on the LIN bus based on the message response status.
[0010] Optionally, determining that the second device is in an offline state on the LIN bus based on the message response status includes: if the message response status is a message loss state, searching for the second device to which the second message identifier belongs according to the first scheduling table; querying the historical message response status of the second device in several historical scheduling cycles of the second scheduling table; and confirming that the second device is in an offline state on the LIN bus based on the historical message response status.
[0011] Optionally, confirming that the second device is in an offline state on the LIN bus based on the historical message response status includes: judging whether the historical message response statuses are all message loss states; if the historical message response statuses are all message loss states, determining that the second device is in an offline state on the LIN bus, and updating the second scheduling table.
[0012] Optionally, after determining whether the historical message response statuses are all message loss statuses, the method further includes: if the historical message response statuses are not all message loss statuses, determining that the second device is in a fault state.
[0013] Optionally, before reading the first scheduling table locally stored in the controller of the vehicle's LIN bus according to the first scheduling cycle, the method also includes: receiving a scheduling table update request from the cloud, wherein the scheduling table update request carries the latest version of the first scheduling table; and updating the first scheduling table locally based on the scheduling table update request.
[0014] Optionally, receiving a scheduling table update request from the cloud includes: reading the first version information of the locally stored first scheduling table, and obtaining the latest second version information of the first scheduling table on the cloud; determining whether the first version information is the same as the second version information; if the first version information is not the same as the second version information, receiving a scheduling table update request from the cloud.
[0015] According to another embodiment of the present invention, a device management device on a LIN bus is provided, which is applied to a controller of a master node of the LIN bus, and includes: a first reading module for reading a first scheduling table locally stored in the controller of the vehicle's LIN bus according to a first scheduling period, wherein the first scheduling table is used to store a mapping relationship between device identifiers of all pluggable devices and LIN communication message identifiers; a first sending module for sending a first scheduling request to all pluggable devices on the LIN bus in sequence according to the first scheduling table, wherein the first scheduling request carries the LIN communication message identifier of the pluggable device in the first scheduling table; a first monitoring module for monitoring a reply message returned by the first device based on the first scheduling request; and a first determination module for determining whether the first device is connected to the LIN bus based on the reply message.
[0016] Optionally, the first determination module includes: a parsing unit for parsing the padding data and the first message identifier in the reply message; a judgment unit for judging whether the padding data is empty; a search unit for searching the first device identifier that matches the first message identifier in the first scheduling table if the padding data is not empty; and a determination unit for determining, based on the first device identifier, that the corresponding first device has been connected to the LIN bus.
[0017] Optionally, the device also includes: a search module, used to search for matching first LIN attribute information based on the first device identifier of the first device after the first determination module determines that the first device is connected to the LIN bus according to the reply message; a first update module, used to update the first message identifier and the first LIN attribute information to a second scheduling table locally stored in the controller, wherein the second scheduling table is used to store the mapping relationship between the LIN communication message identifiers and LIN attribute information of all pluggable devices currently connected to the vehicle.
[0018] Optionally, the first update module includes: a judgment unit, used to judge whether the first message identifier exists in the second scheduling table; and a storage unit, used to associate the first message identifier and the first LIN attribute information and store them in the second scheduling table if the first message identifier does not exist in the second scheduling table.
[0019] Optionally, the device also includes: a second reading module, used to read the second scheduling table locally stored in the controller according to a second scheduling period, wherein the second scheduling table is used to store the mapping relationship between the LIN communication message identifiers and LIN attribute information of all pluggable devices currently connected to the vehicle; a second sending module, used to send a second scheduling request to all pluggable devices on the LIN bus in sequence according to the second scheduling table, wherein the second scheduling request carries the LIN communication message identifier of the pluggable device in the second scheduling table; a second monitoring module, used to monitor the message response status of the second device to the second scheduling request; a second determination module, used to determine that the second device is offline on the LIN bus based on the message response status.
[0020] Optionally, the second determination module includes: a search unit, used to search for the second device to which the second message identifier belongs according to the first scheduling table if the message response status is a message loss status; a query unit, used to query the historical message response status of the second device in several historical scheduling cycles of the second scheduling table; and a determination unit, used to confirm that the second device is offline on the LIN bus based on the historical message response status.
[0021] Optionally, the determination unit includes: a judgment subunit, used to determine whether the historical message response statuses are all message loss statuses; a first determination subunit, used to determine that the second device is offline on the LIN bus if the historical message response statuses are all message loss statuses, and update the second scheduling table.
[0022] Optionally, the determination unit further includes: a second determination subunit, configured to determine that the second device is in a fault state after the judgment subunit determines whether the historical message response statuses are all message loss states, and if the historical message response statuses are not all message loss states.
[0023] Optionally, the device also includes: a receiving module, used to receive a scheduling table update request from the cloud before the first reading module reads the first scheduling table locally stored in the controller of the vehicle's LIN bus according to the first scheduling period, wherein the scheduling table update request carries the latest version of the first scheduling table; a second update module, used to locally update the first scheduling table based on the scheduling table update request.
[0024] Optionally, the receiving module includes: a reading unit for reading the first version information of the locally stored first scheduling table and obtaining the latest second version information of the first scheduling table on the cloud; a judgment unit for judging whether the first version information is the same as the second version information; and a receiving unit for receiving a scheduling table update request from the cloud if the first version information is different from the second version information.
[0025] According to another embodiment of the present invention, a device management system on a LIN bus is provided, including a master node and several slave nodes, and a cloud. The several slave nodes are connected to the LIN bus, and the master node is communicatively connected to the cloud. The master node includes the device as described in the above embodiment: the slave node includes a pluggable LIN interface for accessing a pluggable device and responding to a scheduling request from the master node; the cloud is used to manage a first scheduling table of the master node.
[0026] According to another aspect of an embodiment of the present application, a storage medium is further provided, which includes a stored program, and the above steps are executed when the program is run.
[0027] According to another aspect of an embodiment of the present application, an electronic device is also provided, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; wherein: the memory is used to store computer programs; the processor is used to execute the steps in the above method by running the program stored in the memory.
[0028] An embodiment of the present application also provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the steps in the above method.
[0029] Beneficial effects of the present invention:
[0030] 1. After the pluggable device of LIN bus communication is connected to the LIN physical interface, it can be discovered and identified by the vehicle. New devices connected to the LIN bus can be discovered in real time, which reflects the intelligence and automation of the car. It not only saves resources, but also meets safety and performance requirements. It also increases the user experience of plugging in the device and using it directly.
[0031] 2. Based on the second scheduling table, the offline status of devices on the LIN bus is monitored, and the LIN resources of the entire vehicle are saved during the dynamic adjustment process;
[0032] 3. When the vehicle has already left the factory but the manufacturer has developed new plug-in devices, a new first scheduling table is updated in the cloud. The vehicle can update the plug-in device list without updating the controller software. After the user inserts a new device on the LIN bus at any time, the vehicle can discover the device and communicate with the new device. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0034] Figure 1 This is a hardware structure block diagram of a car according to an embodiment of the present invention;
[0035] Figure 2 is a flow chart of a method for managing devices on a LIN bus according to an embodiment of the present invention;
[0036] Figure 3 1 is a system architecture diagram of the LIN bus in an embodiment of the present invention;
[0037] Figure 4 This is a flow chart of discovering device access on the LIN bus in an embodiment of the present invention;
[0038] Figure 5 This is a flow chart of detecting that a device on a LIN bus is offline in an embodiment of the present invention;
[0039] Figure 6 is a flow chart of updating a scheduling table in an embodiment of the present invention;
[0040] Figure 7 is a switching logic diagram of a scheduling table in an embodiment of the present invention;
[0041] Figure 8 The present invention is a block diagram of a device management apparatus on a LIN bus according to an embodiment of the present invention. DETAILED DESCRIPTION
[0042] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only embodiments of a part of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work should fall within the scope of protection of this application. It should be noted that, in the absence of conflict, the embodiments in the present application and the features in the embodiments can be combined with each other.
[0043] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0044] Example 1
[0045] The method embodiment provided in the first embodiment of the present application can be executed in a car, a server, a processor, an automatic driving / assisted driving / intelligent driving controller or a similar processing device. Taking running on a car as an example, Figure 1 This is a hardware structure diagram of a car according to an embodiment of the present invention. Figure 1 As shown, a car may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a microprocessor MCU or a programmable logic device FPGA and other processing devices) and a memory 104 for storing data. Optionally, the above-mentioned car may also include a transmission device 106 for communication functions and an input and output device 108. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned automobile. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.
[0046] Memory 104 can be used to store vehicle programs, such as software programs and modules of application software, such as a vehicle program corresponding to a device management method on a LIN bus of a vehicle in an embodiment of the present invention. Processor 102 executes the vehicle program stored in memory 104 to execute various functional applications and data processing, thereby implementing the aforementioned method. Memory 104 may include high-speed random access memory (RAM) and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, memory 104 may further include memory remotely located relative to processor 102, and such remote memory may be connected to the vehicle via a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0047] Transmission device 106 is used to receive or transmit data via a network. A specific example of such a network may include a wireless network provided by the vehicle's communications provider. In one embodiment, transmission device 106 includes a network interface controller (NIC), which can connect to other network devices via a base station to enable communication with the Internet. In another embodiment, transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0048] In this embodiment, a method for managing devices on a LIN bus is provided. Figure 2 FIG. 1 is a flow chart of a device management method on a LIN bus according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0049] Step S201: reading a first scheduling table stored locally in a controller of a LIN bus of a vehicle according to a first scheduling period, wherein the first scheduling table is used to store mapping relationships between device identifiers of all pluggable devices and LIN communication message identifiers;
[0050] The LIN bus of this embodiment includes a master node and multiple slave nodes. The controller on the master node serves as the master node for LIN communication. The controller manages the first dispatch table and has the authority to dispatch all IDs (identifiers) in the LIN dispatch table. The local storage unit stores the relationship between all pluggable device IDs and LIN communication message IDs. The device ID and message ID have a mandatory and unique mapping relationship and are uniformly managed by the system. The first dispatch table is also called the platform dispatch table. The device ID can be the device name or device code of the corresponding pluggable device. The message ID is used as the communication ID between the corresponding pluggable device, including the message ID carried in the call request sent to the device and the message ID carried in the reply message sent by the receiving device.
[0051] Figure 3 This is a system architecture diagram of the LIN bus in an embodiment of the present invention. The LIN bus includes a controller and multiple LIN interfaces for accessing pluggable devices (such as pluggable device 1, pluggable device 2, etc.). The controller includes a processor and a storage unit, and the controller is connected to the cloud.
[0052] The LIN bus system consists of a controller with LIN communication capabilities, external pluggable devices with LIN communication capabilities, a LIN interface for pluggable devices to connect to the vehicle's LIN bus, a cloud-based infrastructure that provides LIN-related information, and a module with mobile network communication. The controller, serving as the LIN communication master node, has the ability to schedule slave nodes on the LIN bus, identify node feedback, and dynamically switch between different schedules. The pluggable devices, serving as various slave nodes on the LIN bus, have the ability to respond to the master node's schedules and reply with relevant information. The cloud-based infrastructure manages schedule information and pluggable device information. The module with mobile network communication is capable of communicating with the cloud, verifying versions, downloading schedules, and distributing them to the controller. Slave nodes respond based on the master node's schedules.
[0053] The pluggable device is connected to the LIN interface of the vehicle's LIN bus and is connected to the controller through the vehicle wiring harness. The pluggable device can be connected to its LIN port through the exposed external interface. In addition, the controller writes the relevant information of the currently accessible device in the software and data storage unit in advance. The relevant information includes the communication address corresponding to each pluggable device. The controller will schedule according to the currently connected device, and periodically schedule the addresses of all pluggable devices stored in advance on the LIN bus, and monitor whether there is any feedback from the scheduled device. If feedback is received, the logic will be used to determine whether the device is currently connected, and the scheduling of this device will be added in the next scheduling.
[0054] Step S202: sending a first scheduling request to all pluggable devices on the LIN bus in sequence according to the first scheduling table, wherein the first scheduling request carries the LIN communication message identifier of the pluggable device in the first scheduling table;
[0055] Optionally, if the first scheduling table stores 10 pluggable devices, a first scheduling request needs to be sent to the 10 pluggable devices, and each first scheduling request carries the LIN communication message identifier of a pluggable device in the first scheduling table. If the sending interval of each pluggable device is 10ms, the duration of the first scheduling cycle is 100ms.
[0056] Step S203: monitoring a reply message returned by the first device based on the first scheduling request;
[0057] Optionally, the first device may be any pluggable device on the LIN bus, such as a rain sensor, a driving recorder, an ambient light, a speaker, etc.
[0058] If a pluggable device (e.g., the first device) in the first scheduling table is currently plugged into the LIN interface of the LIN bus, the pluggable device receives the LIN communication message identifier sent by the controller and determines whether it matches its own LIN communication message identifier. If so, the pluggable device appends its own data to the LIN communication message identifier according to the LIN bus requirements, encapsulates the data into a reply message, and returns it to the controller of the LIN bus master node. LIN communication message identifiers include the first message identifier and the second message identifier described below.
[0059] Step S204: determining, based on the reply message, that the first device is connected to the LIN bus;
[0060] Through the above steps, the first scheduling table locally stored in the controller of the vehicle's LIN bus is read according to the first scheduling period, wherein the first scheduling table is used to store the mapping relationship between the device identification of all pluggable devices and the LIN communication message identification; according to the first scheduling table, a first scheduling request is sent to all pluggable devices on the LIN bus in sequence, wherein the first scheduling request carries the LIN communication message identification of the pluggable device in the first scheduling table; the reply message returned by the first device based on the first scheduling request is monitored; according to the reply message, it is determined that the first device is connected to the LIN bus, which solves the technical problem in the related art that the vehicle's LIN bus cannot realize hot plugging of devices, and discovers newly connected devices on the LIN bus in real time, reflecting the intelligence and automation of the car, saving resources, meeting safety and performance requirements, and increasing the user's experience of directly using the device by plugging it in.
[0061] In one implementation of this embodiment, determining that the first device is connected to the LIN bus based on the reply message includes: parsing the padding data and the first message identifier in the reply message; determining whether the padding data is empty; if the padding data is not empty, searching the first device identifier that matches the first message identifier in the first scheduling table; and determining that the corresponding first device has been connected to the LIN bus based on the first device identifier.
[0062] Optionally, if the controller of the master node of the LIN bus does not receive a reply message returned by the first device based on the first scheduling request, it is considered that the first device is not connected to the LIN bus.
[0063] Optionally, if the filling data is not empty, it can be further determined whether the filling data matches the first message identifier. If it matches, the first device identifier that matches the first message identifier is searched in the first scheduling table to determine whether the first device corresponding to the first device identifier has been connected to the LIN bus.
[0064] Since the fill data is filled by the pluggable device (such as the first device) after receiving the first scheduling request sent by the controller of the master node of the LIN bus, the fill data of different pluggable devices can be different, so as to prevent unauthenticated third-party devices from forging themselves into the authenticated pluggable devices in the first scheduling table to access the LIN bus, thereby improving security.
[0065] In this embodiment, after determining that the first device is connected to the LIN bus based on the reply message, it also includes: searching for matching first LIN attribute information based on the first device identifier of the first device; updating the first message identifier and the first LIN attribute information to a second scheduling table locally stored in the controller, wherein the second scheduling table is used to store the mapping relationship between the LIN communication message identifiers and LIN attribute information of all pluggable devices currently connected to the vehicle.
[0066] Optionally, the first LIN attribute information can be stored locally in the controller or in the cloud, and the controller of the master node is communicatively connected to the cloud.
[0067] Optionally, if three pluggable devices (device 1, device 2, device 3) are currently connected to the vehicle's LIN bus, the second scheduling table will store the mapping relationship between the LIN communication message identifiers and LIN attribute information of the three pluggable devices.
[0068] Figure 4This is a flowchart of discovering device access on the LIN bus in an embodiment of the present invention. The platform scheduling table (first scheduling table) has the IDs and LIN communication message IDs of all devices that can be plugged into the LIN bus. The pluggable device is plugged into an exposed point (LIN interface) of a certain LIN network segment of the vehicle LIN bus and waits for the controller to schedule one of the message IDs of the pluggable device on the LIN bus. The process includes: scheduling devices according to the platform scheduling table, the controller switches to the platform scheduling table, scheduling according to the message ID of all pluggable devices in the platform scheduling table, and sending a scheduling request; judging whether the slave node message is replied, when the controller is scheduled to a certain message ID, it sends the message ID to the LIN bus, the pluggable device receives the message ID sent by the controller, and judges whether it is consistent with its own message ID. If it is consistent, according to the requirements of the LIN bus, it supplements its own data after this message ID and replies to the controller. If it is judged to be inconsistent with its own message ID, it does not reply to the controller. The controller judges that this message ID has data feedback and believes that this message ID has a device, and judges that the device is LIN message online. If the device does not reply, it is judged that the device is LIN message offline; for devices with LIN messages online, the controller maps it to the device online status, further queries the corresponding device information, and judges whether the device information of the device is already in the real vehicle scheduling table. If not, the device information of the device is added to the real vehicle scheduling table and the real vehicle scheduling table is updated. The controller identifies which pluggable device belongs to based on the message ID replied by the device and the platform scheduling table, and then determines whether the device is online. At the same time, based on the associated information in the platform scheduling table, the controller confirms the device ID, LIN attribute information and other device information corresponding to this message ID, and updates this device ID and LIN attribute information and other device information to the actual vehicle scheduling table (second scheduling table).
[0069] This makes it possible to discover devices and, based on the scheduling differences between the two scheduling tables, improves the speed at which the controller discovers devices connected to the LIN bus.
[0070] Optionally, after confirming that a device is connected to the LIN bus, the device ID can be passed to the cockpit system and displayed on the human-computer interaction interface to indicate that a new device has been discovered.
[0071] In one example, updating the device identifier to the locally stored second scheduling table includes: determining whether the first message identifier exists in the second scheduling table; if the first message identifier does not exist in the second scheduling table, associating the first message identifier and the first LIN attribute information and storing them in the second scheduling table.
[0072] The second scheduling table in this embodiment is used to store the LIN communication message ID and other LIN attribute information of all pluggable devices in the current vehicle, also known as the real vehicle scheduling table; the key attribute information related to the reception and transmission of communication messages contained in the two scheduling tables is also stored in the second scheduling table, including but not limited to the LIN segment ID of the LIN bus, the message ID under the corresponding segment, the message ID attribute, the message ID sending interval, the message ID scheduling order, the message data, the message length, etc.; wherein, the LIN segment ID is used by the controller to select which LIN segment to use for communication with this device among all the LIN segments to which this vehicle is connected; the message ID is used as the communication ID between this pluggable device, including the ID sent to the device and the ID receiving the information sent by the device; the attribute of the message ID is used to allow the controller to identify whether each ID is for communication with the device, whether it is the ID for sending information or the ID for receiving information; the ID is sent The interval is used to adjust the frame interval time of LIN communication between different devices and adapt to the characteristics of different devices; the message ID scheduling order is used to adjust the order between different devices and is used for priority scheduling of high-priority devices. At the same time, when the controller can only define fixed-length arrays, it can identify invalid arrays to save chip transportation resources; the message data is the actual original LIN message sent to or received from the device, and is used by the upper layer to parse the interaction information of this device; the message length is based on the fixed length of 8 bytes of LIN bus data, but different devices may not need such a long length. The actual length of data required is identified by this field. All attributes related to the reception and transmission of LIN bus messages, such as the above-mentioned segment ID, message ID, message ID attributes, etc., can be defined or customized according to the LIN bus standard. The controller can be designed with specific fields to store and dynamically modify the parameters of these attributes.
[0073] In another implementation scenario of this embodiment, it also includes: reading a second scheduling table locally stored in the controller according to a second scheduling period, wherein the second scheduling table is used to store the mapping relationship between the LIN communication message identifiers and LIN attribute information of all pluggable devices currently connected to the vehicle; sending a second scheduling request to all pluggable devices on the LIN bus in sequence according to the second scheduling table, wherein the second scheduling request carries the LIN communication message identifier of the pluggable device in the second scheduling table; monitoring the message response status of the second device to the second scheduling request; and determining that the second device is offline on the LIN bus based on the message response status.
[0074] Optionally, the message response status includes a message loss status and a message reply status. If the second message responds to the second scheduling request and replies to the message normally, it is a message reply status. If the second message does not respond to the second scheduling request and does not reply to the message normally (or does not reply to the message), it is a message loss status.
[0075] There are currently three pluggable devices (device 1, device 2, device 3) connected to the vehicle's LIN bus. The second scheduling table sends the second scheduling request to device 1, device 2, and device 3 in sequence according to the second scheduling period, and determines whether the device is offline based on the message response status of the corresponding device.
[0076] In one example, determining that the second device is in an offline state on the LIN bus based on the message response status includes: if the message response status is a message loss state, searching for the second device to which the second message identifier belongs according to the first scheduling table; querying the historical message response status of the second device in several historical scheduling cycles of the second scheduling table; and confirming that the second device is in an offline state on the LIN bus based on the historical message response status.
[0077] Optionally, the historical message response status of the second device in the previous two historical scheduling cycles can be queried, and the message response status of the second device in three consecutive scheduling cycles can be used to determine whether it is offline to prevent misjudgment. The historical message response status of this embodiment can be stored locally in the controller of the master node of the LIN bus or in the cloud.
[0078] In one embodiment, confirming that the second device is in an offline state on the LIN bus based on the historical message response status includes: determining whether the historical message response statuses are all message loss states; if the historical message response statuses are all message loss states, determining that the second device is in an offline state on the LIN bus, and updating the second scheduling table.
[0079] If the second device is in an offline state on the LIN bus, the second device is deleted from the second scheduling table.
[0080] In another embodiment, after determining whether all the historical message response states are message loss states, the method further includes: if all the historical message response states are not message loss states, determining that the second device is in a fault state.
[0081] If the second device is in the message loss state and the message response state simultaneously within a plurality of consecutive scheduling periods, the second device may have a fault, such as a loose plug-in interface, a fault in the internal controller of the second device, etc.
[0082] Figure 5This is a flowchart of an embodiment of the present invention for detecting that a device on a LIN bus is offline. When a device is unplugged from the LIN bus, the device cannot communicate with the controller, and all messages cannot communicate. The process of detecting that a LIN bus device fails or is offline includes: the controller schedules the message IDs of all devices on the LIN bus according to the actual vehicle scheduling table (second scheduling table). Since the device is unplugged, the slave node message is not replied, and the controller cannot receive all messages from the device, and it is determined that the LIN message is lost; the messages of other slave nodes that have not been unplugged from the LIN bus can be replied normally, and it is determined that the LIN message is online; the controller maps the device offline status according to the response status of all messages, queries the corresponding device information, determines whether all LIN messages of the corresponding device are in the message loss status, and confirms whether all messages associated with a certain device are lost. If all are lost, it is determined that the device is offline.
[0083] Optionally, the controller may feed back the offline status of the device to the human-computer interaction system, and transmit the device offline information to the human-computer interaction system for display.
[0084] When the controller schedules the message ID of a pluggable device of a slave node in the actual vehicle scheduling table, the slave node does not respond to a single message, and the controller feedback fault information to the human-computer interaction system. If multiple scheduling request messages are not responded to, it is determined to be offline.
[0085] In one implementation of this embodiment, before reading the first scheduling table locally stored in the controller of the vehicle's LIN bus according to the first scheduling period, it also includes: receiving a scheduling table update request from the cloud, wherein the scheduling table update request carries the latest version of the first scheduling table; and updating the first scheduling table locally based on the scheduling table update request.
[0086] Optionally, receiving a scheduling table update request from the cloud includes: reading the first version information of the locally stored first scheduling table, and obtaining the latest second version information of the first scheduling table on the cloud; determining whether the first version information is the same as the second version information; if the first version information is not the same as the second version information, receiving a scheduling table update request from the cloud.
[0087] Optionally, the scheduling table update request may be proactively sent by the cloud, or may be sent by the cloud after the controller of the master node of the LIN bus sends an update request to the cloud.
[0088] Cloud maintenance platform schedule (first schedule): When a new device is plugged in or out, the factory staff enters the device's related information into the cloud system, including the device ID, the LIN network segment it belongs to, the message ID it owns, the ID's related attributes, the schedule's related attributes, etc., and generates a new platform schedule version.
[0089] Figure 6 This is a flowchart of the schedule update in an embodiment of the present invention. When the controller updates the platform schedule, it imports the latest platform schedule for the current node when generating it. This avoids network issues during vehicle production, which can lead to the lack of an internal platform schedule and the inability to detect device problems. When a vehicle has already been produced but the manufacturer has developed new plug-in devices, the cloud updates a new platform schedule. When the controller needs to update the platform schedule, it uses the mobile cellular network and the manufacturer's dedicated line to verify and compare the version number of the current platform schedule with the version number on the cloud. After a series of operations, such as a check and comparison, the cloud determines that an update is needed, or when the integrated control determines that an update is needed, the vehicle downloads the latest manufacturer-approved platform schedule containing the plug-in device ID and LIN-related information.
[0090] Since then, it has been completed that when the car manufacturer updates the plug-in device list without updating the controller software, the user can purchase the plug-in device and plug in the plug-in device, and the vehicle can discover the device and communicate with the device.
[0091] The first scheduling table (platform scheduling table) and the second scheduling table (real vehicle scheduling table) of this embodiment can be called cyclically. Figure 7 It is a switching logic diagram of the scheduling table in the embodiment of the present invention. The platform scheduling table has a full amount of pluggable device information, and the real vehicle scheduling table only has information on the currently plugged in devices. The two scheduling tables switch cyclically, and the current time is determined by timing to determine which scheduling table the current time corresponds to. For example, the total scheduling cycle is 100ms, the scheduling cycle of the platform scheduling table is 90ms, and the scheduling cycle of the real vehicle scheduling table is 10ms. If the current time is 60ms, it corresponds to the platform scheduling table. Because the platform scheduling table has more full amount of pluggable information, the scheduling time is too long, and the communication time per cycle between the pluggable device and the controller is long. This scheduling table is only used to send the message ID in this table to confirm whether there is a new device Plug in. If plugged in, it will reply when the platform schedule is scheduled, and the controller determines that a new device is connected; the real vehicle schedule is based on the characteristic that the vehicle cannot have all pluggable devices (for example, there are two switches in the platform schedule, but a single vehicle can only choose to plug in one). The real vehicle schedule is mainly used for short-cycle information interaction between the plugged in device and the controller, which can improve communication efficiency and enhance user experience. There is no time requirement here, and all time belongs to the schedule switching logic; the platform schedule only schedules one cycle; the real vehicle schedule schedules no less than 20 cycles, and the actual number of cycles is automatically adjusted according to the number of IDs in the real vehicle schedule to meet the needs of fast functional response when the user operates the device.
[0092] This embodiment provides a device management method for the LIN bus. After a pluggable device communicating via the LIN bus is connected to a LIN physical interface, the vehicle control system can discover and identify the specific device. Communication time and content can be dynamically adjusted based on the number of devices. After the device is connected and interacts with the user, vehicle control is completed. In traditional vehicles, to ensure a good user experience, pre-installed LIN-based ECUs typically limit the number of nodes on a single bus. However, pluggable devices offer the flexibility of plugging and unplugging, as well as a wide variety of available devices. After combining the two requirements, the traditional solution defines multiple devices on a single LIN bus, but when not all defined devices are connected, the master node calling the empty device node will occupy the communication time; or the car develops multiple LIN buses to connect pluggable devices, but when no devices are connected, the car bus resources will be occupied; this solution meets the needs of real-time device discovery and has targeted improvements in dynamically adjusting communication time. In the process of dynamic adjustment, it also saves the LIN resources of the entire vehicle; the advantage of real-time device discovery is that users do not need to interact with plug-in devices according to the solution for adding devices, which reflects the intelligence and automation of the car, saves resources, meets safety and performance requirements, and increases the user experience of plugging in the device and using it directly.
[0093] Through the description of the above embodiments, those skilled in the art will clearly understand that the methods according to the above embodiments can be implemented using software plus the necessary general-purpose hardware platform. Of course, hardware can also be used, but in many cases the former is a more preferred embodiment. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, or optical disk) and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of the present invention.
[0094] Example 2
[0095] This embodiment also provides a device management device on a LIN bus, which is used to implement the above-mentioned embodiments and preferred embodiments. Details already described will not be repeated here. As used below, the term "module" may refer to a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation using hardware, or a combination of software and hardware, is also possible and contemplated.
[0096] Figure 8 1 is a structural block diagram of a device management apparatus on a LIN bus according to an embodiment of the present invention. Figure 8As shown, the device is applied to the controller of the master node of the LIN bus, and includes:
[0097] A first reading module 81 is configured to read a first scheduling table stored locally in a controller of a LIN bus of a vehicle according to a first scheduling period, wherein the first scheduling table is configured to store mappings between device identifiers of all pluggable devices and LIN communication message identifiers;
[0098] A first sending module 82 is configured to send a first scheduling request to all pluggable devices on the LIN bus in sequence according to the first scheduling table, wherein the first scheduling request carries a LIN communication message identifier of the pluggable device in the first scheduling table;
[0099] A first monitoring module 83, configured to monitor a reply message returned by the first device based on the first scheduling request;
[0100] The first determining module 84 is configured to determine, based on the reply message, whether the first device is connected to the LIN bus.
[0101] Optionally, the first determination module includes: a parsing unit for parsing the padding data and the first message identifier in the reply message; a judgment unit for judging whether the padding data is empty; a search unit for searching the first device identifier that matches the first message identifier in the first scheduling table if the padding data is not empty; and a determination unit for determining, based on the first device identifier, that the corresponding first device has been connected to the LIN bus.
[0102] Optionally, the device also includes: a search module, used to search for matching first LIN attribute information based on the first device identifier of the first device after the first determination module determines that the first device is connected to the LIN bus according to the reply message; a first update module, used to update the first message identifier and the first LIN attribute information to a second scheduling table locally stored in the controller, wherein the second scheduling table is used to store the mapping relationship between the LIN communication message identifiers and LIN attribute information of all pluggable devices currently connected to the vehicle.
[0103] Optionally, the first update module includes: a judgment unit, used to judge whether the first message identifier exists in the second scheduling table; and a storage unit, used to associate the first message identifier and the first LIN attribute information and store them in the second scheduling table if the first message identifier does not exist in the second scheduling table.
[0104] Optionally, the device also includes: a second reading module, used to read the second scheduling table locally stored in the controller according to a second scheduling period, wherein the second scheduling table is used to store the mapping relationship between the LIN communication message identifiers and LIN attribute information of all pluggable devices currently connected to the vehicle; a second sending module, used to send a second scheduling request to all pluggable devices on the LIN bus in sequence according to the second scheduling table, wherein the second scheduling request carries the LIN communication message identifier of the pluggable device in the second scheduling table; a second monitoring module, used to monitor the message response status of the second device to the second scheduling request; a second determination module, used to determine that the second device is offline on the LIN bus based on the message response status.
[0105] Optionally, the second determination module includes: a search unit, used to search for the second device to which the second message identifier belongs according to the first scheduling table if the message response status is a message loss status; a query unit, used to query the historical message response status of the second device in several historical scheduling cycles of the second scheduling table; and a determination unit, used to confirm that the second device is offline on the LIN bus based on the historical message response status.
[0106] Optionally, the determination unit includes: a judgment subunit, used to determine whether the historical message response statuses are all message loss statuses; a first determination subunit, used to determine that the second device is offline on the LIN bus if the historical message response statuses are all message loss statuses, and update the second scheduling table.
[0107] Optionally, the determination unit further includes: a second determination subunit, configured to determine that the second device is in a fault state after the judgment subunit determines whether the historical message response statuses are all message loss states, and if the historical message response statuses are not all message loss states.
[0108] Optionally, the device also includes: a receiving module, used to receive a scheduling table update request from the cloud before the first reading module reads the first scheduling table locally stored in the controller of the vehicle's LIN bus according to the first scheduling period, wherein the scheduling table update request carries the latest version of the first scheduling table; a second update module, used to locally update the first scheduling table based on the scheduling table update request.
[0109] Optionally, the receiving module includes: a reading unit for reading the first version information of the locally stored first scheduling table and obtaining the latest second version information of the first scheduling table on the cloud; a judgment unit for judging whether the first version information is the same as the second version information; and a receiving unit for receiving a scheduling table update request from the cloud if the first version information is different from the second version information.
[0110] This embodiment also provides a device management system on a LIN bus, including a master node and several slave nodes, and a cloud. The several slave nodes are connected to the LIN bus, and the master node is communicatively connected to the cloud. The master node includes the device described in the above embodiment: the slave node includes a pluggable LIN interface for accessing a pluggable device and responding to the scheduling request of the master node; the cloud is used to manage the first scheduling table of the master node.
[0111] It should be noted that the above modules can be implemented through software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0112] Example 3
[0113] An embodiment of the present invention further provides a storage medium storing a computer program, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0114] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:
[0115] S1, reading a first scheduling table stored locally in a controller of a LIN bus of a vehicle according to a first scheduling period, wherein the first scheduling table is used to store mapping relationships between device identifiers of all pluggable devices and LIN communication message identifiers;
[0116] S2, sending a first scheduling request to all pluggable devices on the LIN bus in sequence according to the first scheduling table, wherein the first scheduling request carries the LIN communication message identifier of the pluggable device in the first scheduling table;
[0117] S3, monitoring a reply message returned by the first device based on the first scheduling request;
[0118] S4: Determine, according to the reply message, whether the first device is connected to the LIN bus.
[0119] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.
[0120] An embodiment of the present invention further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0121] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0122] Optionally, in this embodiment, the processor may be configured to execute the following steps through a computer program:
[0123] S1, reading a first scheduling table stored locally in a controller of a LIN bus of a vehicle according to a first scheduling period, wherein the first scheduling table is used to store mapping relationships between device identifiers of all pluggable devices and LIN communication message identifiers;
[0124] S2, sending a first scheduling request to all pluggable devices on the LIN bus in sequence according to the first scheduling table, wherein the first scheduling request carries the LIN communication message identifier of the pluggable device in the first scheduling table;
[0125] S3, monitoring a reply message returned by the first device based on the first scheduling request;
[0126] S4: Determine, according to the reply message, whether the first device is connected to the LIN bus.
[0127] Optionally, specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0128] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.
[0129] Through the description of the above embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software plus a general hardware platform, or of course, hardware. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the relevant technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for causing a computer device (such as a personal computer, server, or network device) to execute the methods described in each embodiment or certain portions of the embodiments.
[0130] It should be understood that the terms used herein are for the purpose of describing specific example embodiments only and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "comprise", "include", "contain" and "have" are inclusive and therefore specify the presence of stated features, steps, operations, elements and / or parts, but do not exclude the presence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not to be construed as necessarily requiring them to be performed in the specific order described or illustrated, unless the order of execution is clearly indicated. It should also be understood that additional or alternative steps may be used.
[0131] The foregoing description is intended only to provide specific embodiments of the present invention, which will enable those skilled in the art to understand and implement the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not intended to be limited to the embodiments shown herein, but is intended to be accorded the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A device management method on a LIN bus, characterized in that: Applied to the controller of the master node of the LIN bus, including: Reading a first scheduling table stored locally in a controller of a LIN bus of the vehicle according to a first scheduling period, wherein the first scheduling table is used to store mapping relationships between device identifiers of all pluggable devices and LIN communication message identifiers; Sending a first scheduling request to all pluggable devices on the LIN bus in sequence according to the first scheduling table, wherein the first scheduling request carries the LIN communication message identifier of the pluggable device in the first scheduling table; monitoring a reply message returned by the first device based on the first scheduling request; Determining, according to the reply message, that the first device is connected to the LIN bus; Among them, determining that the first device is connected to the LIN bus based on the reply message includes: parsing the padding data and the first message identifier in the reply message; judging whether the padding data is empty; if the padding data is not empty, searching the first device identifier that matches the first message identifier in the first scheduling table; and determining that the corresponding first device has been connected to the LIN bus based on the first device identifier.
2. The method according to claim 1, characterized in that After determining, according to the reply message, that the first device is connected to the LIN bus, the method further includes: searching for matching first LIN attribute information based on a first device identifier of the first device; The first message identifier and the first LIN attribute information of the first device are updated to a second scheduling table locally stored in the controller, wherein the second scheduling table is used to store the mapping relationship between the LIN communication message identifiers and LIN attribute information of all pluggable devices currently connected to the vehicle.
3. The method according to claim 2, characterized in that Updating the device identification to the locally stored second scheduling table includes: Determine whether the first message identifier exists in the second scheduling table; If the first message identifier does not exist in the second scheduling table, the first message identifier and the first LIN attribute information are associated and stored in the second scheduling table.
4. The method according to claim 1, wherein The method further comprises: Reading a second scheduling table locally stored in the controller according to a second scheduling period, wherein the second scheduling table is used to store a mapping relationship between LIN communication message identifiers and LIN attribute information of all pluggable devices currently connected to the vehicle; Sending a second scheduling request to all pluggable devices on the LIN bus in sequence according to the second scheduling table, wherein the second scheduling request carries the LIN communication message identifier of the pluggable device in the second scheduling table; monitoring a message response status of the second device to the second scheduling request; Determine, based on the message response status, that the second device is in an offline state on the LIN bus.
5. The method according to claim 4, characterized in that Determining, according to the message response status, that the second device is in an offline state on the LIN bus includes: If the message response status is a message lost status, searching the second device to which the second message identifier belongs according to the first scheduling table; querying a historical message response status of the second device in several historical scheduling periods of the second scheduling table; According to the historical message response status, it is confirmed that the second device is in an offline state on the LIN bus.
6. The method according to claim 5, characterized in that Confirming, according to the historical message response status, that the second device is in an offline state on the LIN bus includes: Determine whether the historical message response statuses are all message loss statuses; If the historical message response statuses are all message loss statuses, it is determined that the second device is in an offline state on the LIN bus, and the second scheduling table is updated.
7. The method according to claim 6, characterized in that After determining whether the historical message response statuses are all message loss statuses, the method further includes: If the historical message response statuses are not all message loss statuses, it is determined that the second device is in a fault state.
8. The method according to claim 1, characterized in that Before reading a first scheduling table stored locally in a controller of a LIN bus of a vehicle according to a first scheduling period, the method further includes: Receiving a schedule update request from the cloud, wherein the schedule update request carries the latest version of the first schedule; The first schedule is updated locally based on the schedule update request.
9. The method according to claim 8, characterized in that Receiving a schedule update request from the cloud includes: Reading the first version information of the locally stored first scheduling table, and obtaining the latest second version information of the first scheduling table on the cloud; Determining whether the first version information is the same as the second version information; If the first version information is different from the second version information, a schedule update request from the cloud is received.
10. A device management device on a LIN bus, characterized in that: Applied to the controller of the master node of the LIN bus, including: A first reading module is configured to read a first scheduling table stored locally in a controller of a LIN bus of a vehicle according to a first scheduling period, wherein the first scheduling table is configured to store mapping relationships between device identifiers of all pluggable devices and LIN communication message identifiers; A first sending module, configured to send a first scheduling request to all pluggable devices on the LIN bus in sequence according to the first scheduling table, wherein the first scheduling request carries a LIN communication message identifier of the pluggable device in the first scheduling table; A first monitoring module, configured to monitor a reply message returned by the first device based on the first scheduling request; A first determining module, configured to determine, based on the reply message, whether the first device is connected to the LIN bus; Among them, the first determination module includes: a parsing unit, used to parse the padding data and the first message identifier in the reply message; a judgment unit, used to judge whether the padding data is empty; a search unit, used to search the first device identifier matching the first message identifier in the first scheduling table if the padding data is not empty; and a determination unit, used to determine, based on the first device identifier, that the corresponding first device has been connected to the LIN bus.
11. A device management system on a LIN bus, characterized in that: It includes a master node and several slave nodes, and a cloud. The several slave nodes are connected to the LIN bus, and the master node is in communication connection with the cloud. The master node comprises the apparatus according to claim 10: The slave node includes a pluggable LIN interface for accessing a pluggable device and responding to a scheduling request from the master node; The cloud end is used to manage the first scheduling table of the master node.
12. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 9 when executed.
13. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Method and apparatus for monitoring network device
CN106230658A
Message processing method and device
CN107547505A