Embedded system software layering method, electronic device and storage medium

Through the management of the hierarchical method and interface registration center, the problem of low maintenance efficiency of embedded systems during the change process is solved, and the hardware-driven standardized calls and unified storage of abstract interfaces is realized, which improves the flexibility and stability of the system .

CN118409968BActive Publication Date: 2024-11-19SHENZHEN DEJI INNOVATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410590399.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-13
Publication Date
2024-11-19
Estimated Expiration
2044-05-13

AI Technical Summary

Technical Problem

Embedded systems are less efficient in maintenance during upgrade or expansion, resulting in slow response speed and difficult to quickly adapt to changes in demand.

Method used

Using a hierarchical method, an interface registration center is established, abstract interface information is generated by detecting the functions of each module and registering it, which realizes decoupling between modules and unified management of interfaces, reduces coupling, and improves maintainability and scalability.

Benefits of technology

It improves the maintenance efficiency of embedded systems during the change process, realizes hardware-driven standardized calls and unified storage of abstract interface information, simplifies the interface management process, and improves the flexibility and stability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118409968B_ABST
    Figure CN118409968B_ABST
Patent Text Reader

Abstract

The present application provides a layering method, electronic device and storage medium for embedded system software, the method comprising: upon receiving a layering instruction, establishing a first interface registration center and a second interface registration center; detecting the first system software according to the layering instruction to determine the first function of the upper and lower communication modules, the second function of the protocol analysis module, the third function of the link management module, the fourth function of the driver management module and the fifth function of the hardware driver module; generating first, second, third and fourth abstract interface information according to the first, second, third and fourth functions respectively; registering the first, second, third and fourth abstract interface information to the first interface registration center; analyzing the hardware driver module according to the fifth function to determine the first type and type quantity of the first hardware driver; generating hardware driver abstract interface information according to the first type and type quantity, and registering the hardware driver abstract interface information to the second interface registration center.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computers, and in particular to a layering method for embedded system software, an electronic device, and a storage medium. Background Art

[0002] With the continuous development of information technology, embedded systems are becoming increasingly complex, especially when dealing with massive data processing and complex interaction requirements. Therefore, the maintainability and scalability of embedded systems are becoming increasingly important factors that cannot be ignored, and their importance is becoming more and more prominent.

[0003] In related technologies, the communication between modules of an embedded system usually relies on predefined interface specifications. Once the interface specifications are rigorously designed and confirmed, they will remain stable and used throughout the life cycle of the embedded system to achieve collaborative work and stable operation of the modules.

[0004] However, in actual applications, embedded systems may need to be upgraded or expanded as needs change, and a large number of embedded system interfaces may need to be modified or added, which makes the upgrade or expansion process of the embedded system complicated and time-consuming. Therefore, the above-mentioned method may not be able to respond quickly when dealing with embedded system upgrades or expansions, which in turn leads to low maintenance efficiency of embedded systems in the related art during changes. Summary of the invention

[0005] The present application provides a layering method for embedded system software, which is used to improve the maintenance efficiency of the embedded system during changes.

[0006] In a first aspect, the present application provides a layering method for embedded system software, which is applied to the above-mentioned electronic device, the method comprising: upon receiving a layering instruction, establishing a first interface registration center and a second interface registration center; detecting the first system software according to the layering instruction to determine the first function of the upper and lower communication modules, the second function of the protocol analysis module, the third function of the link management module, the fourth function of the driver management module and the fifth function of the hardware driver module, wherein the first system software includes the upper and lower communication modules, the protocol analysis module, the link management module, the driver management module and the hardware driver module; generating first abstract interface information, second abstract interface information, third abstract interface information and fourth abstract interface information according to the first function, the second function, the third function and the fourth function respectively, wherein the first abstract interface information includes a first abstract interface and first abstract interface metadata corresponding to the first abstract interface, the first abstract interface is used to call the first function of the upper and lower communication modules, the second abstract interface information includes a second abstract interface and second abstract interface metadata corresponding to the second abstract interface, the second abstract interface is used to call the second function of the protocol analysis module, the third abstract interface information includes a third abstract interface and third abstract interface metadata corresponding to the third abstract interface, The third abstract interface is used to call the third function of the link management module, the fourth abstract interface information includes the fourth abstract interface and the fourth abstract interface metadata corresponding to the fourth abstract interface, and the fourth abstract interface is used to call the fourth function of the driver management module; the first abstract interface information, the second abstract interface information, the third abstract interface information and the fourth abstract interface information are registered in the first interface registration center, wherein the first interface registration center is used to store and manage the first abstract interface information, the second abstract interface information, the third abstract interface information and the fourth abstract interface information; the hardware driver module is analyzed according to the fifth function to determine the first type and the number of types of the first hardware driver in the hardware driver module, wherein the number of types is the number corresponding to each type of second hardware driver in the first type, and the first hardware driver includes the second hardware driver; hardware driver abstract interface information is generated according to the first type and the number of types, and the hardware driver abstract interface information is registered in the second interface registration center, wherein the hardware driver abstract interface information includes the hardware driver abstract interface and the fifth abstract interface metadata corresponding to the hardware driver abstract interface, the hardware driver abstract interface calls the first hardware driver through a preset standard calling mechanism, and the second interface registration center is used to store and manage the hardware driver abstract interface information.

[0007] In the above embodiment, when receiving the hierarchical instruction, two interface registration centers (i.e., the first interface registration center and the second interface registration center) are established, and the first system software is detected according to the hierarchical instruction to clarify the functions of each module (i.e., the first function of the upper and lower communication modules, the second function of the protocol analysis module, the third function of the link management module, the fourth function of the driver management module, and the fifth function of the hardware driver module), which can ensure that the function of each module is accurately identified, and provide a basis for the subsequent generation of abstract interface information. According to the functions of each module, the corresponding abstract interface information (i.e., the first abstract interface information, the second abstract interface information, the third abstract interface information, and the fourth abstract interface information) is generated. The abstract interface information includes the abstract interface (i.e., the first abstract interface, the second abstract interface, the third abstract interface, and the fourth abstract interface) and the abstract interface metadata corresponding to the abstract interface (i.e., the first abstract interface metadata, the second abstract interface metadata, the third abstract interface metadata, and the fourth abstract interface metadata). The abstract interface is used to call the function of the corresponding module, and the abstract interface metadata provides information such as the description and use of the interface, thereby realizing the abstraction and standardization of the software module functions and improving the flexibility and scalability of the embedded system. The above-mentioned abstract interface information is registered to the first interface registration center for unified management and maintenance. Other modules or embedded systems can obtain and use these interfaces through the first interface registration center, which reduces the coupling between modules. According to the fifth function of the hardware driver module, the hardware driver module is analyzed to determine the type (i.e., the first type) and quantity (i.e., the number of types) of the first hardware driver in the hardware driver module, providing a basis for the subsequent generation of the hardware driver abstract interface. The hardware driver abstract interface information is generated according to the first type and the number of types, and registered to the second interface registration center. Other modules or embedded systems can call the first hardware driver through the second interface registration center through a preset standard calling mechanism, thereby improving the maintainability and compatibility of the embedded system. Through the layering of embedded system software, the abstraction of the hardware driver abstract interface, and the management of the interface registration center (i.e., the first interface registration center and the second interface registration center), the coupling between modules is reduced, and the standardized calling of the hardware driver and the unified storage and management of the abstract interface information are realized, thereby effectively improving the maintainability and scalability of the embedded system, thereby solving the technical problem of low maintenance efficiency of the embedded system in the change process in the related technology, and achieving the technical effect of improving the maintenance efficiency of the embedded system in the change process.

