Hardware driving system, operation execution method and related apparatus

By introducing a core layer and functional functions into the hardware driver system, the problem of large code modifications during cross-platform porting is solved, achieving a balance between cross-platform portability and operational control of the hardware driver system.

WO2026032109A1PCT designated stage Publication Date: 2026-02-12VIVO MOBILE COMM CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/111560
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-08-05
Filing Date
2025-07-30
Publication Date
2026-02-12

AI Technical Summary

Technical Problem

Existing Linux platform hardware driver systems require extensive code modifications to the drivers of each communication bus in each piece of hardware when porting to a cross-platform environment, resulting in poor cross-platform portability.

Method used

A hardware driver system consisting of an application layer, a core layer, and hardware modules is adopted. The core layer contains function calls for driving the hardware to perform operations. The application layer directly calls these function calls through the core layer to perform operations, reducing the amount of code modification required when porting to a cross-platform environment.

Benefits of technology

It improves the cross-platform portability of the hardware driver system, ensuring that the application layer can control the hardware to perform operations while reducing the amount of code modification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025111560_12022026_PF_FP_ABST
    Figure CN2025111560_12022026_PF_FP_ABST
Patent Text Reader

Abstract

The present application belongs to the technical field of terminals. Disclosed are a hardware driving system, an operation execution method and a related apparatus. The hardware driving system provided in the embodiments of the present application comprises: an application layer, a core layer and a hardware module, wherein the core layer comprises at least one functional function, and each functional function is used for driving hardware to execute an operation; the hardware module comprises at least one piece of first hardware; the application layer is used for sending a first instruction to the core layer, and the first instruction is used for invoking second hardware in the at least one piece of first hardware to execute a first operation; and the core layer is used for determining, from among the at least one functional function and on the basis of the first instruction, a first functional function for driving the hardware to execute the first operation, and invoking the first functional function to drive the second hardware to execute the first operation.
Need to check novelty before this filing date? Find Prior Art

Description

Hardware driving system, operation execution method and related device

[0001] The present application claims priority to the Chinese patent application No. 202411065609.7, filed on August 5, 2024, and entitled "Hardware driving system, operation execution method and related device", the whole content of which is incorporated herein by reference. TECHNICAL FIELD

[0002] The present application belongs to the technical field of terminal, and particularly relates to a hardware driving system, an operation execution method and related device. BACKGROUND

[0003] Generally, in the driving system of the Linux platform, each hardware of the electronic device is connected with the application layer through at least one communication bus, and the driving of each communication bus is stored in each hardware, each communication bus can control the connected hardware through its own driving, so that when the electronic device wants to control the hardware 1 to execute the operation 1, the application layer can send the instruction 1 to the communication bus 1 connected with the hardware 1, the instruction 1 is used to call the hardware 1 to execute the operation 1, so that the communication bus 1 can control the hardware 1 to execute the operation 1 according to the instruction 1 through its own driving 1.

[0004] However, since the driving system may be transplanted to other platforms, at this time, a large amount of code of the driving of each communication bus in each hardware may need to be modified, so that each communication bus can control the connected hardware to execute the operation corresponding to the instruction according to the instruction of the application layer through its own driving, thus leading to poor cross-platform portability of the driving system. SUMMARY

[0005] The purpose of the embodiments of the present application is to provide a hardware driving system, an operation execution method and related device, which can ensure that the application layer of the hardware driving system can control the required hardware to execute the required operation, while improving the cross-platform portability of the hardware driving system.

[0006] In a first aspect, the embodiments of the present application provide a hardware driving system, which comprises an application layer, a core layer and a hardware module, the core layer comprises at least one function function, each function function is used to drive the hardware to execute an operation, the hardware module comprises at least one first hardware; the application layer is used to send a first instruction to the core layer, the first instruction is used to call a second hardware in the at least one first hardware to execute a first operation; the core layer is used to determine a first function function for driving the hardware to execute the first operation from the at least one function function based on the first instruction, and call the first function function to drive the second hardware to execute the first operation.

[0007] In a second aspect, an embodiment of the present application provides an operation execution method, which comprises: sending, by an application layer of a hardware driving system deployed on a platform in an electronic device, a first instruction to a core layer of the hardware driving system, the core layer comprising at least one function function, each function function being configured to drive hardware to perform an operation, the first instruction being configured to call a second hardware in at least one first hardware in a hardware module of the hardware driving system to perform a first operation; determining, by the core layer based on the first instruction, a first function function for driving the hardware to perform the first operation from the at least one function function, and calling the first function function to drive the second hardware to perform the first operation.

[0008] In a third aspect, an embodiment of the present application provides an operation execution apparatus, which comprises: a sending module configured to send, by an application layer of a hardware driving system deployed on a platform in the operation execution apparatus, a first instruction to a core layer of the hardware driving system, the core layer comprising at least one function function, each function function being configured to drive hardware to perform an operation, the first instruction being configured to call a second hardware in at least one first hardware in a hardware module of the hardware driving system to perform a first operation; and a processing module configured to determine, by the core layer based on the first instruction sent by the sending module, a first function function for driving the hardware to perform the first operation from the at least one function function, and call the first function function to drive the second hardware to perform the first operation.

[0009] In a fourth aspect, an embodiment of the present application provides an electronic device, which comprises a processor and a memory, the memory storing programs or instructions executable on the processor, and the programs or instructions are executed by the processor to implement the steps of the method according to the second aspect.

[0010] In a fifth aspect, an embodiment of the present application provides a readable storage medium, the readable storage medium storing programs or instructions, and the programs or instructions are executed by a processor to implement the steps of the method according to the second aspect.

[0011] In a sixth aspect, an embodiment of the present application provides a chip, which comprises a processor and a communication interface, the communication interface being coupled to the processor, and the processor is configured to run programs or instructions to implement the steps of the method according to the second aspect.

[0012] In a seventh aspect, an embodiment of the present application provides a computer program product, the program product being stored in a storage medium, and the program product is executed by at least one processor to implement the steps of the method according to the second aspect.

[0013] In the embodiment of the present application, on the one hand, since the core layer comprises at least one function function for driving the hardware to perform at least one operation, after the application layer sends the first instruction to the core layer, the core layer can directly determine the first function function for driving the hardware to perform the first operation from the at least one function function, and call the first function function to drive the second hardware to perform the first operation, so that it can be ensured that the application layer can control the second hardware to perform the first operation as required; on the other hand, since each function function included in the core layer is for driving the hardware to perform different operations, and there is no function function for driving the hardware to perform the same operation, when the hardware driving system is transplanted to other platforms, only the code of a small number of function functions in the core layer needs to be modified, and the code of a large number of function functions in the related art hardware does not need to be modified, so that the number of codes that need to be modified when the hardware driving system is transplanted to other platforms can be reduced, thereby the cross-platform portability of the hardware driving system can be improved; in this way, the cross-platform portability of the hardware driving system can be improved while ensuring that the application layer of the hardware driving system can control the hardware to perform the operation as required. BRIEF DESCRIPTION OF DRAWINGS

[0014] FIG. 1 is a schematic diagram of a framework of a device driving system of a Linux platform in the related art;

