Hardware driving system, operation execution method and related device
By introducing the design of core layer and functional functions in the hardware driver system, the portability problem of Linux platform hardware driver system during cross-platform migration is solved, and the code modification amount is reduced while ensuring that the application layer controls hardware operations. Improve cross-platform portability.
Patent Information
- Application Number
- CN202411065609.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-05
- Publication Date
- 2024-11-08
AI Technical Summary
When the hardware driver system of the Linux platform is ported across the platform, it is necessary to make a lot of code modifications to the driver of each communication bus in each hardware, resulting in poor cross-platform portability.
The design of a hardware driver system is adopted, which includes the application layer, the core layer and the hardware module. The core layer contains functional functions for driving the hardware to perform operations. The application layer sends instructions to the core layer to call the hardware to perform operations. The core layer directly comes from the function. The corresponding function functions are determined and called in the function, reducing the amount of code that needs to be modified.
It improves the cross-platform portability of the hardware driver system, ensuring that the application layer can control the hardware to perform operations, and only a small amount of modifications is required to make a small amount of functional function code in the core layer, reducing the amount of development and modifications during the migration process.
Smart Images

Figure CN118916100A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of terminal technology, and specifically relates to a hardware drive system, an operation execution method and related devices. Background Art
[0002] Typically, in a driver system of a Linux platform, each hardware of an electronic device is connected to an application layer via at least one communication bus, and a driver for each communication bus is stored in each hardware. Each communication bus can control the connected hardware via its own driver, so that when the electronic device wants to control hardware 1 to perform operation 1, the application layer can send instruction 1 to communication bus 1 connected to hardware 1, and the instruction 1 is used to call hardware 1 to perform operation 1, so that communication bus 1 can control hardware 1 to perform operation 1 according to the instruction 1 via its own driver 1.
[0003] However, since the driver system may need to be ported to other platforms, it may be necessary to modify a large amount of code in the driver of each communication bus in each hardware so that each communication bus can use its own driver to control the connected hardware to perform the operation corresponding to the instruction according to the instruction of the application layer. As a result, the cross-platform portability of the driver system is poor. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a hardware driver system, an operation execution method and related devices, which can improve the cross-platform portability of the hardware driver system while ensuring that the application layer of the hardware driver system can control the required hardware to execute the required operations.
[0005] In a first aspect, an embodiment of the present application provides a hardware driver system, which 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, and the hardware module includes at least one first hardware; the application layer is used to send a first instruction to the core layer, and the first instruction is used to call the second hardware in the at least one first hardware to perform a first operation; the core layer is used to determine, based on the first instruction, from at least one function function, a first function function used to drive the hardware to perform the first operation, and call the first function function to drive the second hardware to perform the first operation.
[0006] In second aspect, an embodiment of the present application provides an operation execution method, the method comprising: sending a first instruction to a core layer of a hardware driver system through an application layer of a hardware driver system deployed on a platform set in an electronic device, the core layer comprising at least one function function, each function function being used to drive hardware to perform an operation, the first instruction being used to call a second hardware in at least one first hardware in a hardware module of the hardware driver system to perform a first operation; determining, through the core layer based on the first instruction, a first function function for driving the hardware to perform the first operation from at least one function function, and calling the first function function to drive the second hardware to perform the first operation.
[0007] In a third aspect, an embodiment of the present application provides an operation execution device, which includes: a sending module, used to send a first instruction to a core layer of a hardware driver system through an application layer of a hardware driver system deployed on a platform set in the operation execution device, the core layer including at least one function function, each function function being used to drive hardware to perform an operation, and the first instruction being used to call a second hardware in at least one first hardware in a hardware module of the hardware driver system to perform a first operation; a processing module, used to determine, through the core layer based on the first instruction sent by the sending module, a first function function from 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.
[0008] In a fourth aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the second aspect are implemented.
[0009] In a fifth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the second aspect are implemented.
[0010] In a sixth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the steps of the method described in the second aspect.
[0011] In a seventh aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the steps of the method described in the second aspect.
[0012] In an embodiment of the present application, 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 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, thereby ensuring that the application layer can control the required second hardware to perform the required first operation; on the other hand, since each function function included in the core layer is used to drive the hardware to perform a different operation, and there is no function function for driving the hardware to perform the same operation, in this way, when the hardware driver system is ported to other platforms, only the code of a small number of function functions in the core layer needs to be modified, and there is no need to modify the code of a large number of function functions in the hardware in the related art, therefore, the number of codes that need to be modified when the hardware driver system is ported to other platforms can be reduced, thereby improving the cross-platform portability of the hardware driver system; in this way, while ensuring that the application layer of the hardware driver system can control the required hardware to perform the required operation, the cross-platform portability of the hardware driver system can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 It is a schematic diagram of the framework of a device driver system of a Linux platform in the related art;
[0014] Figure 2 This is one of the schematic diagrams of the hardware drive system provided in the embodiment of the present application;
[0015] Figure 3 This is the second schematic diagram of the framework of the hardware drive system provided in the embodiment of the present application;
[0016] Figure 4 This is the third schematic diagram of the framework of the hardware drive system provided in the embodiment of the present application;
[0017] Figure 5 This is the fourth schematic diagram of the framework of the hardware drive system provided in the embodiment of the present application;
[0018] Figure 6 This is the fifth schematic diagram of the framework of the hardware drive system provided in the embodiment of the present application;
[0019] Figure 7 is a schematic diagram of a framework of an electronic device provided in an embodiment of the present application;
[0020] Figure 8 This is one of the flowcharts of the operation execution method provided in the embodiment of the present application;
[0021] Fig. 9This is the second flowchart of the operation execution method provided in the embodiment of the present application;
[0022] Fig.10 This is the third flowchart of the operation execution method provided in the embodiment of the present application;
[0023] Fig.11 is a schematic diagram of the structure of an operation execution device provided in an embodiment of the present application;
[0024] Fig.12 This is one of the hardware structure diagrams of the electronic device provided in the embodiment of the present application;
[0025] Fig.13 This is the second schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0027] The terms "first", "second", etc. 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 interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0028] The terms "at least one (item)", "at least one of" and the like in the specification and claims of the present application refer to any one, any two or a combination of more than two of the objects included therein. For example, at least one (item) of a, b, and c can be represented by: "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 (items)" refers to two or more, and its meaning is similar to that of "at least one (item)".
[0029] The hardware drive system, operation execution method and related devices provided in the embodiments of the present application are described in detail below through specific embodiments and their application scenarios in conjunction with the accompanying drawings.
[0030] Currently, the device driver system is commonly used in Linux platforms, such as Figure 1As shown, the device driver system may include an application layer, a software layer and a hardware layer, wherein a hardware abstraction layer (HAL) is provided in the application layer, wherein the hardware layer includes multiple hardware of the electronic device, such as a camera, an external chip, etc., and the application layer may be connected to the software layer, wherein the software layer is connected to the camera through at least one communication bus (such as an i2c bus 1), and is connected to the external chip through at least one communication bus (such as an SPI bus 2, an sdio bus 2, etc.); wherein a driver for each communication bus is stored in each hardware, for example, a driver 1 for an i2C bus 1 is stored in the camera, and a driver 2 for an SPI bus 2 and a driver 3 for an sdio bus 2 are stored in the external chip, wherein the i2C bus 1 may control the camera through a driver 1, wherein the driver 1 includes multiple function functions, each function function being used to drive the camera to perform an operation, so that the i2C bus 1 may call different function functions through the driver 1 to control the camera to perform different operations; the SPI bus 2 may control the external chip through the driver 2, wherein the driver 2 includes multiple function functions, each function function being used to drive the external chip The chip performs an operation, so that 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, and the driver 3 includes multiple function functions, each function function is used to drive the external chip to perform an operation, so that the sdio bus 2 can call different function functions through the driver 3 to control the external chip to perform different operations; so that when the electronic device wants to control a certain hardware (such as an external chip) to perform an operation (such as an image processing operation), the HAL of the application layer can first determine the communication bus connected to the external chip through the software layer, that is, the SPI bus 2 and the sdio bus 2, and determine a communication bus for performing the image processing operation from the SPI bus 2 and the sdio bus 2, such as the SPI bus 2, and then the HAL can send an instruction 1 to the SPI bus 2, and the instruction 1 is used to call the external chip to perform the image processing operation, so that the SPI bus 2 can determine the function function 1 required to perform the image processing operation through its own driver 2 according to the instruction 1, and call the function function 1 to control the external chip to perform the image processing operation.However, the applicant discovered during use that, since the device driver system may need to be ported to other platforms, a large amount of code for the driver of each communication bus in each hardware may need to be modified. For example, the code of multiple functional functions in the above-mentioned driver 1 needs to be modified so that the modified driver 1 in the camera can control the camera to perform operations corresponding to the instructions according to the instructions of the application layer, and the code of multiple functional functions in the above-mentioned driver 2 needs to be modified so that the modified driver 2 in the external chip can control the external chip to perform operations corresponding to the instructions according to the instructions of the application layer, and the code of multiple functional functions in the above-mentioned driver 3 needs to be modified so that the modified driver 3 in the external chip can control the external chip to perform operations corresponding to the instructions according to the instructions of the application layer. Therefore, the portability of the device driver system is poor.
[0031] However, the embodiment of the present application improves the above-mentioned device driver model, and adopts a brand-new hardware driver system in the embodiment of the present application, which includes an application layer, a core layer and a hardware module, and the core layer includes at least one function function, each function function is used to drive the hardware to perform an operation, and the hardware module may include the above-mentioned camera and plug-in chip. Of course, the hardware module may also include other hardware, which is not exhaustive in this application. Among them, the application layer is used to send instruction 1 to the core layer, and the instruction 1 is used to call a certain hardware (such as an external chip) to perform an image processing operation. The core layer is used to determine the function function 1 used to drive the hardware to perform the image processing operation from 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 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 1 for driving the hardware to perform the image processing operation from the at least one function, and call the function 1 to drive the external chip to perform the image processing operation, thereby ensuring that the application layer can control the required hardware to perform the required operation; on the other hand, since each function included in the core layer is used to drive the hardware to perform different operations, that is, the number of at least one function function included in the core layer is The amount is less than the number of function functions in the hardware in the above-mentioned hardware layer. In this way, when the hardware driver system is ported to other platforms, it is only necessary to modify the codes of the function functions with a smaller number in the core layer, without modifying the codes of the function functions with a larger number in the hardware in the above-mentioned hardware layer. Therefore, the amount of code that needs to be modified when the hardware driver system is ported 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 operations.
[0032] An embodiment of the present application provides a hardware drive system. Figure 2 FIG. 1 is a schematic diagram showing a hardware drive system provided by an embodiment of the present application. Figure 2 As shown, the hardware driver system provided by the embodiment of the present application may include: an application layer 10, a core layer 11 and a hardware module 12, the core layer 11 includes at least one functional function, each functional function is used to drive the hardware to perform an operation, and the hardware module 12 includes at least one first hardware 121.
[0033] In an embodiment of the present application, the above-mentioned application layer 10 is used to send a first instruction to the core layer 11, and the first instruction is used to call the second hardware in at least one first hardware 121 to perform a first operation; the core layer is used to determine, based on the first instruction, from at least one function function, a first 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.
[0034] In some embodiments of the present application, Figure 2 , the application layer 10 may further include HAL101, so that when receiving a user input to a first control displayed by the electronic device, the electronic device may send a second instruction to HAL101, the second instruction being used to request to call the second hardware to perform the first operation, so that HAL101 may send the first instruction to the core layer 11. The first control is used to trigger the second hardware to perform the first operation.
[0035] In some embodiments of the present application, the at least one first hardware 121 may include at least one of the following: an external chip, a system on chip (SoC), a camera, an audio device, etc. Of course, the at least one first hardware 121 may also include other hardware, which is not limited in the embodiments of the present application.
[0036] In some embodiments of the present application, Figure 2 The core layer 11 further includes a second interface 111 , which is connected to the application layer 10 ; the second interface 111 is used for data transmission between the core layer 11 and the application layer 10 .
[0037] In some embodiments of the present application, the second interface 111 may be referred to as a hal_Inf interface or an application layer interface. Of course, the second interface 111 may also be referred to as other interfaces, which are not limited in the embodiments of the present application.
[0038] In some embodiments of the present application, the second interface 11 may be specifically used to send instructions or data from the application layer 10 to the core layer 11 , or may be used to send instructions or data from the core layer 11 to the application layer 10 .
[0039] The instruction may include the above-mentioned first instruction, and the data may include image data.
[0040] In some embodiments of the present application, the second interface 111 may be connected to the HAL 101 in the application layer 10 .
[0041] It can be seen that since a second interface is also deployed in the core layer, the application layer and the core layer can directly exchange data through the second interface without forwarding through other layers. Therefore, the time spent on data exchange between the application layer and the core layer can be reduced.
[0042] In some embodiments of the present application, the core layer 11 may be composed of multiple codes.
[0043] In some embodiments of the present application, the at least one functional function mentioned above may be pre-configured, or obtained by the core layer 11 from other layers, or agreed upon by a protocol, which is not limited in the embodiments of the present application.
[0044] In the case where at least one functional function is obtained by the core layer 11 from other layers, the core layer 11 may obtain the at least one functional function from the application layer 10 .
[0045] It can be understood that in the embodiment of the present application, each function function is used to drive the hardware to perform an operation, that is, different function functions are used to drive the hardware to perform different operations, and there is less repeated code between function functions used to perform different operations, so there is less repeated code between at least one function function. In addition, compared with the related art, the function functions in the embodiment of the present application are no longer deployed in the driver of the communication bus, that is, each function function is not coupled to the communication bus, so it can avoid storing multiple function functions in the core layer 11 for driving the hardware to perform the same operation through different communication buses, thereby reducing the repeated function functions stored in the core layer 11.
[0046] In some embodiments of the present application, the at least one operation performed by the at least one function function driving the hardware may include at least one of the following: image processing operation, hardware loading operation, function verification operation, data extraction operation, image format conversion operation, etc. Of course, the at least one operation may also include other operations, which are not limited in the embodiments of the present application.
[0047] In some embodiments of the present application, the core layer 11 also stores a correspondence between at least one operation and at least one function identifier, so that when the core layer 11 obtains the first instruction, it can determine the identifier of the first 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. The identifier can be a name or an index.
[0048] In some embodiments of the present application, the core layer 11 can be connected to at least one first hardware 121 through at least one communication bus (for example, the first communication bus in the following embodiments), and the hardware identification of the second hardware can also be carried in the first instruction, and the correspondence between at least one hardware identification and at least one communication bus is stored in the core layer 11, so that the core layer 11 can determine a hardware identification that is the same as the hardware identification of the second hardware from at least one hardware identification based on the hardware identification of the second hardware, and determine one of the communication buses corresponding to the one hardware identification as the communication bus that controls 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.
[0049] The following will illustrate a specific solution in which the core layer 11 drives the second hardware to perform the first operation by taking into account the specific structure of the core layer 11 .
[0050] In some embodiments of the present application, Figure 1 ,like Figure 3 As shown, the core layer 11 includes a first module 112 and a second module 113 . The first module 112 is connected to the second module 113 . The second module 113 includes at least one functional function.
[0051] In some embodiments of the present application, the first module 112 may be referred to as a main device module or a management module. Of course, the first module 112 may also be referred to as other names, which are not limited in the embodiments of the present application.
[0052] In some embodiments of the present application, the first module 112 may be connected to the application layer 10 through the second interface 111 .
[0053] In some embodiments of the present application, the first module 112 may be connected to at least one first hardware 121 through an interface (such as the first interface in the following embodiments) and at least one communication bus. Alternatively, the first module 112 may be directly connected to at least one first hardware 121 through at least one communication bus.
[0054] In some embodiments of the present application, the above-mentioned first module 112 can associate and bind multiple interfaces in the core layer 11 (for example, the first interface and the third interface in the embodiments described below, the second interface in the embodiments described above, etc.), so that the first module 112 can interact with the second hardware or other layers (for example, the application layer in the embodiments described above, the software layer in the embodiments described below, etc.) through the multiple interfaces.
[0055] In some embodiments of the present application, the second module 113 may be referred to as a business logic module or a functional module. Of course, the second module 113 may also be referred to as other names, which are not limited in the embodiments of the present application.
[0056] In the embodiment of the present application, the first module 112 is used to determine the first function function based on the first instruction, and send the first request information to the second module 113, where the first request information is used to find the first function function. The second module 113 is used to determine the first function function from at least one function function according to the first request information. The first module 112 is also used to call the first function function to drive the second hardware to perform the first operation.
[0057] In some embodiments of the present application, the above-mentioned 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.
[0058] It can be seen that, since at least one functional function can be stored in the second module without storing the functional function in each hardware, the core layer and at least two hardware can be decoupled, which can facilitate maintenance and cross-platform transplantation.
[0059] In some embodiments of the present application, Figure 3 ,like Figure 4 As shown, the core layer 11 further includes a first interface 114, which is connected to at least one first hardware 121 via at least one first communication bus 115. The first interface 114 includes at least one first driver, and each first communication bus 115 controls a first hardware 121 via each first driver.
[0060] In some embodiments of the present application, the first interface 114 may be referred to as an input / output IO interface or a core layer control interface. Of course, the first interface 114 may also be referred to as other names, which are not limited in the embodiments of the present application.
[0061] In some embodiments of the present application, the at least one first communication bus 115 may 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 may also include other communication buses, which are not limited in the embodiments of the present application.
[0062] In some examples of the present application, each of the at least one first hardware 121 mentioned above can be connected to the first interface 114 through one or at least two first communication buses 115, or, a part of the first hardware 121 can be connected to the first interface 114 through one or at least two first communication buses 115, and another part of the first hardware 121 can be connected to the part of the first hardware 121.
[0063] In some embodiments of the present application, each first driver in the at least one first driver is used to indicate a first hardware 121 connected to the first communication bus 115 .
[0064] In some embodiments of the present application, when at least one first hardware 121 is connected to the first interface 114, each first hardware 121 can initiate at least one third request message to the first interface 114, and each third request message is used to request registration of each first communication bus 115 connected to the first hardware 121, and each third request message carries the hardware identification of each first communication bus 115 connected to the first communication bus 115, so that the first interface 114 can store the correspondence between the hardware identification of the first hardware 121 and the first communication bus 115, so as to facilitate determining the first communication bus 115 connected to each first hardware 121.
[0065] In an embodiment of the present application, the above-mentioned first module 112 is also used to send a second request information to the first interface 114 based on the first instruction, and the second request information is used to request a second driver, and the second driver is a driver used to indicate a second communication bus in at least one first driver, and the second communication bus is a communication bus connected to the second hardware in at least one first communication bus 115; the above-mentioned first interface 114 is used to match the second driver corresponding to the second communication bus according to the second request information; the above-mentioned first module 114 is also used 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.
[0066] In some embodiments of the present application, the first instruction also carries the hardware identification of the second hardware, and the second request information also carries the hardware identification of the second hardware. Thus, the first interface 114 can determine the second communication bus corresponding to the hardware identification of the second hardware from the corresponding relationship between the hardware identification of the first hardware 121 and the first communication bus 115 according to the hardware identification of the second hardware.
[0067] In which, when the number of first communication buses 115 connected to the second hardware is at least two, each first communication bus 115 is used to transmit data of a data type, so that the first interface 114 can also select a second communication bus with a matching data type from at least two first communication buses 115 according to the data type of the data corresponding to the first operation.
[0068] It can be seen that since the first interface can directly determine the second communication bus connected to the second hardware from at least one first communication bus without determining it through the first function function, it can avoid the situation where multiple function functions of the first communication buses that perform the same operation are stored in the second module, thereby reducing the number of function functions stored in the second module, and further improving the cross-platform portability of the hardware driver system.
[0069] Furthermore, since the first module 112 can be connected to at least one first hardware 121 through the first interface 114 , the first module 112 can centrally manage at least one first hardware 121 to control the at least one first hardware 121 to perform operations.
[0070] In some embodiments of the present application, Figure 1 ,like Figure 5 As shown, the core layer 11 further includes a third interface 116 , which is connected to the software layer 13 ; the third interface 116 is used for data transmission between the core layer 11 and the software layer 13 .
[0071] In some embodiments of the present application, the third interface 116 may be referred to as a driver_inf interface or a platform driver interface. Of course, the third interface 116 may also be referred to as other names, which are not limited in the embodiments of the present application.
[0072] In some embodiments of the present application, the third interface 116 is specifically used to transmit business data or instructions between the core layer 11 and the software layer 13 .
[0073] It can be seen that since the third interface can also be deployed in the core layer, data between the core layer and the software layer in the related technology can be transmitted through the third interface. Therefore, the hardware driver system and the driver system in the related technology can exchange information, thereby further improving the cross-platform portability of the hardware driver system.
[0074] An embodiment of the present application provides a hardware driver system, which includes an application layer, a core layer and a hardware module, wherein the core layer includes at least one function function, each function function is used to drive hardware to perform an operation, and the hardware module includes at least one first hardware; wherein the application layer is used to send a first instruction to the core layer, and the first instruction is used to call a second hardware in at least one first hardware to perform a first operation; the core layer is used to determine, based on the first instruction, from at least one function function, a first function function used to drive the hardware to perform the first operation, and call the first function function to drive the second hardware to perform the first operation. In the application embodiment, 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 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 required second hardware to perform the required first operation; on the other hand, since each function function included in the core layer is used to drive the hardware to perform a different operation, and there is no function function for driving the hardware to perform the same operation, in this way, when the hardware driver system is ported to other platforms, only the code of a small number of function functions in the core layer needs to be modified, and there is no need to modify the code of a large number of function functions in the hardware in the related art. Therefore, the number of codes that need to be modified when the hardware driver system is ported to other platforms can be reduced, thereby improving the cross-platform portability of the hardware driver system; in this way, while ensuring that the application layer of the hardware driver system can control the required hardware to perform the required operation, the cross-platform portability of the hardware driver system can be improved.
[0075] Furthermore, since each functional function included in the core layer is used to drive the hardware to perform different operations, rather than different hardware containing functional functions for driving the hardware to perform the same operation as in the related art, the amount of development in the process of developing the hardware driver system can be reduced.
[0076] The following is a specific example to illustrate the workflow of the hardware driver system provided in the embodiment of the present application.
[0077] Combined with the above Figures 1 to 5 ,like Figure 6As shown, it is assumed that at least one first hardware 121 in the above-mentioned hardware module 12 includes an external chip 122, and the electronic device also includes a camera 14, which is connected to the external chip 122 through a system on chip (System on Chip, SoC), wherein the external chip 122 adopts the hardware driving system provided by the embodiment of the present application, that is, the external 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 the I2C communication bus 15, and the software layer 13 is connected to the core layer 11 through the third interface 116.
[0078] First, the above hardware driver system can first execute the loading process, which is as follows:
[0079] S11, HAL101 of application layer 10 can send instructions to software layer 13, which are used to control the power on of camera 14. After camera 14 implements i2c driver, it is directly registered in software layer 13 to save the correspondence between i2c communication bus 15 and the hardware identification of camera 14 in software layer 13.
[0080] S12, the drivers of the SPI communication bus 1151 and the sdio communication bus 1152 can be registered in the first interface 114 respectively, so as to store the corresponding relationship between the SPI communication bus 1151 and the hardware identification of the plug-in chip 122, and the corresponding relationship between the sdio communication bus 1152 and the hardware identification of the plug-in chip 122 in the first interface 114. In addition, the drivers of the SPI communication bus 1151 and the sdio communication bus 1152 can also store the corresponding relationship between the data type of the meta information and the SPI communication bus 1151, and the corresponding relationship between the data type of the hardware information and the sdio communication bus 1152 in the first interface 114.
[0081] S13 . The first interface 114 is bound to the first module 112 .
[0082] S14 , the second interface 111 and the third interface 116 are bound to the first module 112 .
[0083] Then, the hardware driver system may perform initialization operations as follows:
[0084] 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 the loading firmware function corresponding to the initialization operation, and sends a first request message to the second module 113 to query the loading firmware function, so that the second module 113 can provide the loading firmware function so that the first module 112 can call the loading firmware function.
[0085] S22. The first module 112 sends a second request message to the first interface 114 to query the SDIO driver of the SDIO communication bus 1152. The SDIO driver is used to indicate the SDIO communication bus 1152. The SDIO communication bus 1152 is connected to 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 same as the data type of the data corresponding to the initialization operation, so that the first interface 114 can match the SDIO driver.
[0086] S23. The first module 112 may call the sdio driver to control the external chip 122 to perform an initialization operation through the sdio communication bus 1152, so that the external chip 122 may obtain hardware information of the external chip 122 and / or the camera 14.
[0087] S24. After the external chip 122 performs the initialization operation, the external chip 122 may transmit the hardware information of the external chip 122 and / or the camera 14 to the first module 112 via the SDIO communication bus 1152, thereby completing the initialization operation.
[0088] Next, the hardware driver system can perform a photo-taking operation as follows:
[0089] S31. First, the user clicks the "photograph" control (i.e., the first control), and then the photographing instruction can reach HAL101 through a series of calls. After receiving the photographing instruction, HAL101 first informs the core layer 11 through the second interface 111 that the image processing operation needs to be performed through the plug-in chip 122; HAL101 will call the software layer 13 through the traditional Linux platform and issue a command to the camera 14 to capture the image.
[0090] S32. After the core layer 11 receives the instruction to perform image processing operations through the external chip 122, the instruction is sent to the first module 112. Since the meta information and the image need to be sent to the external chip 122 for processing, 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.
[0091] S33, after the camera 14 captures the image, it can first store the image in the memory and generate meta information, so that the software layer 13 can pass the meta information and the image data address (ie, the address of the image in the memory) to the core layer 11 through the third interface 116.
[0092] S34 , the meta information is transmitted to the first module 112 through the third interface 116 .
[0093] S35. After obtaining the meta information, the first module 112 continues to execute the previously suspended instructions, determines the meta filling function corresponding to the photo taking operation, and sends a first request message to the second module 113 to query the meta filling function, so that the second module 113 can provide the meta filling function, and then the first module 112 can call the meta filling function to fill the meta information with the information required for image processing and generate new meta information.
[0094] S36. The first module 112 sends a second request message to the first interface 114 to query the SPI driver of the SPI communication bus 1151. The SPI driver is used to indicate the SPI communication bus 1151. The SPI communication bus 1151 is connected to the external chip 122, and the data type corresponding to the SPI communication bus 1151 is the same as the data type of the meta information, that is, the same as the data type of the data corresponding to the image processing operation, so that the first interface 114 can match the SPI driver.
[0095] S37. The first module 112 may call the SPI driver to send the new meta information to the external chip 122 through the SPI communication bus 1151, and instruct the external chip 122 to perform image processing operations on the image according to the new meta information, and finally transmit the processed data back to the application layer 10, thereby completing the photo-taking operation.
[0096] An embodiment of the present application provides an electronic device. Figure 7 FIG. 1 shows a schematic diagram of a framework of an electronic device provided by an embodiment of the present application. Figure 7 As shown, the electronic device provided in the embodiment of the present application is provided with a platform 20, and the hardware driving system 21 in the above embodiment is deployed on the platform 20.
[0097] The embodiment of the present application provides an electronic device, in which a platform is provided, and a hardware driving system is deployed on the platform. In the embodiment of the application, 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 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 required second hardware to perform the required first operation; on the other hand, since each function function included in the core layer is used to drive the hardware to perform different operations, and there is no function function for driving the hardware to perform the same operation, so that when the hardware driving system is ported to other platforms, only the code of the function function with a small number in the core layer needs to be modified, and there is no need to modify the code of the function function with a large number in the hardware in the related art, so the number of codes that need to be modified when the hardware driving system is ported 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 required hardware to perform the required operation, the cross-platform portability of the hardware driving system can be improved.
[0098] Figure 8 FIG. 1 is a flow chart of an operation execution method provided by an embodiment of the present application. Figure 8 As shown, the operation execution method provided in the embodiment of the present application may include the following steps 101 and 102.
[0099] Step 101: The electronic device sends a first instruction to the core layer of the hardware driver system through the application layer of the hardware driver system deployed on the platform set in the electronic device.
[0100] In an embodiment of the present application, the core layer includes at least one function function, each function function is used to drive the hardware to perform an operation, and the first instruction is used to call the second hardware in at least one first hardware in the hardware module of the hardware driver system to perform the first operation.
[0101] It should be noted that, for the description of the first instruction, at least one first hardware, the second hardware and the first operation, reference may be made to the specific description in the above embodiments, and the embodiments of the present application will not be repeated here.
[0102] In some embodiments of the present application, when the electronic device displays a shooting interface, the user can click and input a "shooting" control in the shooting interface (for example, the first control in the above embodiment) so that the application layer can send a first instruction to the core layer.
[0103] Step 102: The electronic device determines, through the core layer, a first function function for driving hardware to perform a first operation from at least one function function based on the first instruction, and calls the first function function to drive second hardware to perform the first operation.
[0104] It should be noted that for the description of the electronic device determining, through the core layer based on the first instruction, the first function function used to drive the hardware to perform the first operation from at least one function function, reference can be made to the specific description in the above embodiments, and the embodiments of the present application will not be repeated here.
[0105] In some embodiments of the present application, Figure 8 ,like Fig. 9 As shown, the above step 102 can be specifically implemented through the following steps 102a to 102c.
[0106] Step 102a: The electronic device determines a first functional function based on a first instruction through a first module of the core layer, and sends a first request information to a second module of the core layer.
[0107] In the embodiment of the present application, the first request information is used to search for the first functional function.
[0108] It should be noted that, for the description of the electronic device determining the first functional function based on the first instruction through the first module of the core layer, reference may be made to the specific description in the above embodiment, and the embodiments of the present application will not be repeated here.
[0109] Step 102b: The electronic device determines a first function function from at least one function function according to the first request information through the second module.
[0110] It should be noted that, for the description of the electronic device determining the first function function from at least one function function according to the first request information through the second module, reference can be made to the specific details in the above embodiment, and the embodiments of the present application will not be repeated here.
[0111] Step 102c: The electronic device calls the first function through the first module to drive the second hardware to perform the first operation.
[0112] It should be noted that, for the description of the electronic device calling the first functional function through the first module, reference may be made to the specific description in the above embodiment, and the embodiments of the present application will not be repeated here.
[0113] It can be seen that, since at least one functional function can be stored in the second module without storing the functional function in each hardware, the core layer and at least two hardware can be decoupled, which can facilitate maintenance and cross-platform transplantation.
[0114] In some embodiments of the present application, Figure 8 ,like Fig.10 As shown, before the above step 102c, the operation execution method provided in the embodiment of the present application may further include the following steps 201 and 202, and the above step 102c may be specifically implemented by the following step 102c1.
[0115] Step 201: The electronic device sends second request information to the first interface of the core layer through the first module based on the first instruction.
[0116] In an embodiment of the present application, the above-mentioned second request information is used to request a second driver, the above-mentioned first interface is connected to at least one first hardware through at least one first communication bus, the first interface includes at least one first driver, each first communication bus controls a first hardware through each first driver, the second driver is a driver in at least one first driver for indicating the second communication bus, and the second communication bus is a communication bus in at least one first communication bus connected to the second hardware.
[0117] It should be noted that, for the description of the electronic device sending the second request information to the first interface of the core layer through the first module based on the first instruction, reference can be made to the specific description in the above embodiment, and the embodiments of the present application will not be repeated here.
[0118] Step 202: The electronic device matches the second driver corresponding to the second communication bus through the first interface according to the second request information.
[0119] It should be noted that, for the description of the electronic device matching the second driver corresponding to the second communication bus through the first interface according to the second request information, reference may be made to the specific description in the above embodiment, and the embodiments of the present application will not be repeated here.
[0120] Step 102c1: The electronic device calls the first function and the second driver through the first module to control the second hardware to perform the first operation through the second communication bus.
[0121] It should be noted that for the description of the electronic device calling the first function and the second driver through the first module to control the second hardware to perform the first operation through the second communication bus, reference can be made to the specific description in the above embodiment, and the embodiments of the present application will not be repeated here.
[0122] It can be seen that since the electronic device can directly determine the second communication bus connected to the second hardware from at least one first communication bus through the first interface without determining it through the first function function, it is possible to avoid storing multiple function functions of the first communication buses that perform the same operation in the second module, thereby reducing the number of function functions stored in the second module and further improving the cross-platform portability of the hardware driver system.
[0123] An embodiment of the present application provides an operation execution method, whereby an electronic device may send a first instruction to a core layer of a hardware driver system through an application layer of the hardware driver system deployed on a platform set in the electronic device, and the core layer may determine, based on the first instruction, a first function function for driving hardware to perform a first operation from at least one function function, and call the first function function to drive second hardware to perform the first operation. In an embodiment of the present application, 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 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, thereby ensuring that the application layer can control the required second hardware to perform the required first operation; on the other hand, since each function function included in the core layer is used to drive the hardware to perform a different operation, and there is no function function for driving the hardware to perform the same operation, in this way, when the hardware driver system is ported to other platforms, only the code of a small number of function functions in the core layer needs to be modified, and there is no need to modify the code of a large number of function functions in the hardware in the related art, therefore, the number of codes that need to be modified when the hardware driver system is ported to other platforms can be reduced, thereby improving the cross-platform portability of the hardware driver system; in this way, while ensuring that the application layer of the hardware driver system can control the required hardware to perform the required operation, the cross-platform portability of the hardware driver system can be improved.
[0124] The operation execution method provided in the embodiment of the present application can be executed by an operation execution device. In the embodiment of the present application, the operation execution device provided in the embodiment of the present application is described by taking the operation execution method executed by the operation execution device as an example.
[0125] An embodiment of the present application provides an operation execution device. Fig.11 FIG. 1 is a schematic diagram showing a framework of an operation execution device provided in an embodiment of the present application. Fig.11As shown, the operation execution device 40 provided in the embodiment of the present application may include: a sending module 41, which is used to send a first instruction to the core layer of the hardware driving system through the application layer of the hardware driving system deployed on the platform set in the operation execution device 40, the core layer includes at least one function function, each function function is used to drive the hardware to perform an operation, and the first instruction is used to call the second hardware in at least one first hardware in the hardware module of the hardware driving system to perform the first operation. A processing module 42 is used to determine, from the at least one function function, a first function function used to drive the hardware to perform the first operation through the core layer based on the first instruction sent by the sending module 41, and call the first function function to drive the second hardware to perform the first operation.
[0126] The embodiment of the present application provides an operation execution device. On the one hand, since the core layer includes at least one function function for driving the 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. Therefore, 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 to drive the hardware to execute a different operation, and there is no function function for driving the hardware to execute the same operation, in this case, when the hardware driver system is ported to other platforms, only the code of a small number of function functions in the core layer needs to be modified, and there is no need to modify the code of a large number of function functions in the hardware in the related art. Therefore, the number of codes that need to be modified when the hardware driver system is ported to other platforms can be reduced, thereby improving the cross-platform portability of the hardware driver system. In this way, while ensuring that the application layer of the hardware driver system can control the required hardware to execute the required operation, the cross-platform portability of the hardware driver system can be improved.
[0127] In a possible implementation, the above-mentioned processing module 42 is specifically used to determine the first function function based on the first instruction through the first module of the core layer, and send a first request information to the second module of the core layer, where the first request information is used to find the first function function; and determine the first function function from at least one function function through the second module according to the first request information; and, call the first function function through the first module to drive the second hardware to perform the first operation.
[0128] In a possible implementation, the processing module 42 is also used to send a second request message to the first interface of the core layer based on the first instruction before calling the first function function through the first module to drive the second hardware to perform the first operation. The second request message is used to request the second driver. The first interface is connected to at least one first hardware through at least one first communication bus. The first interface includes at least one first driver. Each first communication bus controls a first hardware through each first driver. The second driver is a driver for indicating the second communication bus in at least one first driver. The second communication bus is a communication bus connected to the second hardware in at least one first communication bus. The second driver is matched with the second driver corresponding to the second communication bus according to the second request message through the first interface. The processing module 42 is specifically used to call the first function function and the second driver through the first module to control the second hardware to perform the first operation through the second communication bus.
[0129] The operation execution device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or it can be other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile internet device (mobile internet device, MID), an augmented reality (augmentedreality, AR) / virtual reality (virtualreality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc. It can also be a server, a network attached storage (network attached storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., and the embodiment of the present application is not specifically limited.
[0130] The operation execution device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0131] The operation execution device provided in the embodiment of the present application can realize Figures 8 to 10 To avoid repetition, the various processes implemented by the method embodiment are not described here.
[0132] In some embodiments of the present application, Fig.12 As shown, an embodiment of the present application also provides an electronic device 50, including a processor 51 and a memory 52, wherein the memory 52 stores programs or instructions that can be executed on the processor 51, and when the program or instructions are executed by the processor 51, the various process steps of the above-mentioned operation execution method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, they are not described here.
[0133] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
[0134] Fig.13 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.
[0135] The electronic device 100 includes but is not limited to components such as 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.
[0136] Those skilled in the art will appreciate that the electronic device 100 may also include a power source (such as a battery) for supplying power to various components, and the power source may be logically connected to the processor 110 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Fig.13 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.
[0137] Among them, the processor 110 is used to send a first instruction to the core layer of the hardware driving system through the application layer of the hardware driving system deployed on the platform set in the electronic device, the core layer includes at least one function function, each function function is used to drive the hardware to perform an operation, and the first instruction is used to call the second hardware in at least one first hardware in the hardware module of the hardware driving system to perform the first operation; and through the core layer based on the first instruction, from at least one function function, determine the first function function used to drive the hardware to perform the first operation, and call the first function function to drive the second hardware to perform the first operation.
[0138] An embodiment of the present application provides an electronic device. 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 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. Therefore, it can be ensured that the application layer can control the required second hardware to perform the required first operation. On the other hand, since each function function included in the core layer is used to drive the hardware to perform a different operation, and there is no function function for driving the hardware to perform the same operation, in this case, when the hardware driver system is ported to other platforms, only the code of a small number of function functions in the core layer needs to be modified, and there is no need to modify the code of a large number of function functions in the hardware in the related art. Therefore, the number of codes that need to be modified when the hardware driver system is ported to other platforms can be reduced, thereby improving the cross-platform portability of the hardware driver system. In this way, while ensuring that the application layer of the hardware driver system can control the required hardware to perform the required operation, the cross-platform portability of the hardware driver system can be improved.
[0139] In some embodiments of the present application, the processor 110 is specifically used to determine a first function function based on a first instruction through a first module of the core layer, and send a first request information to a second module of the core layer, where the first request information is used to find the first function function; and determine the first function function from at least one function function through the second module according to the first request information; and, call the first function function through the first module to drive the second hardware to perform the first operation.
[0140] In some embodiments of the present application, the processor 110 is also used to send a second request information to the first interface of the core layer through the first module based on the first instruction before calling the first function function through the first module to drive the second hardware to perform the first operation, the second request information is used to request the second driver, the first interface is connected to at least one first hardware through at least one first communication bus, the first interface includes at least one first driver, each first communication bus controls a first hardware through each first driver, the second driver is a driver for indicating the second communication bus in at least one first driver, and the second communication bus is a communication bus in at least one first communication bus connected to the second hardware; and the second driver corresponding to the second communication bus is matched according to the second request information through the first interface.
[0141] The processor 110 is specifically configured to call a first function and a second driver through a first module, so as to control the second hardware to perform a first operation through a second communication bus.
[0142] It should be understood that in the embodiment of the present application, the input unit 104 may include a graphics processing unit (GPU) 1041 and a microphone 1042, and the graphics processor 1041 processes the image data of a static picture or 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 may include a display panel 1061, and the display panel 1061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 107 includes a touch panel 1071 and at least one of other input devices 1072. The touch panel 1071 is also called a touch screen. The touch panel 1071 may include two parts: a touch detection device and a touch controller. Other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (such as a volume control button, a switch button, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.
[0143] The memory 109 can be used to store software programs and various data. The memory 109 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 109 may include a volatile memory or a non-volatile memory, or the memory 109 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 109 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0144] The processor 110 may 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 application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 110.
[0145] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned operation execution method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0146] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
[0147] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned operation execution method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0148] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0149] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned operation execution method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0150] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do 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 methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0151] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0152] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A hardware drive system, characterized in that: include: An application layer, a core layer and a hardware module, wherein the core layer includes at least one function, each of which is used to drive hardware to perform an operation, and the hardware module includes at least one first hardware; The application layer is used to send a first instruction to the core layer, where the first instruction is used to call at least one second hardware in the first hardware to perform a first operation; The core layer is used to determine a first function function for driving the hardware to perform the first operation from at least one of the function functions based on the first instruction, and call the first function function to drive the second hardware to perform the first operation.
2. The hardware drive system according to claim 1, characterized in that: The core layer includes a first module and a second module, the first module is connected to the second module, and the second module includes at least one of the functional functions; The first module is used to determine the first function based on the first instruction, and send first request information to the second module, where the first request information is used to find the first function; The second module is used to determine the first function function from at least one of the function functions according to the first request information; The first module is also used to call the first function to drive the second hardware to perform the first operation.
3. The hardware drive system according to claim 2, characterized in that: The core layer further includes a first interface, the first interface is connected to at least one of the first hardware via at least one first communication bus, the first interface includes at least one first driver, and each of the first communication buses controls one of the first hardware via each of the first drivers; The first module is further used to send second request information to the first interface based on the first instruction, where the second request information is used to request a second driver, where the second driver is a driver used to indicate a second communication bus in at least one of the first drivers, and the second communication bus is a communication bus connected to the second hardware in at least one of the first communication buses; The first interface is used to match the second driver corresponding to the second communication bus according to the second request information; The first module is also used to call the first 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 according to claim 1, characterized in that: The core layer also includes a second interface, which is connected to the application layer; The second interface is used for data transmission between the core layer and the application layer.
5. The hardware drive system according to claim 1, characterized in that: The core layer also includes a third interface, and the third interface is connected to the software layer; The third interface is used for data transmission between the core layer and the software layer.
6. An electronic device, characterized in that: The electronic device comprises an operating platform, and the hardware driving system according to any one of claims 1 to 5 is deployed on the operating platform.
7. An operation execution method, applied to the electronic device according to claim 6, characterized in that: include: Sending a first instruction to a core layer of the hardware driver system through an application layer of the hardware driver system deployed on a platform set in the electronic device, wherein the core layer includes at least one function function, each of which is used to drive hardware to perform 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 driver system to perform a first operation; Based on the first instruction, the core layer determines a first function function for driving the hardware to perform the first operation from at least one of the function functions, and calls the first function function to drive the second hardware to perform the first operation.
8. The operation execution method according to claim 7, characterized in that: The determining, by the core layer based on the first instruction, from at least one of the function functions, a first function function for driving hardware to perform the first operation comprises: Determine the 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, where the first request information is used to find the first function function; Determining, by the second module, the first function function from at least one of the function functions according to the first request information; The first function is called through the first module to drive the second hardware to perform the first operation.
9. The operation execution method according to claim 8, characterized in that: Before calling the first function through the first module to drive the second hardware to perform the first operation, the method further includes: Sending second request information to the first interface of the core layer based on the first instruction through the first module, wherein the second request information is used to request a second driver, the first interface is connected to at least one of the first hardware through at least one first communication bus, the first interface includes at least one first driver, each of the first communication buses controls one of the first hardware through each of the first drivers, the second driver is a driver used to indicate a second communication bus in at least one of the first drivers, and the second communication bus is a communication bus connected to the second hardware in at least one of the first communication buses; Matching the second driver corresponding to the second communication bus according to the second request information through the first interface; The calling the first function through the first module to drive the second hardware to perform the first operation includes: The first function and the second driver are called through the first module to control the second hardware to perform the first operation through the second communication bus.
10. An operation execution device, characterized in that: include: A sending module, configured to send a first instruction to a core layer of the hardware driving system through an application layer of the hardware driving system deployed on a platform set in the operation execution device, wherein the core layer includes at least one function function, each of which is used to drive hardware to perform 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 perform a first operation; A processing module is used to determine, through the core layer and based on the first instruction sent by the sending module, a first function function for driving the hardware to perform the first operation from at least one of the function functions, and call the first function function to drive the second hardware to perform the first operation.
11. The operation execution device according to claim 10, characterized in that: The processing module is specifically used to determine the first function function based on the first instruction through the first module of the core layer, and send a first request information to the second module of the core layer, wherein the first request information is used to find the first function function; and determine the first function function from at least one of the function functions according to the first request information through the second module; and call the first function function through the first module to drive the second hardware to perform the first operation.
12. The operation execution device according to claim 10, characterized in that: The processing module is further used for sending second request information to the first interface of the core layer through the first module based on the first instruction before calling the first function function through the first module to drive the second hardware to perform the first operation, wherein the second request information is used to request a second driver, the first interface is connected to at least one of the first hardware through at least one first communication bus, the first interface includes at least one first driver, each of the first communication buses controls one of the first hardware through each of the first drivers, the second driver is a driver used to indicate a second communication bus in at least one of the first drivers, and the second communication bus is a communication bus connected to the second hardware in at least one of the first communication buses; and matching the second driver corresponding to the second communication bus through the first interface according to the second request information; The processing module is specifically configured to call the first function and the second driver through the first module, so as to control the second hardware to perform the first operation through the second communication bus.
13. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the operation execution method as claimed in any one of claims 6 to 9 are implemented.
14. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the operation execution method as described in any one of claims 7 to 9 are implemented.
15. A chip, characterized in that: It includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the steps of the operation execution method as described in any one of claims 7 to 9.
Citation Information
Cited By
Hardware driving system, operation execution method and related apparatus
WO2026032109A1