[0008] In combination with some embodiments of the first aspect, in some embodiments, the first abstract interface information, the second abstract interface information, the third abstract interface information and the fourth abstract interface information are registered with the first interface registration center, specifically including: performing a first verification on the first abstract interface to determine whether the first abstract interface is valid; when it is determined that the first abstract interface is valid, registering the first abstract interface, the first interface name, the first version number and the first parameter list with the first interface registration center, wherein the first abstract interface metadata includes the first interface name, the first version number and the first parameter list, and the first parameter list includes the first interface call parameter information, and the first interface call parameter information is used to describe the parameters required to be provided when calling the first interface; performing a second verification on the second abstract interface to determine whether the second abstract interface is valid; when it is determined that the second abstract interface is valid, registering the second abstract interface, the second interface name, the second version number and the second parameter list with the first interface registration center, wherein the second abstract interface metadata includes the second interface name, the second version number and the second parameter list, and the second parameter list includes the second interface Call parameter information, the second interface call parameter information is used to describe the parameters that need to be provided when calling the second interface; perform a third verification on the third abstract interface to determine whether the third abstract interface is valid; if the third abstract interface is determined to be valid, register the third abstract interface, the third interface name, the third version number and the third parameter list to the target interface registration center, wherein the third abstract interface metadata includes the third interface name, the third version number and the third parameter list, the third parameter list includes the third interface call parameter information, and the third interface call parameter information is used to describe the parameters that need to be provided when calling the third interface; perform a fourth verification on the fourth abstract interface to determine whether the fourth abstract interface is valid; if the fourth abstract interface is determined to be valid, register the fourth abstract interface, the fourth interface name, the fourth version number and the fourth parameter list to the target interface registration center, wherein the fourth abstract interface metadata includes the fourth interface name, the fourth version number and the fourth parameter list, the fourth parameter list includes the fourth interface call parameter information, and the fourth interface call parameter information is used to describe the parameters that need to be provided when calling the fourth interface.

[0009] In the above embodiment, the first abstract interface is verified (i.e., the first verification) to ensure the validity of the first abstract interface, thereby ensuring the quality of the subsequently registered interfaces and avoiding calling invalid interfaces. After the verification is passed, the first abstract interface and its related metadata (i.e., the first abstract interface metadata, including the first interface name, the first version number, and the first parameter list) are registered to the first interface registration center. Other modules or embedded systems can obtain detailed information of the first abstract interface through the first interface registration center and correctly call the interface according to the parameter list. A similar verification and registration process is performed on the second abstract interface to ensure the validity and accessibility of the second abstract interface. The third abstract interface and the fourth abstract interface are verified. Unlike the first two interfaces (i.e., the first abstract interface and the second abstract interface), these two interfaces (i.e., the third abstract interface and the fourth abstract interface) are registered to the target interface registration center to distinguish different requirements or hierarchical structures of the embedded system software. After the verification is passed, the third abstract interface and the fourth abstract interface and their metadata (i.e., the third abstract interface metadata and the fourth abstract interface metadata) are also registered to the target interface registration center accordingly, making the use of the interface more flexible and manageable. Through interface verification, it is ensured that the interfaces registered to the registration center are valid and available, which improves the stability and reliability of the embedded system. Through the management of the interface registration center, unified storage and management of interface information is achieved, which facilitates the search, call and maintenance of interfaces. The metadata of the abstract interface (including interface name, version number and parameter list) provides detailed information on interface calls, reducing the difficulty and error rate of interface use. Registering different interfaces to different registration centers helps to achieve the hierarchical nature of embedded system software and improves the scalability and maintainability of embedded systems.

[0010] In combination with some embodiments of the first aspect, in some embodiments, hardware driver abstract interface information is generated according to the first type and the number of types, and the hardware driver abstract interface information is registered with the second interface registration center, specifically including: classifying the first hardware driver according to the first type and the number of types to obtain a hardware driver set; generating hardware driver abstract interface information according to the hardware driver set; and registering the hardware driver abstract interface information with the second interface registration center.

[0011] In the above embodiment, classification processing is performed according to the type of the first hardware driver (i.e., the first type) and the number (i.e., the number of types) corresponding to each type of second hardware driver (the first hardware driver includes the second hardware driver). The purpose is to organize hardware drivers with the same type or similar functions to form a hardware driver set. Through the classification processing, effective management of hardware drivers can be achieved, laying the foundation for the subsequent generation of hardware driver abstract interface information. Hardware driver abstract interface information is generated based on the obtained hardware driver set, that is, the specific hardware driver function is abstracted into an interface form. The generated hardware driver abstract interface information is registered in the second interface registration center. By registering the hardware driver abstract interface information, it is convenient for other modules or embedded systems to find and use these interfaces. When other modules need to call the hardware driver function, they can obtain the corresponding hardware driver abstract interface through the second interface registration center, and call the hardware driver abstract interface to implement the required function. By registering the hardware driver abstract interface information, the decoupling between the various modules of the embedded system software is achieved, thereby improving the flexibility and scalability of the embedded system.

[0012] In combination with some embodiments of the first aspect, in some embodiments, registering the hardware driver abstract interface information to the second interface registration center specifically includes: performing a third verification on the hardware driver abstract interface to determine whether the hardware driver abstract interface is valid; when it is determined that the hardware driver abstract interface is valid, determining the second type of the first driver device corresponding to the hardware driver abstract interface, the first identity information of the first driver device, the bus directory where the first driver device is located, the protocol bus to which the first driver device belongs, and the usage information of the first driver device according to the fifth abstract interface metadata, wherein the usage information is used to describe the situation where the first driver device is occupied; registering the hardware driver abstract interface, the first driver device, the second type, the first identity information, the bus directory, the protocol bus, and the usage information to the second interface registration center.

[0013] In the above embodiment, the hardware driver abstract interface is verified for the third time to ensure the validity of the hardware driver abstract interface, thereby ensuring that the hardware driver abstract interface can correctly and stably call the corresponding hardware driver, avoiding problems caused by interface failure or call errors. When the hardware driver abstract interface is verified to be valid, the detailed information related to the hardware driver abstract interface (i.e., the second type of the first driver device, the first identity information of the first driver device, the bus directory where the first driver device is located, the protocol bus to which the first driver device belongs, and the usage information of the first driver device) is determined according to the fifth abstract interface metadata. The hardware driver abstract interface and its related detailed information are registered in the second interface center, so that the hardware driver abstract interface and its related detailed information can be accessed and used by other modules or embedded systems, realizing the unified management and call of the interface and the driver device. By verifying the validity of the hardware driver abstract interface, the stability and reliability of the hardware driver abstract interface are ensured, and the hardware driver abstract interface and its related detailed information are registered in the second interface registration center, realizing the centralized management and unified call of the hardware driver abstract interface, simplifying the interface management process of the embedded system, and improving the maintainability and scalability of the embedded system.