[0015] FIG. 2 is a schematic diagram of a framework of a hardware driving system according to an embodiment of the present application;

[0016] FIG. 3 is a schematic diagram of a framework of a hardware driving system according to an embodiment of the present application;

[0017] FIG. 4 is a schematic diagram of a framework of a hardware driving system according to an embodiment of the present application;

[0018] FIG. 5 is a schematic diagram of a framework of a hardware driving system according to an embodiment of the present application;

[0019] FIG. 6 is a schematic diagram of a framework of a hardware driving system according to an embodiment of the present application;

[0020] FIG. 7 is a schematic diagram of a framework of an electronic device according to an embodiment of the present application;

[0021] FIG. 8 is a schematic diagram of a flow of an operation execution method according to an embodiment of the present application;

[0022] FIG. 9 is a schematic diagram of a flow of an operation execution method according to an embodiment of the present application;

[0023] FIG. 10 is a schematic diagram of a flow of an operation execution method according to an embodiment of the present application;

[0024] FIG. 11 is a structural schematic diagram of an operation execution apparatus according to an embodiment of the present application;

[0025] FIG. 12 is a hardware structural schematic diagram of an electronic device according to an embodiment of the present application;

[0026] FIG. 13 is a hardware structural schematic diagram of an electronic device according to another embodiment of the present application. DETAILED DESCRIPTION

[0027] The technical solutions in the embodiments of the present application will be clearly described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all of them. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art belong to the scope of protection of the present application.

[0028] The terms "first", "second", and the like in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally a category and do not limit the number of objects, for example, the first object can be one or more. In addition, "and / or" in the specification and claims indicates at least one of the connected objects, and the character " / ", generally indicates that the front and rear associated objects are in an "or" relationship.

[0029] The terms "at least one", "at least one of", and the like in the specification and claims of the present application refer to any one of the objects, a combination of any two or more of the objects. For example, at least one of a, b, and c can mean "a", "b", "c", "a and b", "a and c", "b and c", and "a, b, and c", where a, b, and c can be single or multiple. Similarly, "at least two" refers to two or more, and its meaning is similar to "at least one".

[0030] The hardware driving system, operation execution method, and related apparatus provided by the embodiments of the present application will be described in detail below with reference to the drawings and specific embodiments and their application scenarios.

[0031] Currently, a device driver system as shown in FIG. 1 is commonly used in a Linux platform, which can include an application layer, a software layer and a hardware layer. The hardware abstraction layer (HAL) is arranged in the application layer, and a plurality of hardware of an electronic device, such as a camera, an external chip and the like, are included in the hardware layer. The application layer can be connected with the software layer. The software layer is connected with the camera through at least one communication bus (for example, an Inter-Integrated Circuit (I2C) bus 1), and is connected with the external chip through at least one communication bus (for example, a Serial Peripheral Interface (SPI) bus 2, a Secure Digital Input and Output (SDIO) bus 2 and the like). The driver of each communication bus is stored in each hardware. For example, the driver 1 of the I2C bus 1 is stored in the camera, and the driver 2 of the SPI bus 2 and the driver 3 of the SDIO bus 2 are stored in the external chip. The I2C bus 1 can control the camera through the driver 1. The driver 1 includes a plurality of function functions. Each function function is used to drive the camera to perform an operation. Therefore, the I2C bus 1 can call different function functions through the driver 1 to control the camera to perform different operations. The SPI bus 2 can control the external chip through the driver 2. The driver 2 includes a plurality of function functions. Each function function is used to drive the external chip to perform an operation. Therefore, the SPI bus 2 can call different function functions through the driver 1 to control the external chip to perform different operations. The SDIO bus 2 can control the external chip through the driver 3. The driver 3 includes a plurality of function functions. Each function function is used to drive the external chip to perform an operation. Therefore, the SDIO bus 2 can call different function functions through the driver 3 to control the external chip to perform different operations. Therefore, when the electronic device wants to control a certain hardware (for example, the external chip) to perform an operation (for example, an image processing operation), the HAL of the application layer can first determine the communication buses connected with the external chip, that is, the SPI bus 2 and the SDIO bus 2, through the software layer, and then determine one communication bus used to perform the image processing operation from the SPI bus 2 and the SDIO bus 2, for example, the SPI bus 2. Then, the HAL can send an instruction 1 to the SPI bus 2. The instruction 1 is used to call the external chip to perform the image processing operation. The SPI bus 2 can determine the function function 1 required to perform the image processing operation according to the instruction 1 through the driver 2 of itself, and call the function function 1 to control the external chip to perform the image processing operation.However, the applicant found in the use that, due to the possibility of transplanting the device driver system to other platforms, a large amount of code of the driver of each communication bus in each hardware needs to be modified, for example, the code of the plurality of function functions in the driver 1 needs to be modified, so that the modified driver 1 in the camera can control the camera to perform the operation corresponding to the instruction according to the instruction of the application layer, the code of the plurality of function functions in the driver 2 needs to be modified, so that the modified driver 2 in the external chip can control the external chip to perform the operation corresponding to the instruction according to the instruction of the application layer, and the code of the plurality of function functions in the driver 3 needs to be modified, so that the modified driver 3 in the external chip can control the external chip to perform the operation corresponding to the instruction according to the instruction of the application layer, thus resulting in poor portability of the device driver system.

[0032] However, the device driver model is improved in the embodiments of the present application. A new hardware driver system is adopted in the embodiments of the present application. The hardware driver system includes an application layer, a core layer and a hardware module. The core layer includes at least one function function. Each function function is used to drive the hardware to perform an operation. The hardware module can include the camera and the external chip. Of course, the hardware module can also include other hardware, which is not exhausted herein. The application layer is used to send an instruction 1 to the core layer. The instruction 1 is used to call a certain hardware (for example, the external chip) to perform an image processing operation. The core layer is used to determine a function function 1 for driving the hardware to perform the image processing operation from the at least one function function based on the instruction 1, and call the function function 1 to drive the external chip to perform the image processing operation. It can be understood that, on the one hand, since the core layer includes at least one function function for driving the hardware to perform at least one operation, after the application layer sends the instruction 1 for calling the external chip to perform the image processing operation to the core layer, the core layer can directly determine the function function 1 for driving the hardware to perform the image processing operation from the at least one function function, and call the function function 1 to drive the external chip to perform the image processing operation. Therefore, it can be ensured that the application layer can control the required hardware to perform the required operation. On the other hand, since each function function included in the core layer is used to drive the hardware to perform different operations, that is, the number of the at least one function function included in the core layer is less than the number of the function functions in the hardware in the hardware layer. Therefore, when the hardware driver system is transplanted to other platforms, only the code of the small number of function functions in the core layer needs to be modified, and the code of the large number of function functions in the hardware in the hardware layer does not need to be modified. Therefore, the number of the code that needs to be modified when the hardware driver system is transplanted to other platforms can be reduced, thereby improving the cross-platform portability of the hardware driver system. In this way, the cross-platform portability of the hardware driver system can be improved while ensuring that the application layer of the hardware driver system can control the required hardware to perform the required operation.

