Embedded driving framework and equipment operation method

By introducing device layer, interface abstraction layer and platform interface driver into the embedded driver framework, decoupling external device and interface driver information, the portability problem of embedded drivers in the changes in peripheral and interface drivers is solved, and the portability problem of embedded drivers is achieved. High driver flexibility and adaptability.

CN119179517APending Publication Date: 2024-12-24CONTEMPORARY AMPEREX FUTURE ENERGY RES INST (SHANGHAI) LTD +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202310746064.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-21
Publication Date
2024-12-24

AI Technical Summary

Technical Problem

The existing embedded drivers have strong coupling between peripheral chips and interface drivers, which leads to low portability and require frequent modification of programs to adapt to changes in peripheral and interface drivers.

Method used

An embedded driver framework is designed, including the device layer, interface abstraction layer and platform interface driver. By configuring the interface, the external device and interface driver information are decoupled, and the interface driver information and platform interface driver are realized to achieve the interface driver and external device. Decoupling to improve the portability of drivers.

Benefits of technology

Through the difference between decoupling interface drivers and external device drivers, the portability of the embedded driver framework is significantly improved, allowing the flexibly use of peripheral chips under different hardware conditions, reducing the need for driver modification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119179517A_ABST
    Figure CN119179517A_ABST
Patent Text Reader

Abstract

The invention is suitable for the technical field of communication, and provides an embedded drive framework and a device operation method, the embedded drive framework comprises a device layer, an interface abstraction layer and a platform interface drive; the equipment layer is used for providing a configuration interface of a corresponding relation between external equipment and interface driving information; the interface abstraction layer is used for providing a configuration interface of the corresponding relation between the interface drive information and the interface drive included in the platform interface drive; and the platform interface driver is used for providing a corresponding interface driver to communicate with the external equipment based on the corresponding relationship between the interface driver information in the interface abstraction layer and the interface driver. By adopting the embedded driving frame, the portability of the embedded driving frame can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of software technology, and in particular relates to an embedded driver framework, a device operation method, an electronic device, and a readable storage medium. Background Art

[0002] Embedded drivers are drivers written for some devices of embedded operating systems.

[0003] In order to improve the portability of the driver, the existing embedded system driver design method usually performs software abstraction on the peripheral chip (or external device) itself. However, since the designed embedded system driver still has a large coupling when using this method, its portability is still low. Summary of the invention

[0004] The embodiments of the present application provide an embedded driver framework and a device operation method, which can solve the problem of low portability of existing embedded driver frameworks.

[0005] In a first aspect, an embodiment of the present application provides an embedded driver framework, including:

[0006] Device layer, interface abstraction layer and platform interface driver;

[0007] The device layer is used to provide a configuration interface for the correspondence between external devices and interface driver information;

[0008] The interface abstraction layer is used to provide a configuration interface for the correspondence between the interface driver information and the interface drivers included in the platform interface driver;

[0009] The platform interface driver is used to provide a corresponding interface driver to communicate with the external device based on the corresponding relationship between the interface driver information in the interface abstraction layer and the interface driver.

[0010] In the embodiment of the present application, the device layer provides a configuration interface for the correspondence between the external device and the interface driver information, so that the external device is decoupled from the interface driver information. In addition, the interface abstraction layer provides a configuration interface for the correspondence between the interface driver information and the interface driver, so that the actual interface driver is decoupled from the interface driver information (also called the external device driver). That is, since the embedded driver framework provided in the embodiment of the present application can fully shield the design differences between the interface driver and the external device driver, the transplantation capability of the embedded driver framework can be improved.

[0011] In a possible implementation of the first aspect, the device layer includes a first configuration file, the first configuration file includes interface driver information corresponding to the external device, and the device layer provides a configuration interface for the correspondence between the external device and the interface driver information through the first configuration file.

[0012] In a possible implementation manner of the first aspect, the device layer further includes an interface transmission module and a peripheral protocol module;

[0013] The interface transmission module is used to receive or send data;

[0014] The peripheral protocol module is used to parse the data received by the interface transmission module or to package the data to be sent by the interface transmission module.

[0015] In a possible implementation of the first aspect, the interface abstraction layer includes a second configuration file, the second configuration file includes abstracted interface information obtained after abstracting the interface driver included in the platform interface driver, and the interface abstraction layer provides a configuration interface for the correspondence between the interface driver information and the interface drivers included in the platform interface driver through the second configuration file.