[0014] In combination with some embodiments of the first aspect, in some embodiments, after generating hardware driver abstract interface information according to the first type and type quantity, and registering the hardware driver abstract interface information to the second interface registration center, the above method also includes: upon receiving an adjustment instruction of the second hardware driver sent by the upper and lower computer communication modules and receiving a call instruction sent by the link management layer, obtaining the first hardware driver abstract interface corresponding to the second hardware driver from the second interface registration center, wherein the call instruction indicates calling the sixth function corresponding to the second hardware driver through the first hardware driver abstract interface, the first hardware driver includes the second hardware driver, and the hardware driver abstract interface includes the first hardware driver abstract interface; adjusting the second hardware driver according to the adjustment instruction, and calling the adjusted sixth function of the second hardware driver according to the first hardware driver abstract interface.

[0015] In the above embodiment, when the adjustment instruction of the second hardware driver sent by the upper and lower computer communication modules is received, and the call instruction sent by the link management layer is received at the same time, the first hardware driver abstract interface corresponding to the second hardware driver is obtained from the second interface registration center, and the call instruction indicates to call the sixth function possessed by the second hardware driver through the first hardware driver abstract interface, so that the required hardware driver abstract interface can be accurately located, providing a basis for subsequent function calls. According to the adjustment instruction, the second hardware driver is adjusted accordingly to ensure that the adjustment of the second hardware driver does not affect the call of the sixth function. The adjusted sixth function of the second hardware driver is called through the obtained first hardware driver abstract interface, so that the function call process and the specific hardware driver adjustment process do not affect each other. The hardware driver abstract interface is obtained through the second interface registration center, and the unified management and maintenance of the interface information is realized. Adjusting the hardware driver can reduce the coupling degree of each module of the embedded system software, so that the embedded system can adapt to different usage scenarios and requirements.

[0016] In combination with some embodiments of the first aspect, in some embodiments, after generating hardware driver abstract interface information according to the first type and type quantity, and registering the hardware driver abstract interface information to the second interface registration center, the above method also includes: running the second system software to obtain a first operating result, wherein the second system software is obtained after layering the first system software; when the first operating result shows that a second driver device is connected, determining the second identity information of the second driver device, the second type of the second driver device and the seventh function of the second driver device; filtering the first hardware driver abstract interface stored in the second interface registration center according to the second identity information, the second type and the seventh function to obtain a filtering result.

[0017] In the above embodiment, the second system software obtained by layering the first system software is run, the purpose is to use the layered system software to perform a specific task or detection to obtain a first operation result. When the first operation result shows that the second drive device is connected, the second identity information, the second type and the seventh function of the second drive device are determined. The first hardware driver abstract interface stored in the second interface registration center is screened according to the obtained second identity information, the second type and the seventh function, the purpose is to find a hardware driver abstract interface that matches the connected second drive device from a large number of hardware driver abstract interfaces. The connected drive device (i.e., the second drive device) is detected by running the layered system software (i.e., the second system software), and the second identity information, the second type and the seventh function of the second drive device are obtained, so as to more accurately understand the state and function of the second drive device, and the hardware driver abstract interface is screened according to the information of the second drive device (i.e., the second identity information, the second type and the seventh function of the second drive device), so as to ensure the matching of the hardware driver abstract interface with the second drive device.

[0018] In combination with some embodiments of the first aspect, in some embodiments, after the first hardware driver abstract interface stored in the second interface registration center is screened according to the second identity information, the second type and the seventh function to obtain the screening result, the above method also includes: when the screening result shows that the first hardware driver abstract interface matching the second driver device does not exist in the second interface registration center, generating second hardware driver abstract interface information according to the second identity information, the second type and the seventh function, wherein the second hardware driver abstract interface information includes the second hardware driver abstract interface and the sixth abstract interface metadata corresponding to the second hardware driver abstract interface, and the second hardware driver abstract interface is used to call the seventh function of the second driver device.

[0019] In the above embodiment, when the screening result shows that the first hardware driver abstract interface matching the second driver device does not exist in the second interface registration center, the second hardware driver abstract interface information (including the second hardware driver abstract interface and the sixth abstract interface metadata corresponding to the second hardware driver abstract interface) is generated according to the second identity information, the second type and the seventh function of the second driver device to ensure that the second hardware driver abstract interface can accurately and effectively interact with the second driver device, thereby improving the flexibility and scalability of the embedded system. When encountering a new or unknown type of driver device (i.e., the second driver device), a matching hardware driver abstract interface can be automatically generated without manual interface development or modification, reducing the workload of manual interface writing and testing, and improving the development efficiency of the embedded system. In addition, the second hardware driver abstract interface is generated based on the actual information and function of the second driver device, so it can interact with the second driver device more accurately, reducing problems caused by interface mismatch or errors, and enhancing the stability and reliability of the embedded system.

[0020] In a second aspect, an embodiment of the present application provides an electronic device, comprising: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the electronic device to perform the method described in the first aspect and any possible implementation method of the first aspect.

[0021] In a third aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on an electronic device, enables the electronic device to execute the method described in the first aspect and any possible implementation of the first aspect.

[0022] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, comprising instructions. When the instructions are executed on an electronic device, the electronic device executes the method described in the first aspect and any possible implementation manner of the first aspect.

[0023] It is understandable that the electronic device provided in the second aspect, the computer program product provided in the third aspect, and the computer storage medium provided in the fourth aspect are all used to execute the method provided in the embodiment of the present application. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method, which will not be repeated here.

[0024] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:

[0025] 1. Through the layering of embedded system software, the abstraction of hardware driver abstract interfaces, and the management of interface registration centers (i.e., the first interface registration center and the second interface registration center), the coupling degree between modules is reduced, and standardized calling of hardware drivers and unified storage and management of abstract interface information are achieved, thereby effectively improving the maintainability and scalability of embedded systems, and further solving the technical problem of low maintenance efficiency of embedded systems during changes in related technologies, thereby achieving the technical effect of improving the maintenance efficiency of embedded systems during changes.

[0026] 2. By verifying the validity of the hardware driver abstract interface, the stability and reliability of the hardware driver abstract interface are ensured, and the hardware driver abstract interface and its related detailed information are registered to the second interface registration center, thereby realizing the centralized management and unified calling of the hardware driver abstract interface, simplifying the interface management process of the embedded system, and improving the maintainability and scalability of the embedded system.

[0027] 3. When encountering a new or unknown type of driver device (i.e., the second driver device), a matching hardware driver abstract interface can be automatically generated without manual interface development or modification, thereby reducing the workload of manual interface writing and testing and improving the development efficiency of the embedded system. In addition, the second hardware driver abstract interface is generated based on the actual information and functions of the second driver device, and therefore can interact with the second driver device more accurately, thereby reducing problems caused by interface mismatch or errors and enhancing the stability and reliability of the embedded system. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 It is a flowchart of a layered method of embedded system software in an embodiment of the present application;

[0029] Figure 2 It is a structural diagram of a software architecture to which the layered method of embedded system software in the embodiment of the present application can be applied;

[0030] Figure 3 It is a schematic diagram of a physical device structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION

[0031] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification and appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include plural expressions, unless there is a clear indication to the contrary in the context. It should also be understood that the term "and / or" used in the present application refers to any or all possible combinations comprising one or more listed items.

[0032] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.

[0033] This application provides a layered method for embedded system software, referring to Figure 1 , Figure 1 It is a flowchart of the layering method of the embedded system software in the embodiment of the present application, which includes the following steps:

[0034] Step S101, upon receiving a hierarchical instruction, establishing a first interface registration center and a second interface registration center;

[0035] Step S102, detecting the first system software according to the hierarchical instruction to determine the first function of the upper and lower communication modules, the second function of the protocol analysis module, the third function of the link management module, the fourth function of the driver management module and the fifth function of the hardware driver module, wherein the first system software includes the upper and lower communication modules, the protocol analysis module, the link management module, the driver management module and the hardware driver module;