[0033] The embodiments of the present application provide a hardware driver system. FIG. 2 shows a framework schematic diagram of a hardware driver system provided by the embodiments of the present application. As shown in FIG. 2, the hardware driver system provided by the embodiments of the present application can include an application layer 10, a core layer 11 and a hardware module 12. The core layer 11 includes at least one function function. Each function function is used to drive the hardware to perform an operation. The hardware module 12 includes at least one first hardware 121.

[0034] In the embodiments of this application, the application layer 10 is configured to send a first instruction to the core layer 11, the first instruction being used to call a second hardware in the at least one first hardware 121 to perform a first operation; and the core layer is configured to determine a first function function for driving the hardware to perform the first operation from the at least one function function based on the first instruction, and call the first function function to drive the second hardware to perform the first operation.

[0035] In some embodiments of this application, in combination with FIG. 2, the application layer 10 can further include a HAL 101, so that when the electronic device receives an input of a first control displayed by the electronic device, the electronic device can send a second instruction to the HAL 101, the second instruction being used to request to call the second hardware to perform the first operation, so that the HAL 101 can send the first instruction to the core layer 11. The first control is used to trigger the second hardware to perform the first operation.

[0036] In some embodiments of this application, the at least one first hardware 121 can include at least one of the following: a plug-in chip, a system on chip (SoC), a camera, an audio device, and the like. Of course, the at least one first hardware 121 can also include other hardware, which is not limited in the embodiments of this application.

[0037] In some embodiments of this application, in combination with FIG. 2, the core layer 11 further includes a second interface 111 connected with the application layer 10; and the second interface 111 is used for data transmission between the core layer 11 and the application layer 10.

[0038] In some embodiments of this application, the second interface 111 can be referred to as a hal_Inf interface, or an application layer interface. Of course, the second interface 111 can also be referred to as other interfaces, which are not limited in the embodiments of this application.

[0039] In some embodiments of this application, the second interface 111 can be used to send instructions or data from the application layer 10 to the core layer 11, or can be used to send instructions or data from the core layer 11 to the application layer 10.

[0040] The instructions can include the first instruction, and the data can include image data.

[0041] In some embodiments of this application, the second interface 111 can be connected with the HAL 101 in the application layer 10.

[0042] As can be seen, since the second interface is also deployed in the core layer, the application layer and the core layer can directly interact with each other through the second interface, without the need for forwarding through other layers, so that the time consumption of data interaction between the application layer and the core layer can be reduced.

[0043] In some embodiments of the present application, the core layer 11 can be composed of a plurality of codes.

[0044] In some embodiments of the present application, the at least one function function can be preconfigured, or obtained by the core layer 11 from other layers, or agreed by a protocol, which is not limited in the embodiments of the present application.

[0045] In the case that the at least one function function is obtained by the core layer 11 from other layers, the core layer 11 can obtain the at least one function function from the application layer 10.

[0046] It can be understood that in the embodiments of the present application, each function function is used to drive the hardware to perform an operation, i.e., different function functions are used to drive the hardware to perform different operations, and the repeated codes between the function functions used to perform different operations are less. Therefore, the repeated codes between the at least one function function are less. Moreover, compared with the related art, the function functions in the embodiments of the present application are no longer deployed in the driver of the communication bus, i.e., each function function is not coupled with the communication bus. Therefore, the case that a plurality of function functions used to drive the hardware to perform the same operation through different communication buses are stored in the core layer 11 can be avoided, so that the repeated function functions stored in the core layer 11 can be reduced.

[0047] In some embodiments of the present application, the at least one operation performed by the at least one function function can include at least one of the following: an image processing operation, a hardware loading operation, a function verification operation, a data extraction operation, an image format conversion operation, etc. Of course, the at least one operation can also include other operations, which are not limited in the embodiments of the present application.

[0048] In some embodiments of the present application, the core layer 11 further stores a correspondence between the at least one operation and the identifier of the at least one function function. Therefore, when the core layer 11 obtains the first instruction, the core layer 11 can determine the identifier of the first function function corresponding to the first operation called by the first instruction from the correspondence, so that the core layer 11 can call the first function function. The identifier can be a name or an index.

[0049] In some embodiments of the present application, the core layer 11 can be connected with the at least one first hardware 121 through at least one communication bus (for example, the first communication bus in the following embodiments), the first instruction can further carry the hardware identifier of the second hardware, and the core layer 11 stores the correspondence between the at least one hardware identifier and the at least one communication bus, so that the core layer 11 can determine one hardware identifier same as the hardware identifier of the second hardware from the at least one hardware identifier according to the hardware identifier of the second hardware, and determine one communication bus corresponding to the one hardware identifier as the communication bus for controlling the second hardware to perform the first operation, and then the core layer 11 can control the second hardware to perform the first operation through the one communication bus.

[0050] The specific scheme that the core layer 11 drives the second hardware to perform the first operation will be illustrated below in combination with the specific structure of the core layer 11.

[0051] In some embodiments of the present application, as shown in FIG. 3, the core layer 11 includes the first module 112 and the second module 113, the first module 112 is connected with the second module 113, and the second module 113 includes at least one function function.

[0052] In some embodiments of the present application, the first module 112 can be referred to as a master module or a management module. Of course, the first module 112 can also be referred to as other names, which are not limited in the embodiments of the present application.

[0053] In some embodiments of the present application, the first module 112 can be connected with the application layer 10 through the second interface 111.

[0054] In some embodiments of the present application, the first module 112 can be connected with the at least one first hardware 121 through one interface (for example, the first interface in the following embodiments) and the at least one communication bus. Alternatively, the first module 112 can be directly connected with the at least one first hardware 121 through the at least one communication bus.

[0055] In some embodiments of the present application, the first module 112 can associate and bind a plurality of interfaces (for example, the first interface and the third interface in the following embodiments, the second interface in the above embodiments, etc.) in the core layer 11, so that the first module 112 can interact information with the second hardware or other layers (for example, the application layer in the above embodiments, the software layer in the following embodiments, etc.) through the plurality of interfaces.

[0056] In some embodiments of the present application, the second module 113 can be referred to as a business logic module or a function module. Of course, the second module 113 can also be referred to as other names, which are not limited in the embodiments of the present application.

[0057] In some embodiments of the present application, the first module 112 is configured to determine the first function function based on the first instruction, and send first request information to the second module 113, the first request information being used to find the first function function. The second module 113 is configured to determine the first function function from the at least one function function according to the first request information. The first module 112 is further configured to call the first function function to drive the second hardware to perform the first operation.

[0058] In some embodiments of the present application, the first request information carries the identifier of the first function function, so that the second module 113 can determine the first function function from the second module 113 according to the identifier of the first function function, and provide the first function function to the first module 112.

[0059] Therefore, the core layer and the at least two hardware can be decoupled, which facilitates maintenance and cross-platform transplantation.

[0060] In some embodiments of the present application, as shown in FIG. 4, the core layer 11 further includes a first interface 114, the first interface 114 is connected with the at least one first hardware 121 through at least one first communication bus 115, the first interface 114 includes at least one first driver, and each first communication bus 115 controls one first hardware 121 through each first driver.