[0016] In a possible implementation manner of the first aspect, the second configuration file further includes information of a processor platform corresponding to the interface driver information.

[0017] In a possible implementation manner of the first aspect, the abstracted interface information includes:

[0018] An interface for initialization, an interface for opening a file, an interface for reading data, an interface for writing data and / or an interface for configuration.

[0019] In a second aspect, an embodiment of the present application provides a device operation method, including:

[0020] Parsing configuration information obtained based on a configuration interface of a device layer, and determining interface driver information corresponding to a target external device, wherein the device layer is a device layer in an embedded driver framework as described in the first aspect, the embedded driver framework further includes an interface abstraction layer and a platform interface driver, and the target external device is an external device of the electronic device where the embedded driver framework is located;

[0021] Parsing configuration information obtained based on the configuration interface of the interface abstraction layer, and determining an interface driver corresponding to the interface driver information;

[0022] The interface driver determined by the platform interface driver control communicates with the target external device.

[0023] In a possible implementation manner of the second aspect, the device layer further includes an interface transmission module and a peripheral protocol module, and the device operation method further includes:

[0024] Receiving data through the interface transmission module, and parsing the data received by the interface transmission module through the peripheral protocol module;

[0025] or,

[0026] The data to be sent are packaged through the peripheral protocol module, and the packaged data are sent through the interface transmission module.

[0027] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in the second aspect when executing the computer program.

[0028] In a fourth aspect, an embodiment of the present application provides a readable storage medium, wherein the readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in any one of the second aspects is implemented.

[0029] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes any one of the methods described in the second aspect.

[0030] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.

[0032] Figure 1 It is a structural schematic diagram of an embedded driver framework provided by an embodiment of the present application;

[0033] Figure 2 It is a flow chart of a device operation method provided by an embodiment of the present application;

[0034] Figure 3 It is a flowchart of another device operation method provided by an embodiment of the present application;

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

[0036] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0037] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0038] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0039] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0040] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. appearing in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways.

[0041] Embodiment 1:

[0042] With the development of chip technology, more and more chips (or external devices) can support multiple interfaces. Through such a design, the chip can be driven using different interfaces under different hardware conditions. If software abstraction is only performed on the chip (such as a peripheral chip) itself, that is, the peripheral chip driver and the interface driver are abstracted as a whole, the peripheral chip driver and the interface driver will have a strong coupling and lack independence. Once the peripheral chip driver changes or the interface driver changes, the driver program of the peripheral chip needs to be modified a lot, and the flexibility is low. That is, when software abstraction is only performed on the chip itself, the portability of the embedded driver is low.

[0043] In order to improve the portability of embedded driver programs, an embodiment of the present application provides an embedded driver framework, which includes a device layer obtained by abstracting external devices, a platform interface driver that provides actual interface communication, and an interface abstraction layer that provides a mapping relationship from the device layer to the platform interface driver.

[0044] Through the above configuration, the coupling between the interface of the external device and the interface driver of the platform interface driver can be reduced, thereby improving the portability of the embedded driver framework.

[0045] The embedded driver framework provided in the embodiments of the present application is described below with reference to the accompanying drawings.

[0046] Figure 1 A schematic diagram of the structure of an embedded driver framework provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.

[0047] The embedded driver framework 1 includes a device layer 11 , an interface abstraction layer 12 and a platform interface driver 13 .

[0048] In the embodiment of the present application, the device layer 11 is used to provide a configuration interface for the correspondence between external devices and interface driver information, and the device layer 11 can communicate with the application through the device interface.

[0049] Among them, the external device can be a network device (such as Ethernet network card, EtherCAT interface, etc.), a storage device (Flash, Embedded MultiMedia Card (EMMC)), a communication device (such as RS485 interface, CAN bus interface, etc.).

[0050] Specifically, software abstraction is performed on various external devices that may be used as the electronic device where the embedded driver framework 1 is located to obtain the device layer 11. For example, if it is desired that a storage device can be connected to the electronic device where the embedded driver framework 1 is located, software abstraction needs to be performed on the storage device; if it is desired that a network device can be connected to the electronic device, software abstraction needs to be performed on the network device.