[0036] Step S103, generating first abstract interface information, second abstract interface information, third abstract interface information and fourth abstract interface information respectively according to the first function, the second function, the third function and the fourth function, wherein the first abstract interface information includes a first abstract interface and first abstract interface metadata corresponding to the first abstract interface, the first abstract interface is used to call the first function of the upper and lower communication modules, the second abstract interface information includes a second abstract interface and second abstract interface metadata corresponding to the second abstract interface, the second abstract interface is used to call the second function of the protocol analysis module, the third abstract interface information includes a third abstract interface and third abstract interface metadata corresponding to the third abstract interface, the third abstract interface is used to call the third function of the link management module, the fourth abstract interface information includes a fourth abstract interface and fourth abstract interface metadata corresponding to the fourth abstract interface, and the fourth abstract interface is used to call the fourth function of the driver management module;

[0037] Step S104, registering the first abstract interface information, the second abstract interface information, the third abstract interface information and the fourth abstract interface information to a first interface registration center, wherein the first interface registration center is used to store and manage the first abstract interface information, the second abstract interface information, the third abstract interface information and the fourth abstract interface information;

[0038] Step S105, analyzing the hardware driver module according to the fifth function to determine the first type and the number of types of the first hardware driver in the hardware driver module, wherein the number of types is the number corresponding to each type of second hardware driver in the first type, and the first hardware driver includes the second hardware driver;

[0039] Step S106, generate hardware driver abstract interface information according to the first type and type quantity, and register the hardware driver abstract interface information to the second interface registration center, wherein the hardware driver abstract interface information includes a hardware driver abstract interface and a fifth abstract interface metadata corresponding to the hardware driver abstract interface, the hardware driver abstract interface calls the first hardware driver through a preset standard calling mechanism, and the second interface registration center is used to store and manage the hardware driver abstract interface information.

[0040] In the above embodiment, the hierarchical instructions include but are not limited to initialization instructions, registration instructions, verification instructions, and monitoring instructions. Among them, the initialization instructions can be used to start and configure the various services and components required by the interface registration center (i.e., the first interface registration center and the second interface registration), the registration instructions can be used to register the abstract interface information (i.e., the first abstract interface information, the second abstract interface information, the third abstract interface information, the fourth abstract interface information, and the hardware abstract interface information, etc., but not limited to this) to the corresponding interface registration center, the verification instructions can be used to verify whether the registration of the abstract interface (i.e., the first abstract interface, the second abstract interface, the third abstract interface, the fourth abstract interface, and the hardware driver abstract interface, etc., but not limited to this) is successful, and whether the abstract interface can be accessed and used normally, and the monitoring instructions can be used to monitor the operating status of the interface registration center in real time to ensure the stability and availability of the service. It should also be noted that the specific hierarchical instructions may vary due to different actual needs. Therefore, in actual applications, the hierarchical instructions need to be customized and adjusted according to the specific situation. At the same time, in order to ensure the effective execution of the hierarchical instructions and the stable operation of the embedded system, the hierarchical instructions also need to be strictly tested and verified.

[0041] In the above embodiment, the first system software includes but is not limited to upper and lower communication modules, protocol analysis modules, link management modules, driver management modules and hardware driver modules. Therefore, the two interface registration centers (i.e., the first interface registration center and the second interface registration center) established under the layered instruction are for storing and managing the abstract interface information of different modules and functions in the system software. The first interface registration center can store and manage the abstract interface information of all other system software modules except the hardware driver module. These abstract interface information include but are not limited to the abstract interfaces and corresponding metadata of the upper and lower communication modules, protocol analysis modules, link management modules and driver management modules. The functions of each module can be called through these abstract interface information. By registering these abstract interface information, the first interface registration center provides a unified interface management mechanism for the embedded system software, so that other components or services can interact with the corresponding modules through these interfaces, realize the decoupling between the modules of the embedded system software, and make the embedded system flexible to expand. The second interface registration center can be used to store and manage the abstract interface information of the hardware driver module. The abstract interface information includes but is not limited to the abstract interface of the hardware driver module and the corresponding metadata. The functions of the hardware driver can be called through these abstract interface information. The second interface registration center enables other system components to call the hardware driver through a unified interface, thereby simplifying the interaction process with the hardware and improving the maintainability and scalability of the embedded system. In short, the main difference between the two interface registration centers lies in the different scopes of the abstract interface information they manage. The first interface registration center manages the interface information of all system software modules except the hardware driver module, while the second interface registration center is used to manage the interface information of the hardware driver module. Through the layering of system software and the abstraction of interfaces, the coupling between the modules of the embedded system software can be effectively reduced, thereby improving the flexibility and maintainability of the embedded system.

[0042] In the above embodiment, the type of the first hardware driver (i.e., the first type) includes but is not limited to device drivers, storage drivers, display drivers, audio drivers, input device drivers, bus drivers, sensor drivers, and specific hardware drivers. Among them, the device driver is used to control and manage various hardware devices, such as printers, scanners, cameras, network devices, etc. The display driver is used to control and manage display devices, such as monitors, projectors, etc. The audio driver is used to control audio devices, such as sound cards, speakers, microphones, etc. The input device driver is used to manage input devices, such as keyboards, mice, touch screens, etc. The bus driver is used to manage hardware buses, such as Peripheral Component Interconnect (PCI), Peripheral Component Interconnect Express (PCIe), Universal Serial Bus (USB), etc. The sensor driver is used to read and manage various sensor data, such as temperature sensors, pressure sensors, gyroscopes, etc. The specific hardware driver is a driver designed for a specific hardware device or a specific function, such as a fingerprint reader driver, a security chip driver, etc. In specific implementations, these drivers may be further subdivided into different subclasses or types, depending on the complexity and functional requirements of the hardware. In addition, each driver may need to be adapted and integrated with a specific operating system or system architecture to ensure that it can work properly.

[0043] In the above embodiment, the number of types refers to the number corresponding to each type of second hardware driver in the first type. For example, if the first type is a device driver, the number of types may include the number of different types of device drivers, such as the number of printer drivers, the number of scanner drivers, etc. It should be noted that only some common hardware driver types are listed here, and there may be more types in the actual embedded system, or customized according to specific requirements. Therefore, the first type of the specific first hardware driver should be determined according to the actual embedded system and hardware architecture.