[0061] In some embodiments of the present application, the first interface 114 can be referred to as an input / output (IO) interface or a core layer control interface. Of course, the first interface 114 can also be referred to as other names, which are not limited in the embodiments of the present application.

[0062] In some embodiments of the present application, the at least one first communication bus 115 can include at least one of the following: an SPI communication bus, an i2C communication bus, and an sdio communication bus. Of course, the at least one first communication bus 115 can also include other communication buses, which are not limited in the embodiments of the present application.

[0063] In some embodiments of the present application, each of the at least one first hardware 121 can be connected with the first interface 114 through one or at least two first communication buses 115, or a part of the at least one first hardware 121 can be connected with the first interface 114 through one or at least two first communication buses 115, and the other part of the at least one first hardware 121 can be connected with the part of the at least one first hardware 121.

[0064] In some embodiments of the present application, each of the at least one first driver is configured to indicate a first hardware 121 connected to a first communication bus 115.

[0065] In some embodiments of the present application, when the at least one first hardware 121 is connected to the first interface 114, each of the first hardware 121 can initiate at least one third request information to the first interface 114, each of the third request information is configured to request to register each of the first communication bus 115 connected to the first hardware 121, and each of the third request information carries a hardware identifier of the first hardware 121 connected to each of the first communication bus 115, so that the first interface 114 can store a correspondence between the hardware identifier of the first hardware 121 and the first communication bus 115, to facilitate determining the first communication bus 115 connected to each of the first hardware 121.

[0066] In some embodiments of the present application, the first module 112 is further configured to send a second request information to the first interface 114 based on the first instruction, the second request information is configured to request a second driver, the second driver is a driver in the at least one first driver for indicating a second communication bus, the second communication bus is a communication bus in the at least one first communication bus 115 connected to a second hardware; the first interface 114 is configured to match the second driver corresponding to the second communication bus according to the second request information; and the first module 114 is further configured to call the first function and the second driver to control the second hardware to perform the first operation through the second communication bus.

[0067] In some embodiments of the present application, the first instruction further carries a hardware identifier of the second hardware, and the second request information further carries the hardware identifier of the second hardware. Thus, the first interface 114 can determine the second communication bus corresponding to the hardware identifier of the second hardware from the correspondence between the hardware identifier of the first hardware 121 and the first communication bus 115.

[0068] In some embodiments of the present application, when the number of the first communication bus 115 connected to the second hardware is at least two, each of the first communication bus 115 is configured to transmit data of one type of data, so that the first interface 114 can further select the second communication bus with the same type of data from the at least two first communication bus 115 according to the type of data corresponding to the first operation.

[0069] Therefore, the first interface can directly determine the second communication bus connected with the second hardware from the at least one first communication bus without determining through the first function, so that the case that a plurality of first communication buses store the function of performing the same operation in the second module can be avoided, the number of functions stored in the second module can be reduced, and the cross-platform portability of the hardware driving system can be improved.

[0070] In addition, the first module 112 can connect the at least one first hardware 121 through the first interface 114, so that the first module 112 can uniformly manage the at least one first hardware 121 to control the at least one first hardware 121 to perform operations.

[0071] In some embodiments of the present application, as shown in FIG. 5, the core layer 11 further includes a third interface 116 connected with the software layer 13, and the third interface is used for data transmission between the core layer 11 and the software layer 13.

[0072] In some embodiments of the present application, the third interface 116 can be referred to as a driver_inf interface or a platform driver interface. Of course, the third interface 116 can also be referred to as other names, which are not limited in the embodiments of the present application.

[0073] In some embodiments of the present application, the third interface 116 is specifically used for transmitting service data or instructions between the core layer 11 and the software layer 13.

[0074] Therefore, the third interface can be deployed in the core layer, so that data between the core layer and the software layer in the related technology can be transmitted through the third interface, so that the hardware driving system and the driving system in the related technology can interact, and the cross-platform portability of the hardware driving system can be further improved.

[0075] The embodiment of the present application provides a hardware driving system, which comprises an application layer, a core layer and a hardware module, the core layer comprises at least one function function, each function function is used for driving hardware to execute an operation, and the hardware module comprises at least one first hardware; wherein the application layer is used for sending a first instruction to the core layer, the first instruction is used for calling a second hardware in the at least one first hardware to execute a first operation; the core layer is used for determining a first function function for driving the hardware to execute the first operation from the at least one function function based on the first instruction, and calling the first function function to drive the second hardware to execute the first operation. In the embodiment of the present application, on the one hand, since the core layer comprises at least one function function for driving hardware to execute at least one operation, after the application layer sends the first instruction to the core layer, the core layer can directly determine the first function function for driving the hardware to execute the first operation from the at least one function function, and call the first function function to drive the second hardware to execute the first operation, so that it can be ensured that the application layer can control the required second hardware to execute the required first operation; on the other hand, since each function function included in the core layer is used for driving hardware to execute different operations, and there is no function function for driving hardware to execute the same operation, so in the case of transplanting the hardware driving system to other platforms, only the code of a small number of function functions in the core layer needs to be modified, and the code of a large number of function functions in the related hardware does not need to be modified, so that the number of codes that need to be modified in the case of transplanting the hardware driving system to other platforms can be reduced, thereby the cross-platform portability of the hardware driving system can be improved; in this way, the cross-platform portability of the hardware driving system can be improved while ensuring that the application layer of the hardware driving system can control the required hardware to execute the required operation.

[0076] And since each function function included in the core layer is used for driving hardware to execute different operations, instead of different hardware as in the related art, there is a function function for driving hardware to execute the same operation, so that the development amount in the process of developing the hardware driving system can be reduced.

[0077] The working process of the hardware driving system provided by the embodiment of the present application will be illustrated by specific examples below.

[0078] In combination with the above Figs. 1-5, as shown in Fig. 6, it is assumed that at least one first hardware 121 in the above hardware module 12 includes an add-on chip 122, and the electronic device further includes a camera 14 connected to the add-on chip 122 through a system on chip (SoC), wherein the add-on chip 122 adopts the hardware driving system provided in the embodiments of the present application, that is, the add-on chip 122 is connected to the core layer 11 through two first communication buses (for example, an SPI communication bus 1151 and an sdio communication bus 1152), the SPI communication bus 1151 is used to transmit meta information, and the sdio communication bus 1152 is used to transmit hardware information of the hardware, and the camera 14 adopts a traditional Linux framework, that is, the camera 14 is connected to the software layer 13 through an i2c communication bus 15, and the software layer 13 is connected to the core layer 11 through a third interface 116.

[0079] Firstly, the above hardware driving system can first perform a loading process, which is specifically as follows:

[0080] S11, the HAL 101 of the application layer 10 can send an instruction to the software layer 13, the instruction being used to control the camera 14 to start up, and after the camera 14 implements i2c driving, the camera 14 is directly registered in the software layer 13 to save the correspondence between the i2c communication bus 15 and the hardware identifier of the camera 14 in the software layer 13.