[0051] After obtaining the device layer 11, the correspondence between the external device and the interface driver information can be set based on the configuration interface provided by the device layer 11 to obtain the corresponding configuration information, which is used to indicate the correspondence between the external device and the interface driver information. Among them, the interface driver information is related to the external device. For example, assuming that the external device connected to the electronic device is a hard disk, and the interface driver corresponding to the hard disk is a serial peripheral interface (Serial Peripheral Interface, SPI), then the interface driver information may include: the identification of the SPI interface driver, and may also include the rotation speed, cache capacity, total capacity, etc. Of course, if there are multiple external devices, the interface driver information also includes multiple interface driver information corresponding to the multiple external devices, which will not be repeated here.

[0052] In some embodiments, the interface driver information includes at least one of the following: the type of interface driver, the identifier of the interface driver, the read and write size of the interface driver, etc.

[0053] The type of interface driver is used to classify the type of interface driver corresponding to the external device, for example, to classify whether the external device belongs to the interface driver corresponding to a communication device or the interface driver corresponding to a storage device.

[0054] The identifier of the interface driver may be represented by the serial number of the interface driver, as long as the identifier can distinguish the interface driver.

[0055] The read / write size of the interface driver refers to the size of data that the interface driver can read or write.

[0056] In the embodiment of the present application, the interface abstraction layer 12 is used to provide a configuration interface for the correspondence between the interface driver information and the interface drivers included in the platform interface driver 13 .

[0057] Specifically, the interface abstraction layer 12 only provides a unified configuration interface, and does not directly implement the interface driver itself. Based on the configuration interface provided by the interface abstraction layer 12, the interface driver corresponding to the interface driver information selected by the device layer 11 can be set. Of course, in order to improve the portability of the embedded driver framework 1, the configuration interface provided by the interface abstraction layer 12 is set to be able to set the correspondence between different interface driver information, so that when the user or program selects the interface driver information from the device layer 11, the user or program can determine the interface driver corresponding to the interface driver information in the platform interface driver according to the interface driver information selected by the device layer 11.

[0058] In the embodiment of the present application, the platform interface driver 13 is used to provide a corresponding interface driver to communicate with the external device based on the correspondence between the interface driver information of the interface abstraction layer 12 and the interface driver.

[0059] Among them, the platform interface driver 13 is used to provide the function of a real interface driver. The interface driver determined by the interface abstraction layer 12 is connected to the external device through the actual physical port on the link, that is, the interface driver in the platform interface driver 13 communicates with the external device through the physical interface.

[0060] In the embodiment of the present application, the device layer provides a configuration interface for the correspondence between the external device and the interface driver information, so that the external device is decoupled from the interface driver information. In addition, the interface abstraction layer provides a configuration interface for the correspondence between the interface driver information and the interface driver, so that the actual interface driver is decoupled from the interface driver information (also called the external device driver). That is, since the embedded driver framework provided in the embodiment of the present application can fully shield the design differences between the interface driver and the external device driver, the transplantation capability of the embedded driver framework can be improved.

[0061] In some embodiments, the device layer 11 provides a configuration interface in the form of a program code or a configuration file. When the configuration interface is provided in the form of a configuration file, the device layer 11 includes a first configuration file, the first configuration file includes interface driver information corresponding to the external device, and the device layer 11 provides a configuration interface of the correspondence between the external device and the interface driver information through the first configuration file.

[0062] Since the content presented by the configuration file is more intuitive compared with the program code, setting the first configuration file in the device layer 11 to provide the configuration interface helps the user to set the interface driving information corresponding to the external device more intuitively and accurately.

[0063] In some embodiments, the format of the first configuration file is XML format. Since the XML format is more suitable for user writing and the stored data complexity is lower, when the first configuration file is in XML format, it is more convenient for the user to edit the first configuration file. Of course, in actual situations, the first configuration file can also be in other formats, such as json format, etc., which is not limited here.

[0064] In some embodiments, the device layer 11 further includes an interface transmission module and a peripheral protocol module.

[0065] The above-mentioned interface transmission module is used to receive or send data. The received data here refers to the data sent by other modules received by the interface transmission module, for example, the data sent by the interface abstraction layer 12, or the data sent by the application installed in the electronic device. The sent data here refers to the data sent by the interface transmission module to other modules, for example, the data sent to the interface abstraction layer 12, or the data sent to the application installed in the electronic device.

[0066] The above-mentioned peripheral protocol module is used to parse the data received by the above-mentioned interface transmission module or to package the data to be sent by the above-mentioned interface transmission module. Specifically, the peripheral protocol module parses the data received by the interface transmission module according to various protocols and / or standards defined in the external device manual to determine the meaning corresponding to the received data. For example, by parsing the fields of the received data, the meanings corresponding to these fields can be identified, and then the meanings corresponding to all the received data can be identified. Of course, before the interface transmission module sends data to other modules, the peripheral protocol module also needs to package the data to be sent according to the protocol and / or standard corresponding to the external device, and then the interface transmission module sends the packaged data to other modules (such as filling the corresponding fields with the data to be sent, and then selecting the corresponding fields to send the data).