[0044] Through the above steps, when receiving the hierarchical instruction, two interface registration centers (i.e., the first interface registration center and the second interface registration center) are established, and the first system software is detected according to the hierarchical instruction to clarify the functions of each module (i.e., the first function of the upper and lower communication modules, the second function of the protocol analysis module, the third function of the link management module, the fourth function of the driver management module, and the fifth function of the hardware driver module), which can ensure that the functions of each module are accurately identified, and provide a basis for the subsequent generation of abstract interface information. According to the functions of each module, the corresponding abstract interface information (i.e., the first abstract interface information, the second abstract interface information, the third abstract interface information, and the fourth abstract interface information) is generated. The abstract interface information includes the abstract interface (i.e., the first abstract interface, the second abstract interface, the third abstract interface, and the fourth abstract interface) and the abstract interface metadata corresponding to the abstract interface (i.e., the first abstract interface metadata, the second abstract interface metadata, the third abstract interface metadata, and the fourth abstract interface metadata). The abstract interface is used to call the function of the corresponding module, and the abstract interface metadata provides information such as the description and use of the interface, thereby realizing the abstraction and standardization of the software module functions and improving the flexibility and scalability of the embedded system. The above-mentioned abstract interface information is registered to the first interface registration center for unified management and maintenance. Other modules or embedded systems can obtain and use these interfaces through the first interface registration center, which reduces the coupling between modules. According to the fifth function of the hardware driver module, the hardware driver module is analyzed to determine the type (i.e., the first type) and quantity (i.e., the number of types) of the first hardware driver in the hardware driver module, providing a basis for the subsequent generation of the hardware driver abstract interface. The hardware driver abstract interface information is generated according to the first type and the number of types, and registered to the second interface registration center. Other modules or embedded systems can call the first hardware driver through the second interface registration center through a preset standard calling mechanism, thereby improving the maintainability and compatibility of the embedded system. Through the layering of embedded system software, the abstraction of the hardware driver abstract interface, and the management of the interface registration center (i.e., the first interface registration center and the second interface registration center), the coupling between modules is reduced, and the standardized calling of the hardware driver and the unified storage and management of the abstract interface information are realized, thereby effectively improving the maintainability and scalability of the embedded system, thereby solving the technical problem of low maintenance efficiency of the embedded system in the change process in the related technology, and achieving the technical effect of improving the maintenance efficiency of the embedded system in the change process.

[0045] Among them, the executor of the above steps can be a system with interface abstraction, interface registration center establishment and management capabilities, or a control device with interface abstraction, interface registration center establishment and management capabilities, or a processing device with interface abstraction, interface registration center establishment and management capabilities, or a controller or processor embedded in the system, or a controller or processor external to the system, but not limited to this.

[0046] In an optional embodiment, the first abstract interface information, the second abstract interface information, the third abstract interface information and the fourth abstract interface information are registered with the first interface registration center, specifically including: performing a first verification on the first abstract interface to determine whether the first abstract interface is valid; if it is determined that the first abstract interface is valid, registering the first abstract interface, the first interface name, the first version number and the first parameter list with the first interface registration center, wherein the first abstract interface metadata includes the first interface name, the first version number and the first parameter list, and the first parameter list includes the first interface call parameter information, and the first interface call parameter information is used to describe the parameters required to be provided when calling the first interface; performing a second verification on the second abstract interface to determine whether the second abstract interface is valid; if it is determined that the second abstract interface is valid, registering the second abstract interface, the second interface name, the second version number and the second parameter list with the first interface registration center, wherein the second abstract interface metadata includes the second interface name, the second version number and the second parameter list, and the second parameter list includes the second interface call parameter information The method further comprises the following steps: performing a third verification on the third abstract interface to determine whether the third abstract interface is valid; registering the third abstract interface, the third interface name, the third version number and the third parameter list with the target interface registration center, wherein the third abstract interface metadata includes the third interface name, the third version number and the third parameter list, and the third parameter list includes the third interface calling parameter information, and the third interface calling parameter information is used to describe the parameters required to be provided when calling the third interface; performing a fourth verification on the fourth abstract interface to determine whether the fourth abstract interface is valid; registering the fourth abstract interface, the fourth interface name, the fourth version number and the fourth parameter list with the target interface registration center, wherein the fourth abstract interface metadata includes the fourth interface name, the fourth version number and the fourth parameter list, and the fourth parameter list includes the fourth interface calling parameter information, and the fourth interface calling parameter information is used to describe the parameters required to be provided when calling the fourth interface.

[0047] In the above embodiment, the first abstract interface is first verified. The verification process may include checking whether the definition of the interface complies with the specification, whether the implementation of the interface is complete and correct, whether the functions of the interface are normal and available, etc. If the first abstract interface is verified (that is, the first abstract interface is a valid interface), the first abstract interface and the corresponding first abstract interface metadata (including the first interface name, the first version number, and the first parameter list, etc., but not limited to this) are registered to the first interface registration center. Among them, the first interface name, the first version number, and the first parameter list are part of the first abstract interface metadata, which are used to describe the basic information and calling method of the interface. The first parameter list lists in detail the parameter information that needs to be provided when calling the first abstract interface, ensuring that the interface caller can use the first abstract interface correctly.

[0048] In the above embodiment, the second abstract interface is subjected to a second verification, and the verification process may include checking whether the definition of the interface complies with the specification, whether the implementation of the interface is complete and correct, whether the functions of the interface are normally available, etc. If the second abstract interface passes the verification (i.e., the second abstract interface is a valid interface), the second abstract interface and the corresponding second abstract interface metadata (including the second interface name, the second version number, and the second parameter list, etc., but not limited thereto) are registered to the first interface registration center. Among them, the second parameter list lists in detail the parameter information required to call the second abstract interface.

[0049] In the above embodiment, the third abstract interface is subjected to a third verification, and the verification process may include checking whether the definition of the interface complies with the specification, whether the implementation of the interface is complete and correct, whether the functions of the interface are normally available, etc. If the third abstract interface passes the verification (i.e., the third abstract interface is a valid interface), the third abstract interface and the corresponding third abstract interface metadata (including the third interface name, the third version number, and the third parameter list, etc., but not limited thereto) are registered to the first interface registration center. The third parameter list lists in detail the parameters required to be provided for calling the third abstract interface.

[0050] In the above embodiment, the fourth abstract interface is subjected to the fourth verification, and the verification process may include checking whether the definition of the interface complies with the specification, whether the implementation of the interface is complete and correct, whether the functions of the interface are normal and available, etc. If the fourth abstract interface verification passes (i.e., the fourth abstract interface is a valid interface), the fourth abstract interface and the corresponding fourth abstract interface metadata (including the fourth interface name, the fourth version number and the fourth parameter list, etc., but not limited thereto) are registered to the first interface registration center. Among them, the fourth parameter list lists in detail the parameter information required to call the fourth interface.

[0051] In an optional embodiment, hardware driver abstract interface information is generated according to the first type and the number of types, and the hardware driver abstract interface information is registered with a second interface registration center, specifically including: classifying the first hardware driver according to the first type and the number of types to obtain a hardware driver set; generating hardware driver abstract interface information according to the hardware driver set; and registering the hardware driver abstract interface information with the second interface registration center.

[0052] In the above embodiment, the hardware driver module is analyzed to determine the first type of the first hardware driver in the hardware driver module (for example, a network driver, a graphics card driver, an audio driver, etc.) and the number of types under the type (i.e., the number of different drivers of the same type, for example, multiple network drivers corresponding to different models of network cards). The first hardware driver is classified according to the first type and the number of types. The classification process may include grouping hardware drivers of the same type and creating a hardware driver set for each group of drivers. This set may include all hardware drivers of the same type, or further subdivided as needed, for example, divided according to the driver version or specific functions. Hardware driver abstract interface information is generated based on the classified hardware driver set, and a general abstract interface may be created, which can call any hardware driver in the set without relying on a specific driver implementation. The hardware driver abstract interface information generally includes the hardware driver abstract interface itself, and metadata corresponding to the interface, such as the interface name, version number, call parameter list, etc., which describe how to call the abstract interface and the information that needs to be provided when calling. The generated hardware driver abstract interface information is registered to the second interface registration center, which is dedicated to storing and managing abstract interface information related to the hardware driver. By storing the hardware driver abstract interface information in the database of the second interface registration center, effective management and abstraction of the hardware driver can be achieved, so that other components can call different types of hardware drivers through a unified interface without having to worry about the specific implementation details of the underlying driver, thereby improving the flexibility and scalability of the embedded system and reducing the coupling between modules or components.

