A bus device management system and control method thereof
By designing a bus equipment management system, including a bus management unit and a device management unit, the problems of complex adaptation of interconnected buses and difficulty in troubleshooting in the existing technology are solved, and unified management and automatic configuration of different interconnected buses are realized, learning costs and troubleshooting difficulties are reduced.
Patent Information
- Application Number
- CN202411838467.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2044-12-13
AI Technical Summary
In the existing bus device management technology, interconnected bus adaptation work is limited to basic bus driver adaptation, which leads to the service layer needing to configure bus information separately and use specific interactive logic, which increases learning cost and troubleshooting difficulty.
A bus device management system is designed, including a driver layer, a business layer and a device management layer. The device management layer includes a bus management unit and a device management unit. By automatically configuring the basic information of the bus and real-time monitoring of the bus discovery signal, a unified device configuration interface and a bus interactive device interface are provided.
It realizes unified management of different interconnected buses, reduces the learning cost of business software engineers, improves the efficiency of bus equipment troubleshooting, and dynamically discovers interconnected buses, automatically configures bus devices, blocks down the underlying details, and simplifies business application development.
Smart Images

Figure CN119292686B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of embedded operating system bus device management, and in particular to a bus device management system and a control method thereof. Background Art
[0002] Embedded processors have evolved from early low-performance, low-power microcontrollers (MCUs) to today's high-frequency, multi-core, GPU, and NPU-enabled high-performance processors, accompanied by increasing requirements for interconnection buses. In order to adapt to various industry segments, interconnection bus technologies are becoming increasingly diverse, such as UART, TSN, FC, 429, etc. Various buses have different physical layer and link layer implementation methods to meet the needs of specific industries, which brings a lot of adaptation, tuning, and troubleshooting work.
[0003] In the existing bus device management technology, the interconnection bus adaptation work is limited to the basic bus driver adaptation. Due to the large differences in the implementation and interaction logic of various interconnection bus drivers, the business layer needs to configure the bus information separately and use specific interaction logic to achieve interactive communication with the bus devices. The differences in interconnection buses are obvious. On the one hand, it increases the learning cost of business layer software engineers. On the other hand, when encountering bus failures, specific bus engineers are required to conduct targeted troubleshooting, and it is impossible to accurately locate the fault from a unified perspective.
[0004] Therefore, there is an urgent need to provide a bus device management system and a control method thereof to solve the defects and shortcomings in the above-mentioned prior art. Summary of the invention
[0005] In order to solve the defects and shortcomings in the prior art, the present invention provides a bus device management system and a control method thereof.
[0006] The specific scheme provided by the present invention is:
[0007] A bus device management system, the system comprises a driver layer and a business layer, characterized in that: it also comprises a device management layer arranged between the driver layer and the business layer, and the device management layer is respectively connected with the driver layer and the business layer by signal;
[0008] The device management layer includes a bus management unit and a device management unit, wherein:
[0009] The bus management unit includes a plurality of configuration items, which automatically performs device configuration during bus initialization to provide a unified device configuration interface;
[0010] The device management unit includes a bus device discovery unit and a bus device creation unit, which provide a corresponding bus interaction device interface for the business layer.
[0011] As a further preferred embodiment of the present invention,
[0012] The bus management unit configures the corresponding configuration items according to the preset priority; wherein,
[0013] The configuration items at least include bus type configuration, bus parameter configuration and protocol parameter configuration;
[0014] The preset priority is that the priority of bus type configuration is higher than the priority of bus parameter configuration, and the priority of bus parameter configuration is higher than the priority of protocol parameter configuration;
[0015] The bus management unit chooses to automatically configure the device during the bus initialization process in the form of a configuration file. The bus management unit first loads the bus configuration information through a preset configuration file. The bus management unit then loads and parses the configuration file at startup, and performs initialization operations respectively according to the bus configuration information scanned by the device management unit.
[0016] As a further preferred embodiment of the present invention,
[0017] In the device management unit,
[0018] The bus device discovery unit monitors the bus discovery signal in real time, and when the real-time monitoring result determines that the newly discovered bus already exists, confirms to send the device discovery signal;
[0019] The bus device creation unit creates a unified device according to the received device discovery signal, then cancels the invalid device and synchronizes the current real-time status of the device.
[0020] Furthermore, the present invention also provides a control method for a bus device management system, which is characterized by comprising the following steps:
[0021] S1: Start the corresponding driver project in the driver layer;
[0022] S2: The device management layer interacts with the bus driver to complete basic configuration, provide a unified device configuration interface, and release a bus maintenance signal;
[0023] S3: The device management layer creates and cancels devices according to whether the bus and device are found, so as to provide the business layer with the corresponding bus interaction device interface;
[0024] S4: The business layer performs the required business applications through the corresponding bus interaction device interface.
[0025] As a further preferred embodiment of the present invention, the step S2 includes the following steps:
[0026] S21: Start the bus management unit;
[0027] S22: Select the required configuration item;
[0028] S23: Detecting the validity of the selected configuration item; detecting the validity of the selected configuration item at least includes:
[0029] A) Check whether the valid range of parameters of various bus configuration items meets the preset requirements;
[0030] B) Check whether the configuration format requirements of various bus configuration items meet the preset requirements;
[0031] C) Checking whether there is a conflict between the parameters of the preset bus;
[0032] S24: Enumerate interconnect buses;
[0033] S25: Determine whether the enumeration process is completed, and perform subsequent corresponding steps according to the determination result.
[0034] As a further preferred embodiment of the present invention, the step S25 includes the following steps:
[0035] S251: When it is determined that the current enumeration process is finished, determining that the single enumeration is finished;
[0036] S252: When it is determined that the current enumeration process is not finished, determine whether the bus has been configured, and perform subsequent corresponding steps according to the determination result.
[0037] As a further preferred embodiment of the present invention, the step S252 includes the following steps:
[0038] S2521: When it is determined that the bus has been configured, determining that the single enumeration is finished;
[0039] S2522: When it is determined that the bus is not configured, obtain and configure the basic information of the bus, then release the bus maintenance signal, and finally determine that the single enumeration is completed.
[0040] As a further preferred embodiment of the present invention, the step S3 includes the following steps:
[0041] S31: Start the device management unit;
[0042] S32: Initialize device management structure;
[0043] S33: real-time monitoring of bus discovery signals;
[0044] S34: Determine whether the newly discovered bus already exists;
[0045] S35: Perform subsequent corresponding steps according to the determination result.
[0046] As a further preferred embodiment of the present invention, the step S35 includes the following steps:
[0047] S351: When it is determined that the newly discovered bus does not exist, the single detection is determined to be finished;
[0048] S352: When it is determined that the newly discovered bus already exists, the bus is first added to the maintenance list, and then the device discovery protocol is started, and then it is determined whether the device is found, and subsequent corresponding steps are performed according to the determination result.
[0049] As a further preferred embodiment of the present invention, the step S352 includes the following steps:
[0050] S3521: When it is determined that no device is found, determining that the single detection is completed;
[0051] S3522: When it is determined that a device is discovered, a unified device is first created, then invalid devices are deregistered, and the current real-time status of the device is synchronized, and finally a single detection is determined to be completed.
[0052] Compared with the prior art, the present invention can achieve the following technical effects:
[0053] 1) The present invention provides a bus device management system and a control method thereof. By providing a device management layer, the differences between various interconnected buses can be shielded to reduce the learning cost of business software engineers, while providing a unified abstract perspective to improve the efficiency of troubleshooting after bus device failures.
[0054] 2) The present invention provides a bus device management system and a control method thereof. By providing a device management layer, the interconnected bus can be dynamically discovered, basic bus information can be automatically configured, and a bus discovery signal can be generated. The bus devices can be automatically scanned, bus discovery signals can be monitored, and bus devices can be automatically scanned. A unified interaction entry can be created for newly discovered devices to shield underlying details for business applications. Automatic bus management and automatic bus device management can be realized, and business developers do not need to pay attention to details such as bus characteristics and device management, and can quickly complete the interaction between business applications and various bus devices.
[0055] 3) The present invention provides a bus device management system and a control method thereof. By providing a bus management unit, device configuration can be automatically performed during the bus initialization process in a configuration file manner or a device tree manner. While providing a unified device configuration interface, a bus maintenance signal is released to notify the device management unit to perform bus device management.
[0056] 4) The present invention provides a bus device management system and a control method thereof. By providing a device management unit, the bus discovery signal can be monitored in real time. When the real-time monitoring result determines that the newly discovered bus already exists, the sending of the device discovery signal is confirmed; and a unified device can be created and invalid devices can be cancelled according to the received device discovery signal, and the current real-time status of the device can be synchronized. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 Shown is a logical structure diagram of a bus device management system provided by the present invention.
[0058] Figure 2 Shown is a step flow chart of the bus management unit provided by the present invention.
[0059] Figure 3 Shown is a step flow chart of the device management unit provided by the present invention. DETAILED DESCRIPTION
[0060] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0061] In the description of the present invention, it should be noted that the terms "upper", "lower", "inner", "outer", "front end", "rear end", "two ends", "one end", "the other end" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance.
[0062] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "provided with", "connected", etc. should be understood in a broad sense. For example, "connected" can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0063] [First embodiment]
[0064] like Figure 1The first embodiment provided by the present invention is shown, and this embodiment provides a bus device management system. The system includes a driver layer and a business layer, and also includes a device management layer arranged between the driver layer and the business layer, and the device management layer is respectively connected to the driver layer and the business layer signals. By setting up the device management layer, the differences between various types of interconnected buses can be shielded to reduce the learning cost of business software engineers, and at the same time, a unified abstract perspective is provided to improve the efficiency of troubleshooting after bus device failures.
[0065] like Figure 1 As shown, the device management layer in this embodiment includes a bus management unit and a device management unit, wherein:
[0066] The bus management unit includes multiple configuration items. As the basic component of the device management layer, it automatically configures the device during the bus initialization process to provide a unified device configuration interface;
[0067] In this embodiment, the bus management unit configures the corresponding configuration items according to the preset priority; wherein,
[0068] Configuration items at least include bus type configuration, bus parameter configuration and protocol parameter configuration; bus type configuration includes both device type configuration and bus type configuration, bus parameter configuration includes device address, communication rate, bus specific parameters and other configurations, and protocol parameter configuration should at least include the selected upper layer protocol, port and its corresponding parameter information configuration, etc.;
[0069] The preset priority is that the priority of bus type configuration is higher than the priority of bus parameter configuration, and the priority of bus parameter configuration is higher than the priority of protocol parameter configuration; this is because different types of devices and buses have different corresponding device addresses, communication rates, bus parameters, etc., so it is necessary to prioritize the bus type configuration to prioritize the type of bus and device. On the basis that the bus type and bus parameters have been determined, the upper-layer protocol, port and its corresponding parameter information can be selected accordingly according to actual needs, so the priority of protocol parameter configuration can be set to the lowest.
[0070] Preferably, the bus management unit in this embodiment selects to automatically configure the device in the process of bus initialization in the configuration file mode. When the device is configured in the configuration file mode, the bus management unit first loads the bus configuration information through the preset configuration file, and then loads and parses the configuration file at startup, and performs initialization operations respectively according to the bus configuration information scanned by the device management unit. It should be understood by those skilled in the art that the bus management unit in this embodiment can also choose to automatically configure the device in the process of bus initialization in other ways, such as the device tree mode, etc.
[0071] The device management unit includes a bus device discovery unit and a bus device creation unit. As the core component of the device management layer, it provides the corresponding bus interaction device interface for the business layer.
[0072] The bus device discovery unit uses the device detection protocol to monitor the bus discovery signal in real time. When the real-time monitoring results determine that the newly discovered bus exists, it confirms the sending of the device discovery signal; the detection process is generally to identify the bus, detect and scan the bus devices, and initialize and configure the bus devices.
[0073] The bus device creation and sales unit first creates a unified device according to the received device discovery signal, then cancels the invalid device, and synchronizes the current real-time status of the device. The synchronized status information should include both creation status information and cancellation status information, and their synchronization actions correspond to the creation and cancellation actions and are performed simultaneously, that is, the creation status information is synchronized when creating a unified device, and the cancellation status information is synchronized when canceling an invalid device.
[0074] [Second embodiment]
[0075] The second embodiment of the present invention further provides a control method for the bus device management system mentioned in the first embodiment, comprising the following steps:
[0076] S1: Start the corresponding driver project in the driver layer;
[0077] S2: The device management layer interacts with the bus driver to complete basic configuration, provide a unified device configuration interface, and release a bus maintenance signal;
[0078] like Figure 2 As shown, the specific steps include:
[0079] S21: Start the bus management unit;
[0080] S22: Select the required configuration item;
[0081] S23: Detecting the validity of the selected configuration items; detecting the validity of the selected configuration items at least includes: A) detecting whether the parameter valid range of each bus configuration item meets the preset requirements; B) detecting whether the configuration format requirements of each bus configuration item meet the preset requirements; C) detecting whether there are conflicts between the parameters of the preset specific bus, etc.;
[0082] S24: Enumerate interconnected buses; the enumeration method is mainly based on bus device detection, and the specific process is to identify the bus, detect and scan the bus devices, and initialize and configure the bus devices;
[0083] S25: Determine whether the enumeration process is completed, and perform subsequent corresponding steps according to the determination result;
[0084] The specific steps include:
[0085] S251: When it is determined that the current enumeration process is finished, determining that the single enumeration is finished;
[0086] S252: When it is determined that the current enumeration process is not finished, determine whether the bus has been configured, and perform subsequent corresponding steps according to the determination result;
[0087] The specific steps include:
[0088] S2521: When it is determined that the bus has been configured, determining that the single enumeration is finished;
[0089] S2522: When it is determined that the bus is not configured, obtain and configure the basic bus information, the basic bus information including the bus type, bus parameters and protocol parameters, and then release the bus maintenance signal, and finally determine that the single enumeration is completed.
[0090] S3: The device management layer creates and cancels devices according to whether the bus and device are found, so as to provide the business layer with the corresponding bus interaction device interface;
[0091] like Figure 3 As shown, the specific steps include:
[0092] S31: Start the device management unit;
[0093] S32: Initialize the device management structure; the initialized device management structure mainly includes a global device table, device status and structured configuration information, etc.;
[0094] S33: real-time monitoring of bus discovery signals;
[0095] S34: Determine whether the newly discovered bus already exists;
[0096] S35: Perform subsequent corresponding steps according to the determination result;
[0097] The specific steps include:
[0098] S351: When it is determined that the newly discovered bus does not exist, the single detection is determined to be finished;
[0099] S352: When it is determined that the newly discovered bus already exists, the bus is first added to the maintenance list, and then the device discovery protocol is started, and then it is determined whether the device is found, and subsequent corresponding steps are performed according to the determination result;
[0100] The specific steps include:
[0101] S3521: When it is determined that no device is found, determining that the single detection is completed;
[0102] S3522: When it is determined that a device is discovered, a unified device is first created, then invalid devices are deregistered, and the current real-time status of the device is synchronized, and finally a single detection is determined to be completed.
[0103] S4: The business layer performs the required business applications through the corresponding bus interaction device interface.
[0104] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations falling within the meaning and scope of the equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.
Claims
1. A bus device management system, the system comprising a driver layer and a service layer, characterized in that: It also includes a device management layer disposed between the driver layer and the business layer, and the device management layer is respectively connected to the driver layer and the business layer by signal; The device management layer includes a bus management unit and a device management unit, wherein: The bus management unit includes a plurality of configuration items, which automatically performs device configuration during bus initialization to provide a unified device configuration interface; The device management unit includes a bus device discovery unit and a bus device creation unit, which provides a corresponding bus interaction device interface for the business layer; The bus management unit configures the corresponding configuration items according to the preset priority; wherein, The configuration items at least include bus type configuration, bus parameter configuration and protocol parameter configuration; The preset priority is that the priority of bus type configuration is higher than the priority of bus parameter configuration, and the priority of bus parameter configuration is higher than the priority of protocol parameter configuration; The bus management unit selects to automatically configure the device in the bus initialization process in the configuration file mode. The bus management unit first loads the bus configuration information through a preset configuration file. The bus management unit then loads and parses the configuration file when starting up, and performs initialization operations respectively according to the bus configuration information scanned by the device management unit; In the device management unit, The bus device discovery unit monitors the bus discovery signal in real time, and when the real-time monitoring result determines that the newly discovered bus already exists, confirms to send the device discovery signal; The bus device creation unit creates a unified device according to the received device discovery signal, then cancels the invalid device and synchronizes the current real-time status of the device.
2. A control method for a bus device management system according to claim 1, characterized in that: The following steps are involved: S1: Start the corresponding driver project in the driver layer; S2: The device management layer interacts with the bus driver to complete basic configuration, provide a unified device configuration interface, and release a bus maintenance signal; S3: The device management layer creates and cancels devices according to whether the bus and device are found, so as to provide the business layer with the corresponding bus interaction device interface; S4: The business layer performs the required business applications through the corresponding bus interaction device interface.
3. A control method for a bus device management system according to claim 2, characterized in that: The step S2 includes the following steps: S21: Start the bus management unit; S22: Select the required configuration item; S23: Detecting the validity of the selected configuration item; detecting the validity of the selected configuration item at least includes: A) Check whether the valid range of parameters of various bus configuration items meets the preset requirements; B) Check whether the configuration format requirements of various bus configuration items meet the preset requirements; C) Checking whether there is a conflict between the parameters of the preset bus; S24: Enumerate interconnect buses; S25: Determine whether the enumeration process is completed, and perform subsequent corresponding steps according to the determination result.
4. A control method for a bus device management system according to claim 3, characterized in that: The step S25 includes the following steps: S251: When it is determined that the current enumeration process is finished, determining that the single enumeration is finished; S252: When it is determined that the current enumeration process is not finished, determine whether the bus has been configured, and perform subsequent corresponding steps according to the determination result.
5. A control method for a bus device management system according to claim 4, characterized in that: The step S252 includes the following steps: S2521: When it is determined that the bus has been configured, determining that the single enumeration is finished; S2522: When it is determined that the bus is not configured, obtain and configure the basic information of the bus, then release the bus maintenance signal, and finally determine that the single enumeration is completed.
6. A control method for a bus device management system according to claim 2, characterized in that: The step S3 includes the following steps: S31: Start the device management unit; S32: Initialize device management structure; S33: real-time monitoring of bus discovery signals; S34: Determine whether the newly discovered bus already exists; S35: Perform subsequent corresponding steps according to the determination result.
7. A control method for a bus device management system according to claim 6, characterized in that: The step S35 includes the following steps: S351: When it is determined that the newly discovered bus does not exist, the single detection is determined to be finished; S352: When it is determined that the newly discovered bus already exists, the bus is first added to the maintenance list, and then the device discovery protocol is started, and then it is determined whether the device is found, and subsequent corresponding steps are performed according to the determination result.
8. A control method for a bus device management system according to claim 7, characterized in that: The step S352 includes the following steps: S3521: When it is determined that no device is found, determining that the single detection is completed; S3522: When it is determined that a device is discovered, a unified device is first created, then invalid devices are deregistered, and the current real-time status of the device is synchronized, and finally a single detection is determined to be completed.
Citation Information
Patent Citations
Equipment management method based on tree topology structure
CN106844260A