[0081] S12, the driving of the SPI communication bus 1151 and the sdio communication bus 1152 can be respectively registered in the first interface 114 to store the correspondence between the SPI communication bus 1151 and the hardware identifier of the add-on chip 122, and the correspondence between the sdio communication bus 1152 and the hardware identifier of the add-on chip 122 in the first interface 114. Moreover, the driving of the SPI communication bus 1151 and the sdio communication bus 1152 can also store the correspondence between the data type of the meta information and the SPI communication bus 1151, and the correspondence between the data type of the hardware information and the sdio communication bus 1152 in the first interface 114.

[0082] S13, the first interface 114 is bound with the first module 112.

[0083] S14, the second interface 111 and the third interface 116 are bound with the first module 112.

[0084] Then, the above hardware driving system can perform an initialization operation, which is specifically as follows:

[0085] S21, the first module 112 receives an instruction for calling the external chip 122 to perform an initialization operation from the application layer 10 through the second interface 111, the first module 112 determines a loading firmware function function corresponding to the initialization operation, and sends first request information to the second module 113 to query the loading firmware function function, so that the second module 113 can provide the loading firmware function function, so that the first module 112 can call the loading firmware function function.

[0086] S22, the first module 112 sends second request information to the first interface 114 to query the sdio drive of the sdio communication bus 1152, the sdio drive is used to instruct the sdio communication bus 1152, the sdio communication bus 1152 is connected with the external chip 122, and the data type corresponding to the sdio communication bus 1152 is the same as the data type of the hardware information, that is, the data type of the data corresponding to the initialization operation, so that the first interface 114 can match the sdio drive.

[0087] S23, the first module 112 can call the sdio drive to control the external chip 122 to perform the initialization operation through the sdio communication bus 1152, so that the external chip 122 can obtain the hardware information of the external chip 122 and / or the camera 14.

[0088] S24, after the external chip 122 performs the initialization operation, the external chip 122 can transmit the hardware information of the external chip 122 and / or the camera 14 to the first module 112 through the sdio communication bus 1152, so as to complete the initialization operation.

[0089] Next, the above hardware driver system can perform a photographing operation, specifically as follows:

[0090] S31, first, the user clicks the "photographing" control (i.e. the first control), and then the photographing instruction can reach the HAL 101 through a series of calls, after the HAL 101 receives the photographing instruction, first, through the second interface 111, informs the core layer 11 that the image processing operation needs to be performed through the external chip 122; through the HAL 101, the traditional Linux platform call is made to the software layer 13, and the command of collecting images is issued to the camera 14.

[0091] S32, after the core layer 11 receives the instruction of performing the image processing operation through the external chip 122, the instruction is sent to the first module 112, because the meta information and the image need to be sent to the external chip 122 for processing, so the first module 112 suspends the instruction first; on the other hand, the software layer 13 can inform the camera 14 to start collecting images through the i2c communication bus 15.

[0092] S33, the camera 14 collects the image, which can be stored in the memory, and generates meta information, so that the software layer 13 can pass the meta information and image data address (i.e. the address of the image in the memory) to the core layer 11 through the third interface 116.

[0093] S34, the meta information is passed to the first module 112 by the third interface 116.

[0094] S35, after the first module 112 gets the meta information, it continues to execute the suspended instructions, determines the meta filling function function corresponding to the photographing operation, and sends the first request information to the second module 113 to query the meta filling function function, so that the second module 113 can provide the meta filling function function, and then the first module 112 can call the meta filling function function to fill the information required for image processing in the meta information, and generate new meta information.

[0095] S36, the first module 112 sends the second request information to the first interface 114 to query the SPI drive of the SPI communication bus 1151, which is used to instruct the SPI communication bus 1151, which is connected with the external chip 122, and the data type corresponding to the SPI communication bus 1151 is the same as that of the meta information, that is, the data type corresponding to the image processing operation, so that the first interface 114 can match the SPI drive.

[0096] S37, the first module 112 can call the SPI drive to send the above new meta information to the external chip 122 through the SPI communication bus 1151, and instruct the external chip 122 to perform image processing operation on the image according to the new meta information, and finally return the processed data to the application layer 10, that is, complete the photographing operation.

[0097] The embodiment of the application provides an electronic device. Figure 7 shows a schematic diagram of the framework of an electronic device provided by the embodiment of the application. As shown in Figure 7, the electronic device provided by the embodiment of the application is provided with a platform 20, and the hardware drive system 21 in the above embodiment is deployed on the platform 20.

[0098] The electronic device provided in the embodiments of the present application is provided with a platform, and a hardware driving system is deployed on the platform. In the embodiments of the present application, on the one hand, since the core layer includes at least one function function for driving hardware to perform at least one operation, after the application layer sends a first instruction to the core layer, the core layer can directly determine a first function function for driving hardware to perform a first operation from the at least one function function, and call the first function function to drive the second hardware to perform the first operation, so that it can be ensured that the application layer can control the second hardware to perform the first operation. On the other hand, since each function function included in the core layer is used to drive hardware to perform different operations, and there is no function function for driving hardware to perform the same operation, when the hardware driving system is transplanted to other platforms, only the code of a small number of function functions in the core layer needs to be modified, and the code of a large number of function functions in the related art hardware does not need to be modified, so that the number of codes that need to be modified when the hardware driving system is transplanted to other platforms can be reduced, thereby improving the cross-platform portability of the hardware driving system. In this way, while ensuring that the application layer of the hardware driving system can control the hardware to perform the operation required by the hardware driving system, the cross-platform portability of the hardware driving system can be improved.

[0099] FIG. 8 shows a flowchart of an operation execution method provided in the embodiments of the present application. As shown in FIG. 8, the operation execution method provided in the embodiments of the present application can include the following steps 101 and 102.

[0100] Step 101: The electronic device sends a first instruction to a core layer of a hardware driving system through an application layer of the hardware driving system deployed on a platform provided in the electronic device.

[0101] In the embodiments of the present application, the core layer includes at least one function function, and each function function is used to drive hardware to perform an operation. The first instruction is used to call a second hardware in at least one first hardware in a hardware module of the hardware driving system to perform a first operation.

[0102] It should be noted that the description of the first instruction, the at least one first hardware, the second hardware, and the first operation can refer to the specific description in the above embodiments, which will not be repeated here.

[0103] In some embodiments of the present application, when the electronic device displays a shooting interface, the user can perform a click input on a “shooting” control (for example, the first control in the above embodiments) in the shooting interface, so that the application layer can send a first instruction to the core layer.

[0104] In step 102, the electronic device determines, based on the first instruction, a first function function for driving the hardware to perform the first operation from the at least one function function through the core layer, and invokes the first function function to drive the second hardware to perform the first operation.

[0105] It should be noted that the description of the electronic device determining, based on the first instruction, the first function function for driving the hardware to perform the first operation from the at least one function function through the core layer can refer to the specific description in the above embodiments, and the embodiments of the present application will not be repeated here.

[0106] In some embodiments of the present application, as shown in FIG. 9, the above step 102 can be implemented by steps 102a-102c in combination with FIG. 8.

[0107] In step 102a, the electronic device determines the first function function based on the first instruction through the first module of the core layer, and sends first request information to the second module of the core layer.