[0053] In an optional embodiment, registering the hardware driver abstract interface information with the second interface registration center specifically includes: performing a third verification on the hardware driver abstract interface to determine whether the hardware driver abstract interface is valid; when it is determined that the hardware driver abstract interface is valid, determining the second type of the first driver device corresponding to the hardware driver abstract interface, the first identity information of the first driver device, the bus directory where the first driver device is located, the protocol bus to which the first driver device belongs, and the usage information of the first driver device according to the fifth abstract interface metadata, wherein the usage information is used to describe the situation where the first driver device is occupied; registering the hardware driver abstract interface, the first driver device, the second type, the first identity information, the bus directory, the protocol bus, and the usage information with the second interface registration center.

[0054] In the above embodiment, the hardware driver abstract interface is subjected to a third verification, and the verification process may include checking whether the definition of the abstract interface is complete, whether the interface functions as expected, whether the interface is compatible with other system components, etc. The purpose of the verification is to ensure that the hardware driver abstract interface can correctly interact with the hardware driver and can meet the requirements of the embedded system for hardware operations. If the hardware driver abstract interface verification passes (the hardware driver abstract interface is a valid interface), the second type of the first driver device corresponding to the hardware driver abstract interface (for example, a network driver, an audio driver, etc.), the first identity information of the first driver device (for example, a device ID, a serial number, etc.), the bus directory where the first driver device is located (for example, a PCI bus, a USB bus, etc.), the protocol bus to which the first driver device belongs (for example, a PCI protocol, a USB protocol, etc.), and the usage information of the first driver device (the usage information is used to describe the occupation of the first driver device, and may include information such as whether the first driver device is currently being used, which process or module is occupying it, and the occupation time). The hardware driver abstract interface, the first driver device, the second type, the first identity information, the bus directory, the protocol bus, and the usage information are registered in the second interface registration center. The hardware driver abstract interface, the first driver device, the second type, the first identity information, the bus directory, the protocol bus, and the usage information may be stored in the database of the second interface registration center, and corresponding indexes and associations are established so that other system components or modules can easily query and use this information. Through this embodiment, it can be ensured that the registered hardware driver abstract interface is valid and can accurately reflect the information and status of the corresponding driver device, thereby helping to improve the stability and reliability of the embedded system, while optimizing the management and allocation of hardware resources.

[0055] In an optional embodiment, after generating hardware driver abstract interface information according to the first type and type quantity, and registering the hardware driver abstract interface information to the second interface registration center, the above method also includes: upon receiving an adjustment instruction of the second hardware driver sent by the upper and lower computer communication modules and a call instruction sent by the link management layer, obtaining the first hardware driver abstract interface corresponding to the second hardware driver from the second interface registration center, wherein the call instruction indicates calling the sixth function corresponding to the second hardware driver through the first hardware driver abstract interface, the first hardware driver includes the second hardware driver, and the hardware driver abstract interface includes the first hardware driver abstract interface; adjusting the second hardware driver according to the adjustment instruction, and calling the adjusted sixth function of the second hardware driver according to the first hardware driver abstract interface.

[0056] In the above embodiment, an adjustment instruction sent from the upper and lower computer communication modules and a call instruction sent from the link management layer are received at the same time. The adjustment instruction includes specific requirements for adjusting the second hardware driver (for example, a specific network interface card driver, etc., which is not limited here), which may be an upgrade, downgrade, parameter configuration change, etc. The call instruction indicates that the sixth function (for example, high-speed data transmission function, etc., which is not limited here) possessed by the second hardware driver needs to be called through the first hardware driver abstract interface. In response to the adjustment instruction, the second interface registration center is accessed, and the first hardware driver abstract interface corresponding to the second hardware driver is searched in the second interface registration center according to the relevant information of the second hardware driver (for example, driver identifier, type, etc.), and then the second hardware driver is adjusted accordingly according to the adjustment instruction sent by the upper and lower computer communication modules, which may include downloading a new driver version, modifying driver configuration parameters, or performing other necessary adjustment operations. After the adjustment is completed, the adjusted sixth function of the second hardware driver is called through the acquired first hardware driver abstract interface. The calling process is implemented through the first hardware driver abstract interface. Therefore, the interface caller does not need to care about the specific implementation details of the underlying hardware driver, but only needs to call it according to the specification defined by the abstract interface. Through this embodiment, flexible management and calling of hardware drivers can be achieved. The upper and lower computer communication modules and the link management layer can control the system's operation on the hardware driver by sending instructions, while the specific driver adjustment and function call are completed by the system's internal interface registration center and hardware driver abstract interface, allowing the embedded system to more easily adapt to different hardware environments and functional requirements, thereby improving the maintainability and scalability of the embedded system.

[0057] In an optional embodiment, after generating hardware driver abstract interface information according to the first type and type quantity, and registering the hardware driver abstract interface information to the second interface registration center, the above method also includes: running the second system software to obtain a first operating result, wherein the second system software is obtained after layering the first system software; when the first operating result shows that a second driver device is connected, determining the second identity information of the second driver device, the second type of the second driver device and the seventh function of the second driver device; filtering the first hardware driver abstract interface stored in the second interface registration center according to the second identity information, the second type and the seventh function to obtain a filtering result.

[0058] In the above embodiment, the second system software obtained by layering the first system software is run to obtain a first operation result, which may include various system status information, event responses, etc. The first operation result is analyzed, and when the result shows that a second drive device is connected, the event is immediately processed, that is, the second identity information, the second type and the seventh function of the second drive device are determined, wherein the second identity information is a unique identifier of the second drive device, which is used to distinguish different second drive device instances, the second type refers to the type of the second drive device, such as a network driver, an audio driver, etc., and the seventh function refers to the specific functions or characteristics of the second drive device, such as high-speed data transmission, audio playback, etc. After determining the second identity information, the second type and the seventh function of the second driver device, the first hardware driver abstract interface stored in the second interface registration center is screened according to the second identity information, the second type and the seventh function. The second interface registration center may be a database or directory service storing the first hardware driver abstract interface information, or a management platform storing the first hardware driver abstract interface information, etc. The screening process may involve matching and comparing the metadata of the first hardware driver abstract interface to find the first hardware driver abstract interface that matches the second identity information, the second type and the seventh function of the second driver device. Through this embodiment, by running the first system software to layer and obtain the running result obtained by the second system software, the newly connected second driver device can be discovered and processed in time. At the same time, by screening the appropriate hardware driver abstract interface according to the second identity information, the second type and the seventh function of the second driver device, it can ensure that the interaction with the second driver device is accurate and efficient.

[0059] In an optional embodiment, after filtering the first hardware driver abstract interface stored in the second interface registration center according to the second identity information, the second type and the seventh function to obtain the filtering result, the above method also includes: when the filtering result shows that the first hardware driver abstract interface matching the second driver device does not exist in the second interface registration center, generating second hardware driver abstract interface information according to the second identity information, the second type and the seventh function, wherein the second hardware driver abstract interface information includes the second hardware driver abstract interface and the sixth abstract interface metadata corresponding to the second hardware driver abstract interface, and the second hardware driver abstract interface is used to call the seventh function of the second driver device.