[0067] In the embodiment of the present application, since the two functions of data transmission and data parsing (or packaging) are separated, it is beneficial to manage these two functions, such as facilitating rapid changes to the data transmission function or the data parsing function, thereby improving the portability of the embedded driver framework.

[0068] In some embodiments, the interface abstraction layer 12 includes a second configuration file, which includes abstracted interface information obtained by abstracting the interface driver included in the platform interface driver 13. The interface abstraction layer 12 provides a configuration interface for the correspondence between the interface driver information and the interface driver included in the platform interface driver 13 through the second configuration file.

[0069] Since the content presented in the configuration file is more intuitive compared to the program code, setting the second configuration file in the interface abstraction layer 12 to provide a configuration interface helps the user to more intuitively and accurately set the interface driver corresponding to the interface driver information.

[0070] In some embodiments, the format of the second configuration file is XML format. Of course, in actual situations, the first configuration file can also be in other formats, such as JSON format, etc., which is not limited here.

[0071] In some embodiments, the second configuration file further includes processor platform information corresponding to the interface driver information.

[0072] The processor platform information includes the name of the platform. In some embodiments, the processor platform information may be ARM, X86, PowerPC, etc.

[0073] In the embodiment of the present application, considering that the interface driver can be implemented on different processor platforms (such as the Media Access Control Address (MAC) interface driver can be implemented on the PowerPC platform and also on the ARM platform), therefore, when the second configuration file is set to also include the processor platform information corresponding to the interface driver information, the user or the program can configure the correspondence between the interface driver information and the processor platform by selecting the corresponding processor platform information, that is, the coupling relationship between the interface driver information and the interface drivers of different processor platforms can be released according to the second configuration file, thereby further improving the portability of the embedded driver framework.

[0074] In some embodiments, the above-mentioned abstracted interface information includes:

[0075] An interface for initialization, an interface for opening a file, an interface for reading data, an interface for writing data and / or an interface for configuration.

[0076] In the embodiment of the present application, the above interface is obtained by abstracting the functions of each interface driver included in the platform interface driver. That is, each interface driver includes at least one of the above interfaces. Since the above five interfaces are abstracted according to each interface driver, that is, the interface abstraction layer 12 does not need to list the functions of various interface drivers when providing the configuration interface, therefore, the interface abstraction layer 12 can provide a unified interface calling method in a more concise manner.

[0077] Embodiment 2:

[0078] Figure 2 A schematic diagram of a process flow of a device operation method provided in an embodiment of the present application is shown, and is described in detail as follows:

[0079] S21. parse the configuration information obtained based on the configuration interface of the device layer, and determine the interface driver information corresponding to the target external device, wherein the device layer is the device layer in the embedded driver framework as described in Example 1, and the embedded driver framework also includes an interface abstraction layer and a platform interface driver, and the target external device is an external device of the electronic device where the embedded driver framework is located.

[0080] Among them, the device layer, interface abstraction layer and platform interface driver are the same as the device layer, interface abstraction layer and platform interface driver of the first embodiment, and are not repeated here.

[0081] Specifically, the embedded driver framework is transplanted into the electronic device, and the user or program determines the interface driver information corresponding to the external device (i.e., the target external device) connected to the electronic device in advance through the configuration interface provided in the device layer, and obtains the configuration information of the device layer. During the operation of the electronic device, the configuration information is obtained and the corresponding relationship between the target external device and the interface driver information is parsed.

[0082] S22: parsing the configuration information obtained based on the configuration interface of the interface abstraction layer, and determining the interface driver corresponding to the interface driver information.

[0083] Specifically, the user or program determines the interface driver corresponding to the interface driver information determined by the device layer in advance through the configuration interface provided by the interface abstraction layer, and obtains the configuration information of the interface abstraction layer. During operation, the electronic device obtains the configuration information of the interface abstraction layer, parses the interface driver, and combines the interface driver information determined by the device layer to determine the corresponding relationship between the interface driver information and the interface driver.

[0084] S23, the interface driver determined by the platform interface driver control communicates with the target external device.