[0108] In the embodiments of the present application, the above first request information is used to find the first function function.

[0109] It should be noted that the description of the electronic device determining, based on the first instruction, the first function function through the first module of the core layer can refer to the specific description in the above embodiments, and the embodiments of the present application will not be repeated here.

[0110] In step 102b, the electronic device determines the first function function from the at least one function function according to the first request information through the second module.

[0111] It should be noted that the description of the electronic device determining, based on the first instruction, the first function function through the second module according to the first request information can refer to the specific description in the above embodiments, and the embodiments of the present application will not be repeated here.

[0112] In step 102c, the electronic device invokes the first function function through the first module to drive the second hardware to perform the first operation.

[0113] It should be noted that the description of the electronic device invoking the first function function through the first module can refer to the specific description in the above embodiments, and the embodiments of the present application will not be repeated here.

[0114] As can be seen, since the at least one function function can be stored in the second module without storing the function function in each hardware, the core layer and the at least two hardware can be decoupled, which facilitates maintenance and cross-platform transplantation.

[0115] In some embodiments of the present application, as shown in Figure 10, before the step 102c, the operation execution method provided by the embodiments of the present application can further include the following steps 201 and 202, and the step 102c can be implemented by the following step 102c1.

[0116] The step 201 comprises: sending, by the electronic device, second request information to the first interface of the core layer based on the first instruction through the first module.

[0117] In the embodiments of the present application, the second request information is used to request the second driver, the first interface is connected with the at least one first hardware through the at least one first communication bus, the first interface includes the at least one first driver, each first communication bus controls one first hardware through each first driver, and the second driver is a driver in the at least one first driver used to indicate the second communication bus, and the second communication bus is a communication bus in the at least one first communication bus connected with the second hardware.

[0118] It should be noted that the description of sending, by the electronic device, second request information to the first interface of the core layer based on the first instruction through the first module can refer to the specific description in the above embodiments, and the embodiments of the present application will not be repeated here.

[0119] The step 202 comprises: matching, by the electronic device, the second driver corresponding to the second communication bus according to the second request information through the first interface.

[0120] It should be noted that the description of matching, by the electronic device, the second driver corresponding to the second communication bus according to the second request information through the first interface can refer to the specific description in the above embodiments, and the embodiments of the present application will not be repeated here.

[0121] The step 102c1 comprises: calling, by the electronic device, the first function function and the second driver through the first module to control the second hardware to execute the first operation through the second communication bus.

[0122] It should be noted that the description of calling, by the electronic device, the first function function and the second driver through the first module to control the second hardware to execute the first operation through the second communication bus can refer to the specific description in the above embodiments, and the embodiments of the present application will not be repeated here.

[0123] Therefore, the electronic device can directly determine the second communication bus connected with the second hardware from the at least one first communication bus through the first interface without determining through the first function function, so that the case of storing multiple function functions of the first communication bus executing the same operation in the second module can be avoided, thereby reducing the number of function functions stored in the second module, and further improving the cross-platform portability of the hardware driver system.

[0124] The embodiment of the present application provides an operation execution method, and the electronic device can send a first instruction to a core layer of a hardware driving system through an application layer of the hardware driving system deployed on a platform arranged in the electronic device, and determine a first function function for driving hardware to execute a first operation from at least one function function based on the first instruction, and call the first function function to drive the second hardware to execute the first operation. In the embodiment of the present application, on the one hand, since the core layer includes at least one function function for driving hardware to execute at least one operation, after the application layer sends the first instruction to the core layer, the core layer can directly determine the first function function for driving hardware to execute the first operation from the at least one function function, and call the first function function to drive the second hardware to execute the first operation, so that it can be ensured that the application layer can control the second hardware to execute the first operation. On the other hand, since each function function included in the core layer is used for driving hardware to execute different operations, and there is no function function for driving hardware to execute the same operation, in the case of porting the hardware driving system to other platforms, only the code of a small number of function functions in the core layer needs to be modified, and the code of a large number of function functions in the related hardware does not need to be modified, so that the number of codes that need to be modified in the case of porting the hardware driving system to other platforms can be reduced, thereby the cross-platform portability of the hardware driving system can be improved. In this way, the cross-platform portability of the hardware driving system can be improved while ensuring that the application layer of the hardware driving system can control the hardware to execute the operation.

[0125] The operation execution method provided in the embodiment of the present application can be executed by the operation execution device. In the embodiment of the present application, the operation execution device is taken as an example to illustrate the operation execution device provided in the embodiment of the present application.

[0126] The embodiment of the present application provides an operation execution device. FIG. 11 shows a framework schematic diagram of an operation execution device provided in the embodiment of the present application. As shown in FIG. 11, the operation execution device 40 provided in the embodiment of the present application can include: a sending module 41, configured to send a first instruction to a core layer of a hardware driving system through an application layer of the hardware driving system deployed on a platform arranged in the operation execution device 40, the core layer including at least one function function, and each function function being used for driving hardware to execute one operation, and the first instruction being used for calling a second hardware in at least one first hardware in a hardware module of the hardware driving system to execute a first operation. A processing module 42, configured to determine a first function function for driving hardware to execute the first operation from the at least one function function based on the first instruction sent by the sending module 41, and call the first function function to drive the second hardware to execute the first operation.

[0127] The embodiment of the present application provides an operation execution device, on one hand, since the core layer comprises at least one function function for driving hardware to execute at least one operation, after the application layer sends a first instruction to the core layer, the core layer can directly determine a first function function for driving hardware to execute a first operation from the at least one function function, and call the first function function to drive the second hardware to execute the first operation, so that it can be ensured that the application layer can control the second hardware to execute the required first operation; on the other hand, since each function function included in the core layer is used for driving hardware to execute different operations, and there is no function function for driving hardware to execute the same operation, when the hardware driving system is transplanted to other platforms, only the code of a small number of function functions in the core layer needs to be modified, and the code of a large number of function functions in the related hardware does not need to be modified, so that the number of codes that need to be modified when the hardware driving system is transplanted to other platforms can be reduced, and the cross-platform portability of the hardware driving system can be improved; in this way, the cross-platform portability of the hardware driving system can be improved while ensuring that the application layer of the hardware driving system can control the hardware to execute the required operation.

[0128] In a possible implementation, the processing module 42 is specifically configured to determine a first function function based on the first instruction by the first module of the core layer, and send first request information to the second module of the core layer, the first request information being used for searching the first function function; and determine the first function function from the at least one function function according to the first request information by the second module; and call the first function function by the first module to drive the second hardware to execute the first operation.

[0129] In a possible implementation, the processing module 42 is further configured to, before calling the first function function by the first module to drive the second hardware to execute the first operation, send second request information to the first interface of the core layer based on the first instruction by the first module, the second request information being used for requesting a second driver, the first interface being connected with at least one first hardware through at least one first communication bus, the first interface comprising at least one first driver, each first communication bus controlling one first hardware through each first driver, the second driver being a driver in the at least one first driver used for indicating a second communication bus, the second communication bus being a communication bus in the at least one first communication bus connected with the second hardware; and match the second driver corresponding to the second communication bus according to the second request information by the first interface. The processing module 42 is specifically configured to call the first function function and the second driver by the first module to control the second hardware to execute the first operation through the second communication bus.