[0060] In the above embodiment, when the screening result shows that there is no first hardware driver abstract interface matching the second driver device in the second interface registration center, the second hardware driver abstract interface information is generated according to the second identity information, the second type and the seventh function of the known second driver device. The second hardware driver abstract interface and the sixth abstract interface metadata corresponding to the second hardware driver abstract interface are generated according to the characteristics and functional requirements of the second driver device. The second hardware driver abstract interface is used to call the seventh function of the second driver device to ensure that it can interact with the device accurately and efficiently. The sixth abstract interface metadata describes in detail the key information such as the name, parameter list, and return value type of the interface, and provides a guide for other system components to use the interface. The generated second hardware driver abstract interface information is registered to the second interface registration center, so that when other system components need to call the seventh function of the second driver device, they can find the corresponding hardware driver abstract interface by querying the second interface registration center, thereby realizing the call of the second driver device function. Through this embodiment, by generating a new second hardware driver abstract interface information, the problem of no matching interface in the second interface registration center is solved, so that the embedded system can better adapt to different hardware environments and functional requirements, thereby improving the scalability and maintainability of the embedded system.

[0061] Obviously, the above-described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The present application will be described in detail below in conjunction with specific embodiments.

[0062] The present application embodiment provides an embedded system software, see Figure 2 , Figure 2 It is a structural diagram of a software architecture that can be applied to the layered method of embedded system software in the embodiment of the present application. The software architecture is as follows:

[0063] 1) The driver management layer (corresponding to the above-mentioned driver management module) is mainly responsible for the management, allocation and release of hardware driver resources.

[0064] The driver management layer provides the CreateHardware(HardwareType hardType, HardwareCategory category=HCATEGORY_Default) interface to the outside world (of course, it can also be other forms of interfaces that can call the driver management layer functions, which are not limited here). If this interface is called successfully, the IHardwre class interface is returned, and all corresponding hardware drivers will inherit this interface. For example, CANDRIVER class ICanDriver: public IHardware. If the protocol analysis layer needs to use the CAN driver, you can define an ICANDRIVER pointer to use the CAN driver created by the driver management layer, and then assign the address to the ICANDRIVER pointer, and then you can access the corresponding CAN interface through the pointer.

[0065] 2) Hardware driver layer (corresponding to the above hardware driver module), including hardware abstraction layer and various hardware drivers, such as controller area network (CAN) driver, timer driver, serial peripheral interface (SPI) driver, USB driver, universal asynchronous receiver / transmitter (UART) driver, Bluetooth driver, etc. All hardware resources inherit the unified standard interface of all hardware drivers provided by the hardware abstraction layer, including the following main interfaces:

[0066] Open () is to open the driver device;

[0067] GetType () is used to obtain the driver device type;

[0068] GetID () is used to obtain the device ID. Each driver device ID is unique.

[0069] GetHardwareConfig is used to obtain hardware configuration resources, including the type of the hardware, the bus directory it is in, its usage, the protocol bus it belongs to, etc.

[0070] The hardware abstraction layer is mainly used to facilitate the driver management layer to create a unified abstract interface. At the same time, the hardware abstraction layer also contains all the identity information of the hardware driver created by the driver management layer, including: driver type, bus occupancy, associated protocol, and which pin in the on-board diagnostic system (OBD) interface to occupy.

[0071] Each hardware driver layer inherits the corresponding hardware abstract interface. No matter how the hardware driver changes, as long as the corresponding hardware abstract interface remains unchanged, it will not affect the link communication layer used by the hardware driver.

[0072] 3) Link management layer (corresponding to the above-mentioned link management module), which is responsible for creating protocols, initializing protocols, providing read and write functions for corresponding protocols, and releasing protocols.

[0073] 4) Link communication layer: The link communication layer obtains the driver management instance object by calling the static interface function Instance() of the driver management layer (of course, it can also be other functions with similar functions, which are not limited here).

[0074] 5) Link abstraction layer, including Can link, Pulse Width Modulation (PWM) / Variable Pulse Width (VPW) link, K-line link, etc.

[0075] 6) The upper and lower computer communication layer (corresponding to the upper and lower communication modules mentioned above) obtains the corresponding driver hardware from the hardware driver layer as needed, for example, the USB driver abstract interface, the Bluetooth driver abstract interface, and then receives the application layer communication data according to the established protocol based on the data transmitted from the USB driver abstract interface or the Bluetooth driver abstract interface and gives it to the protocol analysis layer.

[0076] 7) The protocol analysis layer (corresponding to the above-mentioned protocol analysis module) analyzes the corresponding commands of the application layer (i.e., the host computer software, etc.) and transmits them to the link communication layer. Then the link communication layer transmits the commands to the electronic control unit (ECU) according to the corresponding communication layer protocol, and then sends the data returned by the ECU back to the protocol analysis layer. The protocol analysis layer receives the data from the ECU and sends it to the host computer through the upper and lower computer communication layers. At this point, the entire communication process is completed.

[0077] Through the embodiments of the present application, through the layering of embedded system software and the abstraction of hardware driver abstract interfaces and the management of interface registration centers (i.e., the first interface registration center and the second interface registration center), the coupling degree between modules is reduced, and standardized calling of hardware drivers and unified storage and management of abstract interface information are achieved, thereby effectively improving the maintainability and scalability of the embedded system, and further solving the technical problem of low maintenance efficiency of embedded systems during changes in related technologies, thereby achieving the technical effect of improving the maintenance efficiency of embedded systems during changes.

[0078] The electronic device in the embodiment of the present invention is described below from the perspective of hardware processing. Figure 3 , Figure 3 It is a schematic diagram of a physical device structure of an electronic device in an embodiment of the present application.

[0079] It should be noted that Figure 3 The structure of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0080] like Figure 3 As shown, the electronic device includes a central processing unit (CPU) 301, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 302 or the program loaded from the storage part 308 to the random access memory (RAM) 303, such as executing the method described in the above embodiment. In RAM 303, various programs and data required for system operation are also stored. CPU 301, ROM 302 and RAM 303 are connected to each other through bus 304. Input / output (I / O) interface 305 is also connected to bus 304.

[0081] The following components are connected to the I / O interface 305: an input section 306 including an audio input device, a button switch, etc.; an output section 307 including a liquid crystal display (LCD) and an audio output device, an indicator light, etc.; a storage section 308 including a hard disk, etc.; and a communication section 309 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 309 performs communication processing via a network such as the Internet. A drive 310 is also connected to the I / O interface 305 as needed. A removable medium 311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 310 as needed so that a computer program read therefrom is installed into the storage section 308 as needed.

[0082] In particular, according to an embodiment of the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 309, and / or installed from a removable medium 311. When the computer program is executed by the central processing unit (CPU) 301, various functions defined in the present invention are performed.

[0083] It should be noted that specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device.

[0084] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present invention. Each box in the flowchart or block diagram may represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings.

[0085] Specifically, the electronic device of this embodiment includes a processor and a memory. The memory stores a computer program. When the computer program is executed by the processor, the layering method of embedded system software provided in the above embodiment is implemented.

[0086] As another aspect, the present invention further provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above storage medium carries one or more computer programs, and when the above one or more computer programs are executed by a processor of the electronic device, the electronic device implements the layering method of embedded system software provided in the above embodiment.

[0087] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

[0088] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.

Claims