[0085] Specifically, during operation, the electronic device provides a corresponding interface driver to communicate with the target external device according to the interface driver determined by the interface abstraction layer. For example, assuming that the interface driver determined by the interface abstraction layer is a MAC interface driver, the platform interface driver will control the actual MAC interface driver to connect to the external device through the physical port.

[0086] In the embodiment of the present application, since the device layer of the embedded driver framework provides a configuration interface for the correspondence between the external device and the interface driver information, and the interface abstraction layer of the embedded driver framework provides a configuration interface for the correspondence between the interface driver information and the interface driver, the electronic device can determine the interface driver corresponding to the external device based on the device layer and the interface abstraction layer, and control the corresponding interface driver to communicate with the external device through the platform interface driver. That is, since the embedded driver framework has a high portability, when the external device of the electronic device changes, the device layer, the interface abstraction layer and the platform interface driver of the embedded driver framework can also quickly configure the interface driver that can communicate with the changed external device, thereby improving the timeliness of the normal operation of the electronic device.

[0087] In some embodiments, the device layer further includes an interface transmission module and a peripheral protocol module, and the device operation method further includes:

[0088] The data is received through the interface transmission module, and the data received by the interface transmission module is parsed through the peripheral protocol module.

[0089] or,

[0090] The data to be sent are packaged through the above-mentioned peripheral protocol module, and the packaged data are sent through the above-mentioned interface transmission module.

[0091] Specifically, the interface transmission module receives data sent by other modules, and parses the data received by the interface transmission module through the peripheral protocol module, such as after receiving the data sent by the interface abstraction layer, the peripheral protocol module parses the data received by the interface transmission module from the interface abstraction layer. Alternatively, before the interface transmission module sends data to other modules, the peripheral protocol module packages the data to be sent, such as after the peripheral protocol module packages the data to be sent, the interface transmission module sends the packaged data to the interface abstraction layer.

[0092] In the embodiment of the present application, since the two functions of data transmission and data parsing (or packaging) are separated, it is beneficial to manage the two functions.

[0093] In some embodiments, when the device layer provides a configuration interface for the correspondence between the external device and the above-mentioned interface driver information through a first configuration file, the user or program can directly configure the required interface driver information in the first configuration file, such as checking the corresponding interface driver information in the first configuration file to determine the interface driver information corresponding to the target external device.

[0094] In some embodiments, when the interface abstraction layer provides a configuration interface for the correspondence between interface driver information and interface drivers through the second configuration file, the user or program can directly configure the required interface driver in the second configuration file.

[0095] In some embodiments, when the second configuration file also includes information of a processor platform corresponding to the above interface driver information, a user or a program can configure the platform where the interface driver is located in the second configuration file, thereby improving the flexibility of configuring the platform interface driver.

[0096] In order to more clearly describe the operation process of the electronic device after the embedded driver framework is transplanted to the electronic device, the following is combined with Figure 3 Give a description.

[0097] exist Figure 3In the embodiment, it is assumed that the device layer is formed after software abstraction of Ethernet devices, storage devices and communication devices. The first configuration file of the device layer records the interface driver information corresponding to each abstracted device. It is assumed that the user sets the IIC interface driver information to correspond to the storage device, the SPI interface driver information to correspond to the storage device and the communication device, the MAC interface driver information to correspond to the Ethernet device, the SDIO interface driver information to correspond to the storage device, the CAN interface driver information to correspond to the communication device, and the RS485 interface driver information to correspond to the communication device in the first configuration file. Then, the user can set the corresponding relationship between each interface driver information and the interface driver of different platforms in the second configuration file of the interface abstraction layer. For example, if the Powerpc platform and the ARM platform both have an IIC interface driver, a SPI interface driver, a MAC interface driver, a SDIO interface driver, a CAN interface driver, and an RS485 interface, and the platform currently used by the electronic device is the ARM platform, then the corresponding relationship between each interface driver information and the interface driver of the ARM platform can be set in the interface abstraction layer.

[0098] After the first configuration file and the second configuration file set corresponding configuration information, the electronic device can operate based on the set configuration information. Specifically, the electronic device parses the first configuration file of the device layer to obtain the correspondence between the external device and the interface driver information, then parses the second configuration file of the interface abstraction layer, and determines the interface driver of the platform corresponding to the interface driver information in combination with the correspondence between the external device and the interface driver information, and then communicates with the external device based on the determined platform interface driver.

[0099] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0100] Embodiment three:

[0101] Figure 4 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Figure 4 As shown, the electronic device 4 of this embodiment includes: at least one processor 40 ( Figure 4 Only one processor is shown in the figure), a memory 41, and a computer program 42 stored in the above-mentioned memory 41 and executable on the above-mentioned at least one processor 40, wherein the above-mentioned processor 40 implements the steps in any of the above-mentioned method embodiments when executing the above-mentioned computer program 42.

[0102] The electronic device 4 may include, but is not limited to, a processor 40 and a memory 41. Those skilled in the art will appreciate that Figure 4The electronic device 4 is merely an example and does not constitute a limitation on the electronic device 4. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components, for example, it may also include input and output devices, network access devices, etc.

[0103] The processor 40 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0104] In some embodiments, the memory 41 may be an internal storage unit of the electronic device 4, such as a hard disk or memory of the electronic device 4. In other embodiments, the memory 41 may also be an external storage device of the electronic device 4, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 4. Further, the memory 41 may include both an internal storage unit and an external storage device of the electronic device 4. The memory 41 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program. The memory 41 may also be used to temporarily store data that has been output or is to be output.

[0105] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the above-mentioned device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0106] An embodiment of the present application also provides a network device, which includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, wherein the processor implements the steps of any of the above method embodiments when executing the computer program.

[0107] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0108] An embodiment of the present application provides a computer program product. When the computer program product runs on an electronic device, the electronic device can implement the steps in the above-mentioned method embodiments when executing the computer program product.

[0109] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The above-mentioned computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the above-mentioned computer program includes computer program code, and the above-mentioned computer program code can be in source code form, object code form, executable file or some intermediate form. The above-mentioned computer-readable medium may at least include: any entity or device that can carry the computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0110] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0111] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0112] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0113] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0114] The embodiments described above 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, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. An embedded driver framework, characterized in that: include: Device layer, interface abstraction layer and platform interface driver; The device layer is used to provide a configuration interface for the correspondence between external devices and interface driver information; The interface abstraction layer is used to provide a configuration interface for the correspondence between the interface driver information and the interface drivers included in the platform interface driver; The platform interface driver is used to provide a corresponding interface driver to communicate with the external device based on the corresponding relationship between the interface driver information in the interface abstraction layer and the interface driver.

2. The embedded driver framework according to claim 1, characterized in that: The device layer includes a first configuration file, which includes interface driver information corresponding to the external device. The device layer provides a configuration interface for the correspondence between the external device and the interface driver information through the first configuration file.

3. The embedded driver framework according to claim 1 or 2, characterized in that: The device layer also includes an interface transmission module and a peripheral protocol module; The interface transmission module is used to receive or send data; The peripheral protocol module is used to parse the data received by the interface transmission module or to package the data to be sent by the interface transmission module.

4. The embedded driver framework according to claim 1, characterized in that: The interface abstraction layer includes a second configuration file, which includes abstracted interface information obtained by abstracting the interface driver included in the platform interface driver. The interface abstraction layer provides a configuration interface for the correspondence between the interface driver information and the interface drivers included in the platform interface driver through the second configuration file.

5. The embedded driver framework according to claim 4, characterized in that: The second configuration file also includes information of a processor platform corresponding to the interface driver information.

6. The embedded driver framework according to claim 4, characterized in that: The abstracted interface information includes: An interface for initialization, an interface for opening a file, an interface for reading data, an interface for writing data and / or an interface for configuration.

7. A method for operating a device, characterized in that: include: Parsing configuration information obtained based on a configuration interface of a device layer, and determining interface driver information corresponding to a target external device, wherein the device layer is a device layer in an embedded driver framework according to any one of claims 1 to 6, wherein the embedded driver framework further includes an interface abstraction layer and a platform interface driver, and the target external device is an external device of an electronic device where the embedded driver framework is located; Parsing configuration information obtained based on the configuration interface of the interface abstraction layer, and determining an interface driver corresponding to the interface driver information; The interface driver determined by the platform interface driver control communicates with the target external device.

8. The device operation method according to claim 7, characterized in that: The device layer also includes an interface transmission module and a peripheral protocol module, and the device operation method also includes: Receiving data through the interface transmission module, and parsing the data received by the interface transmission module through the peripheral protocol module; or, The data to be sent are packaged through the peripheral protocol module, and the packaged data are sent through the interface transmission module.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 7 or 8 is implemented.

10. A readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to claim 7 or 8 is implemented.

Citation Information

Cited By

  • IIC communication system and IIC communication method

    CN121116884A