[0130] The operation execution apparatus in the embodiments of the present application can be an electronic device, or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices than a terminal. For example, the electronic device can be a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted electronic device, a mobile internet device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc., and can also be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, etc., and the embodiments of the present application are not limited in this regard.

[0131] The operation execution apparatus in the embodiments of the present application can be an apparatus with an operating system. The operating system can be an Android operating system, an iOS operating system, or other possible operating systems, and the embodiments of the present application are not limited in this regard.

[0132] The operation execution apparatus provided in the embodiments of the present application can implement each process of the method embodiments of FIGS. 8 to 10, and for the sake of brevity, the details are not repeated here.

[0133] In some embodiments of the present application, as shown in FIG. 12, the embodiments of the present application further provide an electronic device 50, which includes a processor 51 and a memory 52, and the memory 52 has a program or instructions stored thereon, which can be run on the processor 51, and when the program or instructions are executed by the processor 51, each process step of the above operation execution method embodiments is implemented, and the same technical effects are achieved, and for the sake of brevity, the details are not repeated here.

[0134] It should be noted that the electronic device in the embodiments of the present application includes the above-mentioned mobile electronic device and non-mobile electronic device.

[0135] FIG. 13 is a schematic diagram of a hardware structure of an electronic device for implementing the embodiments of the present application.

[0136] The electronic device 100 includes, but is not limited to, a radio frequency unit 101, a network module 102, an audio output unit 103, an input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, and a processor 110, etc.

[0137] Those skilled in the art can understand that the electronic device 100 can further include a power supply (such as a battery) for supplying power to each component, and the power supply can be logically connected to the processor 110 through a power management system, so that the power management system can realize functions such as management of charging, discharging, and power consumption management. The electronic device structure shown in FIG. 13 does not constitute a limitation on the electronic device, and the electronic device can include more or fewer components than those shown, or combine certain components, or different component arrangements, which will not be described here.

[0138] The processor 110 is configured to send a first instruction to a core layer of a hardware driver system deployed on a platform of the electronic device through an application layer of the hardware driver system, the core layer including at least one function function, each function function being configured to drive hardware to perform an operation, the first instruction being configured to call a second hardware of at least one first hardware in a hardware module of the hardware driver system to perform a first operation; and determine, based on the first instruction, a first function function for driving the hardware to perform the first operation from the at least one function function through the core layer, and call the first function function to drive the second hardware to perform the first operation.

[0139] The electronic device provided by the embodiment of the present application can ensure that the application layer can control the required second hardware to perform the required first operation, and can improve the cross-platform portability of the hardware driver system.

[0140] In some embodiments of the present application, the processor 110 is specifically configured to determine, by the first module of the core layer based on the first instruction, the first function function, and send first request information to the second module of the core layer, the first request information being used to find the first function function; and determine, by the second module according to the first request information, the first function function from at least one function function; and call, by the first module, the first function function to drive the second hardware to perform the first operation.

[0141] In some embodiments of the present application, the processor 110 is further configured to, before calling, by the first module, the first function function to drive the second hardware to perform the first operation, send, by the first module based on the first instruction, second request information to the first interface of the core layer, the second request information being used to request the second driver, the first interface being connected with at least one first hardware through at least one first communication bus, the first interface including at least one first driver, each first communication bus controlling one first hardware through each first driver, the second driver being a driver in the at least one first driver used to indicate the second communication bus, the second communication bus being a communication bus in the at least one first communication bus connected with the second hardware; and match, by the first interface according to the second request information, the second driver corresponding to the second communication bus.

[0142] The processor 110 is specifically configured to call, by the first module, the first function function and the second driver to control the second hardware to perform the first operation through the second communication bus.

[0143] It should be understood that in the embodiments of the present application, the input unit 104 can include a graphics processing unit (GPU) 1041 and a microphone 1042. The graphics processing unit 1041 processes image data of a still picture or a video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 106 can include a display panel 1061, which can be configured in the form of a liquid crystal display, an organic light-emitting diode, etc. The user input unit 107 includes at least one of a touch panel 1071 and other input devices 1072. The touch panel 1071 is also called a touch screen. The touch panel 1071 can include two parts of a touch detection device and a touch controller. The other input devices 1072 can include, but are not limited to, a physical keyboard, function keys (such as volume control keys, on-off keys, etc.), trackballs, mice, joysticks, and the like, which are not described here.

[0144] The memory 109 can be used to store software programs and various data. The memory 109 can mainly include a first storage area storing programs or instructions, and a second storage area storing data, wherein the first storage area can store an operating system, application programs or instructions required by at least one function (such as a sound playing function, an image playing function, etc.), and the like. In addition, the memory 109 can include a volatile memory or a non-volatile memory, or the memory 109 can include both a volatile memory and a non-volatile memory. The non-volatile memory can be a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically EPROM (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), a static RAM (SRAM), a dynamic RAM (DRAM), a synchronous DRAM (SDRAM), a double data rate SDRAM (DDR SDRAM), an enhanced SDRAM (ESDRAM), a synch link DRAM (SLDRAM), and a direct rambus RAM (DRRAM). The memory 109 in the embodiments of the present application includes but is not limited to these and any other suitable types of memory.

[0145] The processor 110 can include one or more processing units; optionally, the processor 110 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and an application program, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It can be understood that the above-mentioned modem processor can also not be integrated into the processor 110.

[0146] The embodiments of the present application also provide a readable storage medium, the readable storage medium stores programs or instructions, the programs or instructions are executed by a processor to realize each process of the above-mentioned operation execution method embodiments, and the same technical effects can be achieved, to avoid repetition, which will not be described here.

[0147] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes a computer readable storage medium, such as a computer readable only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0148] The embodiment of the present application further provides a chip, which comprises a processor and a communication interface, the communication interface is coupled with the processor, the processor is used for running programs or instructions to realize various processes of the operation execution method embodiment and achieve the same technical effects. To avoid repetition, details are not described here.

[0149] It should be understood that the chip mentioned in the embodiment of the present application can also be referred to as a system chip, a system chip, a chip system or a system on chip, etc.

[0150] The embodiment of the present application provides a computer program product, which is stored in a storage medium, and the program product is executed by at least one processor to realize various processes of the operation execution method embodiment and achieve the same technical effects. To avoid repetition, details are not described here.

[0151] It should be noted that in this paper, the term "includes", "contains" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitations, the element defined by the statement "includes a" does not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the method and device in the embodiment of the present application is not limited to the order of the functions shown or discussed, but can also include the functions performed in a substantially simultaneous manner or in the opposite order according to the functions involved, for example, the described method can be performed in an order different from the described order, and various steps can also be added, omitted or combined. In addition, the features described with reference to some examples can be combined in other examples.