1. A layering method for embedded system software, characterized in that: include: Upon receiving the hierarchical instruction, establishing a first interface registration center and a second interface registration center; Detecting the first system software according to the hierarchical instruction to determine the first function of the upper and lower communication modules, the second function of the protocol analysis module, the third function of the link management module, the fourth function of the driver management module and the fifth function of the hardware driver module, wherein the first system software includes the upper and lower communication modules, the protocol analysis module, the link management module, the driver management module and the hardware driver module; Generate first abstract interface information, second abstract interface information, third abstract interface information and fourth abstract interface information respectively according to the first function, the second function, the third function and the fourth function, wherein the first abstract interface information includes a first abstract interface and first abstract interface metadata corresponding to the first abstract interface, the first abstract interface is used to call the first function of the upper and lower communication modules, the second abstract interface information includes a second abstract interface and second abstract interface metadata corresponding to the second abstract interface, the second abstract interface is used to call the second function of the protocol analysis module, the third abstract interface information includes a third abstract interface and third abstract interface metadata corresponding to the third abstract interface, the third abstract interface is used to call the third function of the link management module, the fourth abstract interface information includes a fourth abstract interface and fourth abstract interface metadata corresponding to the fourth abstract interface, and the fourth abstract interface is used to call the fourth function of the driver management module; Registering the first abstract interface information, the second abstract interface information, the third abstract interface information, and the fourth abstract interface information to the first interface registration center, wherein the first interface registration center is used to store and manage the first abstract interface information, the second abstract interface information, the third abstract interface information, and the fourth abstract interface information; Analyzing the hardware driver module according to the fifth function to determine a first type and a number of types of a first hardware driver in the hardware driver module, wherein the number of types is a number corresponding to each type of second hardware driver in the first type, and the first hardware driver includes the second hardware driver; Generate hardware driver abstract interface information according to the first type and the number of types, and register the hardware driver abstract interface information to the second interface registration center, wherein the hardware driver abstract interface information includes a hardware driver abstract interface and a fifth abstract interface metadata corresponding to the hardware driver abstract interface, the hardware driver abstract interface calls the first hardware driver through a preset standard calling mechanism, and the second interface registration center is used to store and manage the hardware driver abstract interface information.

2. The method according to claim 1, characterized in that: The registering the first abstract interface information, the second abstract interface information, the third abstract interface information and the fourth abstract interface information to the first interface registration center specifically includes: Performing a first verification on the first abstract interface to determine whether the first abstract interface is valid; If it is determined that the first abstract interface is valid, register the first abstract interface, the first interface name, the first version number and the first parameter list to the first interface registration center, wherein the first abstract interface metadata includes the first interface name, the first version number and the first parameter list, and the first parameter list includes first interface call parameter information, and the first interface call parameter information is used to describe the parameters that need to be provided when calling the first interface; Performing a second verification on the second abstract interface to determine whether the second abstract interface is valid; If it is determined that the second abstract interface is valid, register the second abstract interface, the second interface name, the second version number and the second parameter list with the first interface registration center, wherein the second abstract interface metadata includes the second interface name, the second version number and the second parameter list, and the second parameter list includes second interface call parameter information, and the second interface call parameter information is used to describe the parameters that need to be provided when calling the second interface; Performing a third verification on the third abstract interface to determine whether the third abstract interface is valid; In the case where it is determined that the third abstract interface is valid, registering the third abstract interface, the third interface name, the third version number and the third parameter list to the target interface registration center, wherein the third abstract interface metadata includes the third interface name, the third version number and the third parameter list, and the third parameter list includes third interface call parameter information, and the third interface call parameter information is used to describe the parameters that need to be provided when calling the third interface; Performing a fourth verification on the fourth abstract interface to determine whether the fourth abstract interface is valid; When it is determined that the fourth abstract interface is valid, the fourth abstract interface, the fourth interface name, the fourth version number and the fourth parameter list are registered to the target interface registration center, wherein the fourth abstract interface metadata includes the fourth interface name, the fourth version number and the fourth parameter list, and the fourth parameter list includes fourth interface call parameter information, and the fourth interface call parameter information is used to describe the parameters that need to be provided when calling the fourth interface.

3. The method according to claim 1, characterized in that Generating hardware driver abstract interface information according to the first type and the number of types, and registering the hardware driver abstract interface information to the second interface registration center specifically includes: Classifying the first hardware drivers according to the first types and the number of types to obtain a hardware driver set; Generate the hardware driver abstract interface information according to the hardware driver set; Register the hardware driver abstract interface information to the second interface registration center.

4. The method according to claim 3, characterized in that The registering the hardware driver abstract interface information to the second interface registration center specifically includes: Performing a third verification on the hardware driver abstract interface to determine whether the hardware driver abstract interface is valid; When it is determined that the hardware driver abstract interface is valid, determining, according to the fifth abstract interface metadata, a second type of a first driver device corresponding to the hardware driver abstract interface, first identity information of the first driver device, a bus directory where the first driver device is located, a protocol bus to which the first driver device belongs, and usage information of the first driver device, wherein the usage information is used to describe a situation in which the first driver device is occupied; The hardware driver abstract interface, the first driver device, the second type, the first identity information, the bus directory, the protocol bus, and the usage information are registered in the second interface registration center.

5. The method according to claim 1, characterized in that After generating hardware driver abstract interface information according to the first type and the number of types, and registering the hardware driver abstract interface information in the second interface registration center, the method further includes: Upon receiving an adjustment instruction of the second hardware driver sent by the upper and lower computer communication modules and receiving a call instruction sent by the link management layer, obtaining a first hardware driver abstract interface corresponding to the second hardware driver from the second interface registration center, wherein the call instruction indicates calling a sixth function corresponding to the second hardware driver through the first hardware driver abstract interface, the first hardware driver includes the second hardware driver, and the hardware driver abstract interface includes the first hardware driver abstract interface; The second hardware driver is adjusted according to the adjustment instruction, and the sixth function of the adjusted second hardware driver is called according to the first hardware driver abstract interface.

6. The method according to claim 1, characterized in that After generating hardware driver abstract interface information according to the first type and the number of types, and registering the hardware driver abstract interface information in the second interface registration center, the method further includes: Running the second system software to obtain the first running result, wherein the second system software is obtained by layering the first system software; When the first operation result shows that a second driving device is connected, determining the second identity information of the second driving device, the second type of the second driving device, and the seventh function of the second driving device; The first hardware driver abstract interface stored in the second interface registration center is filtered according to the second identity information, the second type and the seventh function to obtain a filtering result.

7. The method according to claim 6, characterized in that After filtering the first hardware driver abstract interface stored in the second interface registration center according to the second identity information, the second type and the seventh function to obtain a filtering result, the method further includes: When the screening result shows that the first hardware driver abstract interface matching the second driver device does not exist in the second interface registration center, second hardware driver abstract interface information is generated according to the second identity information, the second type and the seventh function, wherein the second hardware driver abstract interface information includes a second hardware driver abstract interface and sixth abstract interface metadata corresponding to the second hardware driver abstract interface, and the second hardware driver abstract interface is used to call the seventh function of the second driver device.

8. An electronic device, characterized in that: The electronic device comprises: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code comprises computer instructions, and the one or more processors call the computer instructions so that the electronic device executes the method as described in any one of claims 1-7.

9. A computer-readable storage medium comprising instructions, characterized in that: When the instructions are executed on an electronic device, the electronic device is caused to execute the method as claimed in any one of claims 1 to 7.

10. A computer program product, characterized in that When the computer program product is executed on an electronic device, the electronic device is enabled to execute the method according to any one of claims 1 to 7.