[0152] Through the above description of the embodiments, those skilled in the art can clearly understand that the above-mentioned example methods can be realized by means of software and a necessary general hardware platform, and of course, can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a computer software product in essence or in the form of a part that contributes to the prior art, which is stored in a storage medium (such as a ROM / RAM, a magnetic disk, or an optical disk) and includes a plurality of instructions for causing a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present application.

[0153] The embodiments of the present application are described above in combination with the drawings, but the present application is not limited to the above-mentioned specific embodiments, and the above-mentioned specific embodiments are only illustrative and not restrictive. Those skilled in the art can make many forms under the inspiration of the present application without departing from the scope of the present application and the scope protected by the claims.

Claims

1. A hardware drive system, comprising: An application layer, a core layer, and a hardware module, the core layer comprising at least one function function, each of the function functions being configured to drive the hardware to perform an operation, the hardware module comprising at least one first hardware; The application layer is configured to send a first instruction to the core layer, the first instruction being configured to call a second hardware of the at least one first hardware to perform a first operation; The core layer is configured to determine, based on the first instruction, a first function function of the at least one function function for driving the hardware to perform the first operation, and call the first function function to drive the second hardware to perform the first operation.

2. The hardware drive system of claim 1, wherein, The core layer comprises a first module and a second module, the first module being connected to the second module, and the second module comprising at least one of the function functions; The first module is configured to determine the first function function based on the first instruction, and send first request information to the second module, the first request information being configured to find the first function function; The second module is configured to determine the first function function from the at least one function function according to the first request information; The first module is further configured to call the first function function to drive the second hardware to perform the first operation.

3. The hardware drive system of claim 2, wherein, The core layer further comprises a first interface, the first interface being connected to the at least one first hardware through at least one first communication bus, and the first interface comprising at least one first driver, each of the first communication buses being controlled by each of the first drivers to control one of the first hardware; The first module is further configured to send second request information to the first interface based on the first instruction, the second request information being configured to request a second driver, the second driver being a driver of the at least one first driver for indicating a second communication bus, the second communication bus being a communication bus of the at least one first communication bus connected to the second hardware; The first interface is configured to match the second driver corresponding to the second communication bus according to the second request information; The first module is further configured to call the first function function and the second driver to control the second hardware to perform the first operation through the second communication bus.

4. The hardware drive system of claim 1, wherein, The core layer further comprises a second interface, the second interface being connected to the application layer; The second interface is configured to transmit data between the core layer and the application layer.

5. The hardware drive system of claim 1, wherein, The core layer further comprises a third interface, the third interface being connected to a software layer; The third interface is configured to transmit data between the core layer and the software layer.

6. An electronic device, the electronic device comprising an operation platform, and the operation platform being deployed with the hardware driving system according to any one of claims 1 to 5.

7. An operation execution method applied to the electronic device according to claim 6, comprising: The application layer of a hardware driving system deployed on a platform in the electronic device sends a first instruction to a core layer of the hardware driving system, the core layer includes at least one function function, each function function is used to drive hardware to execute an operation, and the first instruction is used to call a second hardware in at least one first hardware in a hardware module of the hardware driving system to execute a first operation; The core layer determines a first function function for driving hardware to execute the first operation from at least one function function based on the first instruction, and calls the first function function to drive the second hardware to execute the first operation.

8. The operation execution method according to claim 7, wherein The core layer determines a first function function for driving hardware to execute the first operation from at least one function function based on the first instruction, and calls the first function function to drive the second hardware to execute the first operation. The core layer determines the first function function based on the first instruction through a first module of the core layer, and sends first request information to a second module of the core layer, the first request information is used to find the first function function; The second module determines the first function function from at least one function function according to the first request information; The first module calls the first function function to drive the second hardware to execute the first operation.

9. The operation execution method according to claim 8, wherein Before the first module calls the first function function to drive the second hardware to execute the first operation, the method further comprises: The first module sends second request information to a first interface of the core layer based on the first instruction, the second request information is used to request a second drive, the first interface is connected with at least one first hardware through at least one first communication bus, the first interface includes at least one first drive, each first communication bus controls one first hardware through each first drive, and the second drive is a drive for indicating a second communication bus in at least one first drive, and the second communication bus is a communication bus connected with the second hardware in at least one first communication bus; The first interface matches the second drive corresponding to the second communication bus according to the second request information; The first module calls the first function function and the second drive to control the second hardware to execute the first operation through the second communication bus.

10. An operation execution device, comprising: a sending module configured to send a first instruction from an application layer of a hardware driving system deployed on a platform in the operation execution device to a core layer of the hardware driving system, the core layer includes at least one function function, each function function is used to drive hardware to execute an operation, and the first instruction is used to call a second hardware in at least one first hardware in a hardware module of the hardware driving system to execute a first operation; ​ The processing module is configured to determine, by the core layer, the first function from the at least one function based on the first instruction sent by the sending module, and to call the first function to drive the second hardware to perform the first operation.

11. The operation execution apparatus according to claim 10, wherein The processing module is configured to determine, by the first module of the core layer, the first function based on the first instruction, and to send first request information to the second module of the core layer, the first request information being used to search for the first function; determine, by the second module, the first function from the at least one function based on the first request information; and call, by the first module, the first function to drive the second hardware to perform the first operation.

12. The operation execution apparatus according to claim 10, wherein The processing module is further configured to, before calling, by the first module, the first function to drive the second hardware to perform the first operation, send, by the first module, second request information to a first interface of the core layer based on the first instruction, the second request information being used to request a second driver, the first interface being connected to the at least one first hardware through at least one first communication bus, the first interface including at least one first driver, each first communication bus being controlled by each first driver to control one first hardware, the second driver being a driver in the at least one first driver used to indicate a second communication bus, the second communication bus being a communication bus in the at least one first communication bus connected to the second hardware. The processing module is further configured to match, by the first interface, the second driver corresponding to the second communication bus based on the second request information. The processing module is configured to call, by the first module, the first function and the second driver to control the second hardware to perform the first operation through the second communication bus.

13. An electronic device, comprising a processor and a memory, the memory storing programs or instructions executable on the processor, the programs or instructions being executed by the processor to implement the steps of the operation execution method according to any one of claims 6 to 9.

14. A readable storage medium, the readable storage medium storing programs or instructions, the programs or instructions being executed by a processor to implement the steps of the operation execution method according to any one of claims 7 to 9.

15. A chip, comprising a processor and a communication interface, the communication interface being coupled to the processor, the processor being configured to execute programs or instructions to implement the steps of the operation execution method according to any one of claims 7 to 9.

16. A computer program product, the computer program product being stored in a non-volatile storage medium, the computer program product being executed by at least one processor to implement the steps of the operation execution method according to any one of claims 7 to 9.

17. An electronic device, the electronic device being configured to implement the steps of the operation execution method according to any one of claims 7 to 9.

Citation Information

Patent Citations

  • Method, system, device and storage medium for layered design of software based on single chip microcomputer

    CN109165011A

  • Hardware driving device and method, chip and non-transient computer readable storage medium

    CN109871244A

  • Data processing method and device and computer readable storage medium

    CN111143078A

  • Data processing method and device and computer readable storage medium

    CN111338769A

  • Hardware driving system, operation execution method and related device

    CN118916100A