CN109669782A - Hardware abstraction layer multiplexing method, device, operating system and equipment - Google Patents
Hardware abstraction layer multiplexing method, device, operating system and equipment Download PDFInfo
- Publication number
- CN109669782A CN109669782A CN201710953523.1A CN201710953523A CN109669782A CN 109669782 A CN109669782 A CN 109669782A CN 201710953523 A CN201710953523 A CN 201710953523A CN 109669782 A CN109669782 A CN 109669782A
- Authority
- CN
- China
- Prior art keywords
- hardware
- operating system
- programming interfaces
- application programming
- abstraction layer
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/547—Remote procedure calls [RPC]; Web services
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The embodiment of the present invention provides a kind of hardware abstraction layer multiplexing method, device, operating system and equipment, this method comprises: being instructed in response to hardware operation, first process of the first operating system calls the first application programming interfaces API in the first operating system side virtual hardware level of abstraction HAL, it is communicated by striding course and the call request of the first API is sent to the second operating system, so that the second process calls the 2nd API in the second operating system side HAL to execute hardware operation instruction in the second operating system, configuration of first API in virtual HAL corresponds to the configuration of the 2nd API in the second operating system side HAL.By the way that above-mentioned virtual HAL is arranged in the first operating system side, it can be communicated by striding course and calling of the first operating system side to API in virtual HAL is transmitted to the second operating system side, realize multiplexing of first operating system to the second operating system side HAL, it is convenient to realize, and can be adapted for any different operating system.
Description
Technical field
The present invention relates to operation system technology field more particularly to a kind of hardware abstraction layer multiplexing method, device, operation systems
System and equipment.
Background technique
The terminal devices such as mobile phone manufacturer often develops a set of hardware only for a kind of operating system when developing terminal device
Level of abstraction (Hardware Abstraction Layer, abbreviation HAL).If also needing to support another operation in the terminal device
System, then most efficient method is exactly to reuse to be multiplexed this set HAL.And the basis that often two different operating system is based on
The library C is different, this just brings adaptation difficulty to multiplexing HAL.
Currently, most-often used adaptation scheme is to directly adopt Libhybris mechanism load HAL, may be implemented to be based on
The Android operation system of Bionic is multiplexed same HAL with the operating system based on Glibc, wherein Bionic is Android operation system
The basic library C of system, Glibc are the basic library C of GNU operating system.To use Libhybris mechanism, it is necessary first to use HAL
To all functions and data structure matched on the library C of two bases, that is, establish function, data structure in the library C of two bases
Mapping relations, and it may also be desirable to additionally add or modify function therein in the library C of two bases.
Only can be realized multiplexing of the above-mentioned specific two kinds of operating system to HAL based on Libhybris mechanism, limitation compared with
Greatly;But also need to do two kinds of bases library C complicated adaptation processing, realize that difficulty is larger.
Summary of the invention
In view of this, the embodiment of the present invention provides a kind of hardware abstraction layer multiplexing method, device, operating system and equipment,
The difficulty for being multiplexed same hardware abstraction layer to reduce different operating system.
In a first aspect, the embodiment of the present invention provides a kind of hardware abstraction layer multiplexing method, applied to the first operating system
In first process, comprising:
It is instructed in response to hardware operation, first in the corresponding virtual hardware level of abstraction of first operating system is called to answer
Use routine interface;
It is communicated by striding course and the call request of the application programming interfaces is sent to the second operating system, so that described
The second process in second operating system calls the corresponding hardware abstraction layer of second operating system according to the call request
In the second application programming interfaces execute hardware operation instruction;
Wherein, configuration of first application programming interfaces in the virtual hardware level of abstraction applies journey with described second
Configuration of the sequence interface in the hardware abstraction layer has corresponding relationship.
Second aspect, the embodiment of the present invention provides a kind of hardware abstraction layer multiplexer, applied to the first operating system
In first process, comprising:
Calling module calls the corresponding virtual hardware of first operating system to take out for instructing in response to hardware operation
As the first application programming interfaces in layer;
The call request of first application programming interfaces is sent to second for communicating by striding course by sending module
Operating system, so that the second process in second operating system calls second operating system according to the call request
The second application programming interfaces in corresponding hardware abstraction layer execute the hardware operation instruction;
Wherein, configuration of first application programming interfaces in the virtual hardware level of abstraction applies journey with described second
Configuration of the sequence interface in the hardware abstraction layer has corresponding relationship.
The third aspect, the embodiment of the present invention provide a kind of operating system, comprising: application framework layer and virtual hardware are taken out
As layer;
It include a process in the application framework layer, the process is for realizing hardware abstraction as described in relation to the first aspect
Layer multiplexing method;
The configuration of application programming interfaces hardware abstraction layer corresponding with another operating system in the virtual hardware level of abstraction
The configuration of middle application programming interfaces has corresponding relationship.The realization of application programming interfaces indicates in the virtual hardware level of abstraction
Striding course communications to another operating system will be passed through to the call request of application programming interfaces in virtual hardware level of abstraction.It should
Operating system corresponds to the first operating system in first aspect.
Fourth aspect, the embodiment of the present invention provide a kind of electronic equipment, which can be implemented as user terminal and set
It is standby, including processor and memory, the memory is for storing in the above-mentioned first aspect of support subscriber terminal equipment execution firmly
The program of part level of abstraction multiplexing method, the processor is configured to for executing the program stored in the memory.The electricity
It can also include communication interface in sub- equipment, be used for and other equipment or communication.
In addition, the embodiment of the invention provides a kind of computer storage medium, by storing based on the electronic equipments
Calculation machine software instruction, it includes for executing program involved in hardware abstraction layer multiplexing method in above-mentioned first aspect.
5th aspect, the embodiment of the present invention provides a kind of hardware abstraction layer multiplexing method, applied to the first operating system
In first process, comprising:
The call request that the second process is sent by striding course communication in the second operating system is received, the call request is
Second process is instructed in response to hardware operation and is called in the corresponding virtual hardware level of abstraction of second operating system
The triggering of first application programming interfaces;
The second application program in the corresponding hardware abstraction layer of second operating system is called according to the call request
Interface, to execute the hardware operation instruction;
Wherein, configuration of first application programming interfaces in the virtual hardware level of abstraction applies journey with described second
Configuration of the sequence interface in the hardware abstraction layer has corresponding relationship.
6th aspect, the embodiment of the present invention provides a kind of hardware abstraction layer multiplexer, applied to the first operating system
In first process, comprising:
Receiving module, for receiving the call request that the second process is sent by striding course communication in the second operating system,
The call request is that second process instructs in response to hardware operation and calls second operating system corresponding virtual
What the first application programming interfaces in hardware abstraction layer triggered;
Calling module, for being called in the corresponding hardware abstraction layer of second operating system according to the call request
Second application programming interfaces, to execute the hardware operation instruction;
Wherein, configuration of first application programming interfaces in the virtual hardware level of abstraction applies journey with described second
Configuration of the sequence interface in the hardware abstraction layer has corresponding relationship.
7th aspect, the embodiment of the present invention provide a kind of operating system, comprising: application framework layer and striding course communication
Interface, includes a process in application framework layer, which is multiplexed for realizing the hardware abstraction layer as described in terms of the 5th
Method.The operating system corresponds to the first operating system in the 5th aspect.
Eighth aspect, the embodiment of the present invention provide a kind of electronic equipment, which can be implemented as user terminal and set
It is standby, such as smart phone etc., including processor and memory, the memory, which is used to store, supports electronic equipment execution above-mentioned
The program of hardware abstraction layer multiplexing method in 5th aspect, the processor is configured to being stored in the memory for executing
Program.It can also include communication interface in the electronic equipment, be used for and other equipment or communication.
In addition, the embodiment of the invention provides a kind of computer storage medium, by storing based on the electronic equipments
Calculation machine software instruction, it includes for executing program involved in hardware abstraction layer multiplexing method in above-mentioned 5th aspect.
Hardware abstraction layer multiplexing method, device, operating system and equipment provided in an embodiment of the present invention, in certain terminal device
In include the first operating system and the second operating system based on the different basis libraries C, the HAL of initial development is for the second behaviour
Make system, referred to as true HAL.To enable the first operating system to be multiplexed the true HAL, it is arranged in the first operating system side
The application programming interfaces (Application Program Interface, abbreviation API) encapsulated in virtual HAL, the virtual HAL
Configuration and true HAL in the configuration of API that encapsulates there is corresponding relationship, it is such as identical, but encapsulated in the virtual HAL
The realization of API is different from the realization of API encapsulated in true HAL, and the API realization encapsulated in virtual HAL is indicated by stepping into
The API that first operating system side is called is transmitted to the second operating system side by Cheng Tongxin, and the API encapsulated in true HAL is realized
It is the relevant operation information executed needed for actually accomplishing API Calls.
Based on this, when the first operating system side is triggered in response to the operation of user for the hard of certain hardware such as camera
When part operational order, the first process positioned at the first operating system side can be triggered and call phase in virtual HAL corresponding with the hardware
The first API answered such as camera opens interface, thus, the first process can pass through striding course based on the realization of the first API
The call request for calling the first API is sent to the second operating system side by communication, and the second process of the second operating system receives
After the call request, corresponding 2nd API in true HAL is called, is referred to complete hardware operation according to the realization of the 2nd API
The execution of order.This programme, it is only necessary to above-mentioned virtual HAL is set i.e. in the first operating system side so that in virtual HAL API configuration with it is true
The API configuration of real HAL has corresponding relationship, and setting the API realization in virtual HAL to will be to virtual by striding course communication
The calling of some API is transmitted in the second operating system corresponding to true HAL in HAL, that is, may make the first operating system energy
It is enough multiplexed the true HAL of the second operating system side, it is convenient to realize, and can be adapted for any different operating system.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is this hair
Bright some embodiments for those of ordinary skill in the art without creative efforts, can be with root
Other attached drawings are obtained according to these attached drawings.
Fig. 1 is that a kind of hardware abstraction layer provided in an embodiment of the present invention is multiplexed schematic diagram of a scenario;
Fig. 2 is a kind of flow chart of hardware abstraction layer multiplexing method provided in an embodiment of the present invention;
Fig. 3 is the flow chart of another hardware abstraction layer multiplexing method provided in an embodiment of the present invention;
Fig. 4 is the flow chart of another hardware abstraction layer multiplexing method provided in an embodiment of the present invention;
Fig. 5 is a kind of interaction figure of hardware abstraction layer multiplexing method provided in an embodiment of the present invention;
Fig. 6 is a kind of structural schematic diagram of hardware abstraction layer multiplexer corresponding with embodiment illustrated in fig. 2;
Fig. 7 is a kind of composition schematic diagram of operating system corresponding with embodiment illustrated in fig. 2;
Fig. 8 is the structural schematic diagram of electronic equipment corresponding with hardware abstraction layer multiplexer shown in Fig. 6;
Fig. 9 is a kind of structural schematic diagram of hardware abstraction layer multiplexer corresponding with Fig. 3 or embodiment illustrated in fig. 4;
Figure 10 is a kind of composition schematic diagram of operating system corresponding with Fig. 3 or embodiment illustrated in fig. 4;
Figure 11 is the structural schematic diagram of electronic equipment corresponding with hardware abstraction layer multiplexer shown in Fig. 9.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention
In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is
A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art
Every other embodiment obtained without creative efforts, shall fall within the protection scope of the present invention.
The term used in embodiments of the present invention is only to be not intended to be limiting merely for for the purpose of describing particular embodiments
The present invention.In the embodiment of the present invention and the "an" of singular used in the attached claims, " described " and "the"
It is also intended to including most forms, unless the context clearly indicates other meaning, " a variety of " generally comprise at least two, but not
It excludes to include at least one situation.
It should be appreciated that term "and/or" used herein is only a kind of incidence relation for describing affiliated partner, indicate
There may be three kinds of relationships, for example, A and/or B, can indicate: individualism A, exist simultaneously A and B, individualism B these three
Situation.In addition, character "/" herein, typicallys represent the relationship that forward-backward correlation object is a kind of "or".
It will be appreciated that though XXX may be described in embodiments of the present invention using term first, second, third, etc., but
These XXX should not necessarily be limited by these terms.These terms are only used to distinguish XXX.For example, not departing from model of the embodiment of the present invention
In the case where enclosing, the first XXX can also be referred to as the 2nd XXX, and similarly, the 2nd XXX can also be referred to as the first XXX.
Depending on context, word as used in this " if ", " if " can be construed to " ... when " or
" when ... " or " in response to determination " or " in response to detection ".Similarly, context is depended on, phrase " if it is determined that " or " such as
Fruit detection (condition or event of statement) " can be construed to " when determining " or " in response to determination " or " when detection (statement
Condition or event) when " or " in response to detection (condition or event of statement) ".
It should also be noted that, the terms "include", "comprise" or its any other variant are intended to nonexcludability
Include, so that commodity or system including a series of elements not only include those elements, but also including not clear
The other element listed, or further include for this commodity or the intrinsic element of system.In the feelings not limited more
Under condition, the element that is limited by sentence "including a ...", it is not excluded that in the commodity or system for including the element also
There are other identical elements.
In addition, the step timing in following each method embodiments is only a kind of citing, rather than considered critical.
Fig. 1 is that a kind of hardware abstraction layer provided in an embodiment of the present invention is multiplexed schematic diagram of a scenario, as shown in fig. 1, it is assumed that
It include two operating systems OS_A and OS_B based on the different basis libraries C in certain terminal device, wherein OS_A is based on basis
The library C --- Libc_A exploitation, OS_B is based on the basis library C --- the A of Libc_B exploitation.Corresponding to the scene, the present invention is real
The hardware abstraction layer multiplexing method of example offer is applied for realizing two operating system shown in Fig. 1 --- OS_A and OS_B is to being located at
The multiplexing of the HAL of the side OS_A.
Assuming that the HAL of initial development is to distinguish with virtual HAL, it is assumed that be known as true HAL for OS_A.To make
OS_B can be multiplexed the true HAL, and virtual HAL is arranged in the side OS_B.Specifically, the configuration of the API encapsulated in the virtual HAL
The configuration of the API encapsulated in (being referred to as defining) and true HAL has corresponding relationship, wherein preferably, this can be set
The configuration of the API encapsulated in virtual HAL is identical as the configuration of API encapsulated in true HAL, but encapsulated in the virtual HAL
The realization of API is different from the realization of API encapsulated in true HAL, and the API realization encapsulated in virtual HAL is indicated by stepping into
The API that the side OS_B is called is transmitted to the side OS_A by Cheng Tongxin, and the API realization encapsulated in true HAL is to actually accomplish API Calls
The relevant operation information of required execution.
Wherein, configuring for the API encapsulated in virtual HAL has corresponding relationship can with the configuration of the API encapsulated in true HAL
To show as one-to-one relationship, many-to-one corresponding relationship can also be shown as.As an example it is assumed that existing in true HAL
Some API is configured to function (A, B, C), then API corresponding with API configuration can be in virtual HAL are as follows: function
(A), function (B), function (C) form three pair one of corresponding relationship.
Wherein, since the content that API is realized in virtual HAL is related to striding course communication, therefore, it is necessary to establish as shown in figure 1
Shown in striding course communication (IPC) connection between above-mentioned two operating system: IPC Bridge, such as the IPC_A illustrated in figure,
IPC_B is two end interfaces of the communication.Optionally, striding course communication can pre-establish, so as to subsequent direct use,
It can establish in real time when needed.
It is to be understood that the foundation of above-mentioned striding course communication, as establishes interface IPC_A in the side OS_A, builds in the side OS_B
Vertical interface IPC_B, wherein it is based on Libc_B that IPC_A, which is based on Libc_A, IPC_B,.
Optionally, striding course communication connection can be realized based on the IPC mechanism provided in operating system nucleus Kernel,
Such as Socket, OpenBinder, but be not restricted to that both implementations.
In addition, the true HAL and virtual HAL in the embodiment of the present invention may be considered for some in terminal device firmly
The level of abstraction of part, such as the hardware abstraction layer of camera: camera HAL;Alternatively, the hardware abstraction layer of sensor: sensor
HAL, etc..
Facilities based on above-mentioned two operating system, for example, when some camera application program of the side OS_B responds
In user operation and when needing to call camera HAL to operate camera, the camera application program can star one into
Journey, the process may be considered process B, and process B such as calls some API in virtual camera HAL, it is assumed that the API's
It configures and is accomplished by
The API is used to trigger the opening operation to camera.Wherein, bool open (int cameraId) is the API's
Configuration, the realization that the content in { } is the API.CameraId is call parameters, which camera what instruction needed to operate is, than
If Id=0 is front camera, Id=1 is rear camera.It is to call this API of Open, return that API_OPEN, which is indicated,
Using returning the result as the return of the API result of open for ipc_send.
As can be seen that the realization of the API indicates the calling for transmitting the API to the side OS_A by striding course communication (IPC).
It is communicated to which, process B can create some default process with the side OS_A in real time and be known as the striding course between process A, and passes through foundation
Striding course communication will be sent to process A to the call request of the API.API Calls correlation can be carried in the call request
Parameter, such as the API that needs to call are identification information --- the API_OPEN of which API, and need to open is which is taken the photograph
As head --- cameraId, thus, process A can be called according to the call request corresponding A PI in true camera HAL come
Complete the operation carried out needed for camera application program to camera.Assuming that configuration of the corresponding A PI in true camera HAL
Be accomplished by
Wherein, open (int cameraId) is the configuration of the API, the realization that the content in { } is the API.It can see
Out, the realization that is implemented among virtual camera HALs of the API in true camera HAL is different, in true camera
Realization in HAL is specially the operation information etc. to corresponding hardware.
In the example above, virtual HAL is identical as the configuration of API in true HAL, is bool open (int
cameraId)。
It is worth noting that above-mentioned process A is process corresponding with true camera HAL, process A can be considered as
The service processes of true camera HAL, are pre-created, and process B can be considered as client process, and process A can be
Start with the starting of OS_A, whether monitor always later has the client process from OA_B to need to call true camera
API in HAL.
By the way that virtual HAL is arranged in OS_B, and in the virtual HAL API configuration with the configuration of true API with corresponding
Relationship, for example can directly replicate the API configuration that can be formed in virtual HAL from true HAL.And in virtual HAL API realization
It only needs provide the sending function of IPC and related call parameters is provided, so that virtual HAL is for true HAL,
Logic is realized without complicated function, i.e., the operation of hardware is controlled without really execution, realized simple.
Below with reference to following examples, respectively with the angle of above-mentioned different operating system to provided in an embodiment of the present invention hard
Part level of abstraction multiplexing method is introduced.
Fig. 2 is a kind of flow chart of hardware abstraction layer multiplexing method provided in an embodiment of the present invention, provided in this embodiment
Realize have by first in the first operating system in the hardware abstraction layer multiplexing method the first operating system shown in Fig. 1
Process executes.In conjunction with Fig. 1, it is assumed that the first operating system of this in the present embodiment be OS_B, the second operating system be OS_A, first into
Journey is process B, and the second process is process A.As shown in Fig. 2, this method comprises the following steps:
201, it is instructed in response to hardware operation, the first process of the first operating system calls the corresponding void of the first operating system
The first application programming interfaces in quasi- hardware abstraction layer.
Optionally, in practical application, process B be can be by application program or application framework the layer starting of the side OS_B
Some process, such as the process started for camera application program in the example above.Optionally, process B be also possible to
The corresponding dedicated process of virtual HAL, for being called to API in virtual HAL, at this point, process B can be for applying journey
Sequence accesses.
Such as: camera application program is instructed in response to the photographing operation that user triggers, and is accessed corresponding with camera virtual
The corresponding process B of camera HAL transmits relevant parameter, such as camera identification camera0, and work to first process
Mode --- it takes pictures.To which process B calls the API that takes pictures in virtual camera HAL based on the parameter.
202, the first process is communicated by striding course the call request of application programming interfaces being sent to the second operating system,
So that the second process in the second operating system is called in the corresponding hardware abstraction layer of the second operating system according to call request
Second application programming interfaces execute hardware operation instruction.
Wherein, configuration of first application programming interfaces in virtual HAL and the second application programming interfaces are in the second operation system
Configuration in the i.e. true HAL of the corresponding HAL that unites has corresponding relationship.
In the present embodiment, it is assumed that above-mentioned corresponding relationship is presented as that configuration is identical, thus above-mentioned first API and the 2nd API phase
Together.
As previously mentioned, process B, when calling some API, the realization based on the API will be communicated by striding course by the API
Call request be sent to OS_A so that the process A in OS_A is according in the corresponding true HAL of call request calling process B
The API with execute hardware operation instruction.Wherein, the content for including in the realization of the API is indicated will by striding course communication
The call parameters of API are transmitted in process A, which such as includes the mark and the corresponding hardware mark of the API of the API
Know.Process B can therefrom extract the call parameters, be encapsulated in call request and be sent to process A.
In practical application, process A calls process B in true HAL that the API called is needed to refer to execute above-mentioned hardware operation
It enables, the readjustment that may be related to hardware operation result feeds back to process B, it is also possible to will not relate to returning for hardware operation result
It adjusts.For example, above-mentioned API may realize that comparison such as inquiry subscriber terminal equipment shares several cameras, will not have at this time
The readjustment of hardware operation result;For another example, above-mentioned API may be to realize that triggering camera is recorded a video, at this point, having hardware behaviour
Make the readjustment of result, i.e., the video clapped camera pulls back to the first process.
Therefore, in the case of being related to hardware operation result readjustment, the hardware that process B also needs receiving process A to feed back is grasped
Make result.
Optionally, which may include: hardware data, which is instructed by execution hardware operation
Hardware is hardware generation corresponding with true HAL, such as above-mentioned video;Alternatively, the hardware operation result is hardware data
Storage address in shared drive;Alternatively, the hardware operation result is operation failure prompt information.
Optionally, make required transmission time mistake in order to avoid needing to transmit excessive data volume between process B and process A
It is long, so as to the too long holding time of true HAL and virtual HAL, influences other and need to call true HAL, virtual HAL
The calling of process, process A can be directly to feed back the hardware number to process B according to the determination of the size of the data volume of hardware data
According to.For example, process B is directly fed back to, conversely, by the hardware data when the data volume of the hardware data is less than preset threshold
It is stored in shared drive, so that storage address of the hardware data in shared drive is only fed back to process B, so that process B
The hardware data is obtained from the shared drive.Wherein, shared drive is the storage that preset two operating system can share
Space.
It is worth noting that aforesaid operations failure prompt information can be considered as a kind of special hardware operation as a result, should
Operation failure prompt information refers to that process A after the call request for receiving process B transmission, is called based on the call request
In true HAL before corresponding API, if identifying, the API that need to be called has exclusive operational attribute, and then determines this true HAL pairs
It is sent when the hardware answered is in busy condition to process B.When the hardware is in busy condition, illustrate there are other processes
The true HAL is called to operate the hardware, then process A can not call the API in the true HAL at this time, thus to the first process
Feedback operation failure prompt information.Wherein, it will be discussed in detail in subsequent embodiment about the explanation of above-mentioned exclusive operational attribute.
To sum up, hardware abstraction layer multiplexing method provided in an embodiment of the present invention, it is only necessary to be arranged in the first operating system side and have
There is the virtual HAL of following feature, it can realize the first operating system to the corresponding real hardware level of abstraction of the second operating system
Multiplexing: API configuration has corresponding relationship L in the configuration for the API being arranged in virtual HAL and true HAL, and will be in virtual HAL
API realization be set as by striding course communicate the calling of some API in virtual HAL will be transmitted to corresponding to true HAL's
In second operating system.The program, it is convenient to realize, and can be adapted for any different operating system.
Fig. 3 is the flow chart of another hardware abstraction layer multiplexing method provided in an embodiment of the present invention, the present embodiment provides
The hardware abstraction layer multiplexing method executed by the first process in the first operating system.Assuming that first in the present embodiment grasps
It is OS_A shown in FIG. 1 as system, the second operating system is OS_B shown in FIG. 1, and the first process is process A shown in FIG. 1, the
Two processes are process B shown in FIG. 1, thus, as shown in figure 3, this method may include steps of:
301, the first process receives the call request that the second process is sent by striding course communication in the second operating system, adjusts
It is that the second process is instructed in response to hardware operation and in the corresponding virtual hardware level of abstraction of the second operating system of calling with request
The triggering of first application programming interfaces.
302, the first process calls the second application in the corresponding hardware abstraction layer of the first operating system according to call request
Routine interface, to execute hardware operation instruction.
Wherein, configuration of first application programming interfaces in virtual HAL and the second application programming interfaces are in the first operation system
Configuration in the corresponding hardware abstraction layer, that is, true HAL of system OS_A has corresponding relationship.
In the present embodiment, it is assumed that above-mentioned corresponding relationship be presented as configuration of first application programming interfaces in virtual HAL with
Configuration of second application programming interfaces in true HAL is identical, is illustrated below based on the hypothesis.
Wherein, the mark for the API that process B to be called can be carried in above-mentioned call request and that needs operate is hard
The information such as the mark of part, so that process A can call corresponding API in true HAL accordingly.
Process A can be a process for being set in advance in the side OS_A, exist in OS_A starting.Process A is responsible for
Process in OS_B is to the calling of true HAL corresponding to OS_A, so that OS_B can be multiplexed the true HAL of the side OS_A.
The detailed process that process A executes above-mentioned steps may refer to the related description in previous embodiment, and this will not be repeated here.
Fig. 4 is the flow chart of another hardware abstraction layer multiplexing method provided in an embodiment of the present invention, is implemented with shown in Fig. 3
Example is the same, and the hardware abstraction layer multiplexing method provided in this embodiment can be held by the first process in the first operating system
Row.Assuming that the first operating system in the present embodiment is OS_A shown in FIG. 1, the second operating system is OS_B shown in FIG. 1, the
One process is process A shown in FIG. 1, and the second process is process B shown in FIG. 1, thus, as shown in figure 4, this method may include
Following steps:
401, the first process receives the call request that the second process is sent by striding course communication in the second operating system, adjusts
It is that the second process is instructed in response to hardware operation and in the corresponding virtual hardware level of abstraction of the second operating system of calling with request
The triggering of first application programming interfaces.
402, the first process needs to call in the corresponding hardware abstraction layer of the first operating system according to call request determination
Second application programming interfaces, if identifying, the second application programming interfaces have exclusive operational attribute, check hardware abstraction layer pair
The state for the hardware answered.
If 403, the state of hardware indicates that hardware is in idle condition, the first process calls the first behaviour according to call request
Make the second application programming interfaces in the corresponding hardware abstraction layer of system, to execute hardware operation instruction.
404, the state of hardware is set to busy condition by the first process.
If 405, hardware execute hardware operation instruction and generate hardware data data volume be less than preset threshold, first
Hardware data is sent to the second process by process;If the data volume of hardware data is greater than or equal to preset threshold, the first process
Hardware data is stored in shared drive, and storage address of the hardware data in shared drive is sent to the second process.
The mark for the first API that process B is called in virtual HAL can be carried in the call request sent by process B
Know, thus, process A can configure the corresponding relationship seen with API in virtual HAL based on API configuration in true HAL, determine true
Twoth API corresponding with the first API of calling needed for process B in real HAL.
In an alternative embodiment, process A can be called immediately in true HAL after receiving above-mentioned call request
Corresponding 2nd API.But in some practical application scenes, when process A needs to call the 2nd API in true HAL to come
When carrying out certain operation to hardware corresponding to the true HAL, this is had called up before possible other processes there are also in OS_A
Some API in true HAL operates the hardware.And if the hardware only can be by a process in the same time
Operation, i.e., if the hardware belongs to exclusive hardware, should not allow process A to call the API in true HAL at this time.Citing comes
It says, it is assumed that some process is controlling camera and carrying out photographing operation, then another process cannot use the camera simultaneously
?.
Therefore, in order to avoid calling while different processes are to same true HAL, that is, avoid different processes to same hardware
While from operation, process A additionally provides mutual exclusion mechanism, the mutual exclusion mechanism in simple terms be exactly when true HAL currently by some
When process is called, the state of hardware corresponding to the true HAL can be set to busy condition by process A, otherwise be set to idle state, with
Calling while multiple processes are avoided to the true HAL.Wherein, which refers to that the hardware is occupied by some process, because
This, which also refers to occupied state, and correspondingly, idle state can also refer to unoccupied state.
To realize that above-mentioned mutual exclusion function, process A call second in true HAL in the call request based on process B
Before API, it can first identify whether the 2nd API has exclusive operational attribute, the 2nd API has exclusive operation if identifying
Attribute then checks the state of hardware corresponding to true HAL, if the state of the hardware indicates that the hardware is in idle condition,
Process A can call the 2nd API in true HAL to instruct to execute hardware operation according to the call request of process B at this time;And if
The state of the hardware indicates that the hardware is in busy condition, then process A then sends operation failure prompt information to process A, at this time
Illustrate the hardware just by other process operations.On the contrary, if identifying, the 2nd API does not have exclusive operational attribute, illustrates
Even if having other processes calling true HAL at this time to operate the hardware, the execution for the 2nd API that process A is called is not yet
Being normally carried out for other processes is influenced whether, at this point, process A can also call the 2nd API in true HAL to grasp to execute hardware
It instructs.
In the present embodiment, the exclusive operational attribute of above-mentioned 2nd API is referred to as EXCEPT operation attribute, and meaning can
To understand are as follows: if allow different processes while the 2nd API being called to carry out certain operation to hardware, the 2nd API does not have
There is exclusive operational attribute, on the contrary, if do not allow different processes while the 2nd API being called to carry out certain operation to hardware,
Then the 2nd API has exclusive operational attribute.As an example it is assumed that the 2nd API can be realized the opening operation to camera,
Then since actually some process has been switched on camera in the case where, do not allow another process to be again turned on camera, so
There is exclusive operational attribute for realizing the 2nd API of camera open function.For another example, it is assumed that the 2nd API is for real
The query function for the camera number for including in existing terminal device, then due to being actually that can permit multiple processes while inquiring
Camera number, so the 2nd API does not have exclusive operational attribute.
It is alternatively possible to identify whether the 2nd API has exclusive behaviour according to the configuration of the 2nd API in true HAL
Make attribute.For example, can in the 2nd API with centering certain field, the different values of the field for indicate this
Whether two API have exclusive operational attribute, for example 00 indicates do not have exclusive operational attribute, and 01 indicates that there is exclusive operation to belong to
Property.
In an alternative embodiment, process A can be after the call request for often receiving process B transmission, if identifying this
Call request API corresponding in true HAL has exclusive operational attribute, then carries out the inquiry of hardware state immediately.But
In another alternative embodiment, process A can also only be certain spy with exclusive operational attribute recognize the need for calling
When determining API, the state of hardware is just checked, to reduce inquiry operation.Therefore, process A is in the call request for receiving process B transmission
Afterwards, if identifying, the call request the 2nd API corresponding in true HAL has exclusive operational attribute, and the 2nd API
It is just to check the state of the hardware at this time for realizing the opening operation to hardware.For by taking camera is applied as an example, generally
Ground, during being taken pictures by camera, process B may need successively to call open camera, open preview, take pictures,
Close these API of camera.When process B calls the API for opening camera in virtual HAL, process A can receive process B
The corresponding call request of API of the unlatching camera sent, in turn, process A identify the API have exclusive operational attribute and
For realizing the opening operation of camera, then the state of camera is inquired, it is assumed that camera is in idle condition at this time, then process
A calls the corresponding API for opening camera in true HAL to execute opening operation to camera, and the state of camera is set to
Busy condition, at this point, optionally, it is process B that process A, which also can recorde the lower process that camera is set to busy condition,.Later,
Optionally, process A is opened to process B feedback and is successfully indicated, thus, process B continues to call the API that preview is opened in virtual HAL.
At this point, process A is after the corresponding call request of API for receiving the unlatching preview, even if identifying that the unlatching is pre- in true HAL
The API look at has exclusive operational attribute, can also be without the inquiry of camera state, because process B also and is not finished to taking the photograph
As the operation of head.Until process A receive process B to close camera API call request, identify the closing camera
API there is exclusive operational attribute, and for realizing the shutoff operation to camera, at this point, process A sets the state of camera
For idle state, process B terminates the operation of camera at this time.
Therefore, if process A identifies that the 2nd API has exclusive operational attribute, and the 2nd API is for realizing to hardware
The state of hardware is then set to idle state by shutoff operation.In addition, in practical application, to the calling of true HAL, in addition to existing
Process A needs to call outside the situation of true HAL, it is also possible to which there are some processes of the side OS_A application program launching, it is assumed that claims
Need to call the situation of true HAL for third process.At this point, third process before calling true HAL, needs to inquire to process A
The state of the corresponding hardware of the true HAL, to be called when the hardware is in idle condition to true HAL.Therefore, process
A can also receive the state for being used to inquire the corresponding hardware of true HAL that third process is sent by striding course communication in OS_A
Inquiry request, and the state of hardware is sent to third process so that third process determine whether to call according to the state it is true
Real HAL.
As in the preceding embodiment, in order to avoid the too long holding time to true HAL, process A can be according to calling
2nd API and when executing hardware operation instruction the data volume size determination of hardware data caused by hardware be directly by the hardware
Data feedback gives process B, or storage address of the hardware data in shared drive is fed back to process B.
To sum up, process A is provided in the side OS_A with true HAL, to monitor asking to the calling of true HAL from OS_B
It asks, to assist completing multiplexing of the OS_B to true HAL;In addition, process A also provides mutual exclusion mechanism, to avoid multiple processes pair
It is called while the true HAL corresponding to exclusive hardware.
Fig. 5 is a kind of interaction figure of hardware abstraction layer multiplexing method provided in an embodiment of the present invention, in conjunction with Fig. 1, this implementation
First operating system is OS_B in example, and the second operating system is OS_A, and the first process is process B, and the second process is process A.
And assume that API configuration is identical as API configuration in true HAL in virtual HAL.As shown in figure 5, may include steps of:
501, it is instructed in response to hardware operation, the first process of the first operating system calls the corresponding void of the first operating system
Application programming interfaces in quasi- hardware abstraction layer.
502, the first process is communicated by striding course the call request of application programming interfaces being sent to the second operating system
In the second process.
503, the second progress recognizing, which goes out the application programming interfaces, has exclusive operational attribute, checks real hardware level of abstraction pair
The state for the hardware answered.
If 504, hardware is in idle condition, the second process calls the second operating system corresponding true according to call request
The application programming interfaces in real hardware abstraction layer, to execute hardware operation instruction.
505, the state of hardware is set to busy condition by the second process.
506, the second process receives third process in the second operating system and is used to inquire very by what striding course communication was sent
The inquiry request of the state of the corresponding hardware of real HAL.
507, the inquiry response that instruction hardware is in busy condition is sent to third process by the second process.
508, third process is abandoned calling true HAL.
509, the hardware data that hardware is executed hardware operation instruction and generated by the second process is sent to the first process.
The hardware abstraction layer multiplexer of one or more embodiments of the invention described in detail below.Art technology
Personnel are appreciated that commercially available hardware component can be used to pass through the step that this programme is instructed for these hardware abstraction layer multiplexers
Suddenly it is configured to constitute.
Fig. 6 is a kind of structural schematic diagram of hardware abstraction layer multiplexer corresponding with embodiment illustrated in fig. 2, such as Fig. 6 institute
Show, which includes: calling module 11, sending module 12, receiving module 13.
Calling module 11 calls the corresponding virtual hardware of first operating system for instructing in response to hardware operation
The first application programming interfaces in level of abstraction.
The call request of the application programming interfaces is sent to the second behaviour for communicating by striding course by sending module 12
Make system, so that the second process in second operating system calls second operating system pair according to the call request
The second application programming interfaces in the hardware abstraction layer answered execute the hardware operation instruction.
Wherein, configuration of first application programming interfaces in the virtual hardware level of abstraction applies journey with described second
Configuration of the sequence interface in the hardware abstraction layer has corresponding relationship.
Optionally, configuration of first application programming interfaces in the virtual hardware level of abstraction and second application
Configuration of the routine interface in the hardware abstraction layer is identical.
Optionally, device further include: receiving module 13.
Receiving module 13, for receiving the hardware operation result of second progress feedback.
Wherein, the hardware operation result includes:
Hardware data, the hardware data are generated by executing the hardware that the hardware operation instructs;Or the hardware number
According to the storage address in shared drive;Or operation failure prompt information;Wherein, the hardware data and the storage address
It is that second process determines whether to send according to the data volume size of the hardware data;The operation failure prompt information
Second process is sent when determining that the hardware is busy.
The method that Fig. 6 shown device can execute Fig. 2, the part that the present embodiment is not described in detail, can refer to shown in Fig. 2
The related description of embodiment.Description in implementation procedure and the technical effect embodiment shown in Figure 2 of the technical solution, herein
It repeats no more.
Fig. 7 is a kind of composition schematic diagram of operating system corresponding with embodiment illustrated in fig. 2, as shown in fig. 7, the operation system
System can be OS_B shown in FIG. 1, include: application framework layer and virtual hardware level of abstraction in the operating system.
It wherein, include a process in the application framework layer, the process is for realizing institute in embodiment as shown in Figure 2
The hardware abstraction layer multiplexing method stated.The process can be the process B in embodiment illustrated in fig. 2.
Referring to the introduction in previous embodiment, the configuration of application programming interfaces and another behaviour in the virtual hardware level of abstraction
The configuration for making application programming interfaces in the corresponding hardware abstraction layer of system has corresponding relationship.It is answered in the virtual hardware level of abstraction
The call request of application programming interfaces in virtual hardware level of abstraction will be led to by striding course by being indicated with the realization of routine interface
Letter is transmitted to another operating system.
Since the realization of application programming interfaces in virtual hardware level of abstraction is related to striding course communication, in an alternative embodiment
In, striding course communication can be realized based on the striding course communication mechanism such as Socket provided in the kernel of operating system, because
This can also include optionally kernel as shown in Figure 7 in the operating system.
In a possible design, the structure of hardware abstraction layer multiplexer shown in Fig. 6 can be realized as an electronic equipment,
The electronic equipment is subscriber terminal equipment, such as smart phone, tablet computer, PC machine etc., as shown in figure 8, the user terminal is set
Standby may include: processor 21 and memory 22.Wherein, the memory 22 supports subscriber terminal equipment to execute for storing
The program of the hardware abstraction layer multiplexing method provided in each illustrated embodiment is stated, the processor 21 is configurable for executing institute
State the program stored in memory 22.
Described program includes one or more computer instruction, wherein one or more computer instruction is described
Processor 21 can be realized following steps when executing:
It is instructed in response to hardware operation, first in the corresponding virtual hardware level of abstraction of first operating system is called to answer
Use routine interface;
It is communicated by striding course and the call request of the application programming interfaces is sent to the second operating system, so that described
The second process in second operating system calls the corresponding hardware abstraction layer of second operating system according to the call request
In the second application programming interfaces execute hardware operation instruction;
Wherein, configuration of first application programming interfaces in the virtual hardware level of abstraction applies journey with described second
Configuration of the sequence interface in the hardware abstraction layer has corresponding relationship.
Optionally, the processor 21 is also used to execute all or part of the steps in method and step shown in earlier figures 2.
Wherein, in the structure of the subscriber terminal equipment can also include communication interface 23, for subscriber terminal equipment with
Other equipment or communication.
In addition, the embodiment of the invention provides a kind of computer storage mediums, for storing used in subscriber terminal equipment
Computer software instructions, it includes for executing in embodiment of the method shown in above-mentioned Fig. 2 involved by hardware abstraction layer multiplexing method
Program.
Fig. 9 is a kind of structural schematic diagram of hardware abstraction layer multiplexer corresponding with Fig. 3 or embodiment illustrated in fig. 4, such as
Shown in Fig. 9, which includes: receiving module 31, calling module 32.
Receiving module 31 is asked for receiving the second process in the second operating system by the calling that striding course communication is sent
It asks, the call request is that second process instructs in response to hardware operation and calls the corresponding void of second operating system
What the first application programming interfaces in quasi- hardware abstraction layer triggered.
Calling module 32, for being called in the corresponding hardware abstraction layer of second operating system according to the call request
The second application programming interfaces, to execute hardware operation instruction.
Wherein, wherein configuration of first application programming interfaces in the virtual hardware level of abstraction and described second
Configuration of the application programming interfaces in the hardware abstraction layer has corresponding relationship.
Optionally, device further include: enquiry module 33, setup module 34.
Enquiry module 33, if checking institute for identifying that second application programming interfaces have exclusive operational attribute
State the state of the corresponding hardware of hardware abstraction layer.
Correspondingly, calling module 32 is specifically used for: if enquiry module 33 finds the state and indicates that the hardware is in sky
Not busy state then calls second application programming interfaces according to the call request, to execute the hardware operation instruction.
Setup module 34, under the triggering of the calling module 32, the state of the hardware to be set to busy condition.
Optionally, the enquiry module 33 is specifically used for: if identifying, second application programming interfaces have exclusive behaviour
Make attribute, and second application programming interfaces then check the hardware for realizing the opening operation to the hardware
State.
Optionally, the calling module 32 is specifically used for: if it is non-exclusive to identify that second application programming interfaces have
Operational attribute then calls second application programming interfaces according to the call request, to execute the hardware operation instruction.
Optionally, described device further include: sending module 35.
Sending module 35, for by the hardware operation instruct corresponding hardware operation result feed back to described first into
Journey.
Optionally, which is specifically used for:
If the hardware executes the hardware operation instruction and the data volume of the hardware data of generation is less than preset threshold,
First process is sent to using the hardware data as the hardware operation result;
If the data volume of the hardware data is greater than or equal to the preset threshold, the hardware data is stored in shared
In memory, and storage address of the hardware data in the shared drive is sent to first process.
Optionally, the sending module 35 is also used to:
If the state indicates that the hardware is in busy condition, operation failure prompt letter is sent to first process
Breath.
Optionally, the receiving module 31 is also used to: the third process in second operating system that receives passes through striding course
The inquiry request sent is communicated, the inquiry request is used to inquire the state of the hardware.
The sending module 35 is also used to: the state of the hardware being sent to the third process, so that the third
Process determines whether to call the hardware abstraction layer according to the state.
The method that Fig. 9 shown device can execute Fig. 3 or embodiment illustrated in fig. 4, the part that the present embodiment is not described in detail,
It can refer to the related description to Fig. 3 or embodiment illustrated in fig. 4.The implementation procedure and technical effect of the technical solution referring to Fig. 3 or
Description in embodiment illustrated in fig. 4, details are not described herein.
Figure 10 is a kind of composition schematic diagram of operating system corresponding with Fig. 3 or embodiment illustrated in fig. 4, as shown in Figure 10,
The operating system can be OS_A shown in FIG. 1, include: that application framework layer and striding course communication connect in the operating system
Mouthful.
It wherein, include a process in the application framework layer, which implements for realizing as shown in Figure 3 or Figure 4
Hardware abstraction layer multiplexing method described in example.The process can be the process A in embodiment illustrated in fig. 2.
It can also include hardware abstraction layer in the operating system optionally referring to the introduction in previous embodiment.The hardware
The configuration of application programming interfaces virtual hardware level of abstraction corresponding with operating system shown in another operating system, that is, Fig. 7 in level of abstraction
The configuration of middle application programming interfaces has corresponding relationship.
Above-mentioned striding course communication interface, can receive another operation by the striding course communication interface for above-mentioned process is
The call request that system is sent.
In an alternative embodiment, which can be based on the striding course provided in the kernel of operating system
Communication mechanism such as Socket is realized, can also include kernel as shown in Figure 10 in the operating system optionally therefore.
In a possible design, the structure of hardware abstraction layer multiplexer shown in Fig. 9 can be realized as an electronic equipment,
The electronic equipment is subscriber terminal equipment, and as shown in figure 11, which may include: processor 41 and memory
42.Wherein, the memory 42 supports subscriber terminal equipment to execute the hardware provided in above-mentioned each illustrated embodiment for storing
The program of level of abstraction multiplexing method, the processor 41 are configurable for executing the program stored in the memory 42.
Described program includes one or more computer instruction, wherein one or more computer instruction is described
Processor 41 can be realized following steps when executing:
The call request that the second process is sent by striding course communication in the second operating system is received, the call request is
Second process is instructed in response to hardware operation and is called in the corresponding virtual hardware level of abstraction of second operating system
The triggering of first application programming interfaces;
The second application program in the corresponding hardware abstraction layer of second operating system is called according to the call request
Interface, to execute the hardware operation instruction;
Wherein, configuration of first application programming interfaces in the virtual hardware level of abstraction applies journey with described second
Configuration of the sequence interface in the hardware abstraction layer has corresponding relationship.
Optionally, the processor 41 is also used to execute all or part of step in method and step shown in earlier figures 3 or Fig. 4
Suddenly.
Wherein, in the structure of the subscriber terminal equipment can also include communication interface 43, for subscriber terminal equipment with
Other equipment or communication.
In addition, the embodiment of the invention provides a kind of computer storage mediums, for storing used in subscriber terminal equipment
Computer software instructions, it includes for executing hardware abstraction layer multiplexing method institute in embodiment of the method shown in above-mentioned Fig. 3 or Fig. 4
The program being related to.
The apparatus embodiments described above are merely exemplary, wherein described, unit can as illustrated by the separation member
It is physically separated with being or may not be, component shown as a unit may or may not be physics list
Member, it can it is in one place, or may be distributed over multiple network units.It can be selected according to the actual needs
In some or all of the modules achieve the purpose of the solution of this embodiment.Those of ordinary skill in the art are not paying creativeness
Labour in the case where, it can understand and implement.
Through the above description of the embodiments, those skilled in the art can be understood that each embodiment can
It is realized by the mode of required general hardware platform is added, naturally it is also possible to which reality is come in conjunction with by way of hardware and software
It is existing.Based on this understanding, substantially the part that contributes to existing technology can be to calculate in other words for above-mentioned technical proposal
The form of machine product embodies, and it wherein includes the meter of computer usable program code that the present invention, which can be used in one or more,
The computer journey implemented in calculation machine usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.)
The form of sequence product.
The present invention be referring to according to the method for the embodiment of the present invention, the process of equipment (system) and computer program product
Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions
The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs
Instruct the processing of general purpose computer, special purpose computer, Embedded Processor or other programmable hardware level of abstraction multiplexing equipments
Device is to generate a machine, so that the finger executed by the processor of computer or other programmable hardware level of abstraction multiplexing equipments
It enables and generates to specify in one or more flows of the flowchart and/or one or more blocks of the block diagram
The device of function.
These computer program instructions may also be stored in be able to guide computer or other programmable hardware level of abstractions multiplexing set
In standby computer-readable memory operate in a specific manner, so that instruction stored in the computer readable memory generates
Manufacture including command device, the command device are realized in one or more flows of the flowchart and/or one, block diagram
The function of being specified in box or multiple boxes.
These computer program instructions can also be loaded on computer or other programmable hardware level of abstraction multiplexing equipments, be made
It obtains and executes series of operation steps on a computer or other programmable device to generate computer implemented processing, thus counting
The instruction executed on calculation machine or other programmable devices is provided for realizing in one or more flows of the flowchart and/or side
The step of function of being specified in block diagram one box or multiple boxes.
In a typical configuration, calculating equipment includes one or more processors (CPU), input/output interface, net
Network interface and memory.
Memory may include the non-volatile memory in computer-readable medium, random access memory (RAM) and/or
The forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM).Memory is computer-readable medium
Example.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method
Or technology come realize information store.Information can be computer readable instructions, data structure, the module of program or other data.
The example of the storage medium of computer includes, but are not limited to phase change memory (PRAM), static random access memory (SRAM), moves
State random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electric erasable
Programmable read only memory (EEPROM), flash memory or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM),
Digital versatile disc (DVD) or other optical storage, magnetic cassettes, tape magnetic disk storage or other magnetic storage devices
Or any other non-transmission medium, can be used for storage can be accessed by a computing device information.As defined in this article, it calculates
Machine readable medium does not include temporary computer readable media (transitory media), such as the data-signal and carrier wave of modulation.
Finally, it should be noted that the above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although
Present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that: it still may be used
To modify the technical solutions described in the foregoing embodiments or equivalent replacement of some of the technical features;
And these are modified or replaceed, technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution spirit and
Range.
Claims (19)
1. a kind of hardware abstraction layer multiplexing method, which is characterized in that applied in the first process of the first operating system, comprising:
It is instructed in response to hardware operation, first in the corresponding virtual hardware level of abstraction of first operating system is called to apply journey
Sequence interface;
It is communicated by striding course and the call request of the application programming interfaces is sent to the second operating system, so that described second
The second process in operating system is called in the corresponding hardware abstraction layer of second operating system according to the call request
Second application programming interfaces execute the hardware operation instruction;
Wherein, configuration of first application programming interfaces in the virtual hardware level of abstraction connects with second application program
Configuration of the mouth in the hardware abstraction layer has corresponding relationship.
2. the method according to claim 1, wherein first application programming interfaces are taken out in the virtual hardware
As the configuration in layer is identical as configuration of second application programming interfaces in the hardware abstraction layer.
3. the method according to claim 1, wherein the method also includes:
Receive the hardware operation result of second progress feedback.
4. according to the method described in claim 3, it is characterized in that, the hardware operation result includes:
Hardware data, the hardware data are generated by executing the hardware that the hardware operation instructs;Or the hardware data exists
Storage address in shared drive;Or operation failure prompt information;Wherein, the hardware data and the storage address are institutes
It states the second process and transmission is determined whether according to the data volume size of the hardware data;The operation failure prompt information is institute
State what the second process was sent when determining that the hardware is busy.
5. a kind of hardware abstraction layer multiplexer, which is characterized in that applied in the first process of the first operating system, comprising:
Calling module calls the corresponding virtual hardware level of abstraction of first operating system for instructing in response to hardware operation
In the first application programming interfaces;
The call request of first application programming interfaces is sent to the second operation for communicating by striding course by sending module
System, so that the second process in second operating system calls second operating system corresponding according to the call request
Hardware abstraction layer in the second application programming interfaces execute hardware operation instruction;
Wherein, configuration of first application programming interfaces in the virtual hardware level of abstraction connects with second application program
Configuration of the mouth in the hardware abstraction layer has corresponding relationship.
6. a kind of operating system characterized by comprising application framework layer and virtual hardware level of abstraction;
The application framework layer instructs one process of starting in response to hardware operation, and the process is for realizing such as claim
Hardware abstraction layer multiplexing method described in any one of 1 to 3;
It is answered in the configuration of application programming interfaces hardware abstraction layer corresponding with another operating system in the virtual hardware level of abstraction
There is corresponding relationship with the configuration of routine interface.
7. a kind of electronic equipment, which is characterized in that including memory and processor;Wherein,
The memory is for storing one or more computer instruction, wherein one or more computer instruction is by institute
It states when processor executes and realizes hardware abstraction layer multiplexing method as claimed any one in claims 1 to 3.
8. a kind of hardware abstraction layer multiplexing method, which is characterized in that applied in the first process of the first operating system, comprising:
The call request that the second process is sent by striding course communication in the second operating system is received, the call request is described
Second process instructs in response to hardware operation and calls first in the corresponding virtual hardware level of abstraction of second operating system
Application programming interfaces triggering;
The second application programming interfaces in the corresponding hardware abstraction layer of first operating system are called according to the call request,
To execute the hardware operation instruction;
Wherein, configuration of first application programming interfaces in the virtual hardware level of abstraction connects with second application program
Configuration of the mouth in the hardware abstraction layer has corresponding relationship.
9. according to the method described in claim 8, it is characterized in that, described call second operation according to the call request
The second application programming interfaces in the corresponding hardware abstraction layer of system, before executing hardware operation instruction, further includes:
If identifying, second application programming interfaces have exclusive operational attribute, check that the hardware abstraction layer is corresponding hard
The state of part;
If the state indicates that the hardware is in idle condition, second application program is called according to the call request
Interface, to execute the hardware operation instruction;
The state of the hardware is set to busy condition.
10. according to the method described in claim 9, it is characterized in that, the method also includes:
If the state indicates that the hardware is in busy condition, operation failure prompt information is sent to first process.
11. according to the method described in claim 9, it is characterized in that, if described identify the second application programming interfaces tool
There is exclusive operational attribute, then check the state of the corresponding hardware of the hardware abstraction layer, comprising:
If identifying, second application programming interfaces have exclusive operational attribute, and second application programming interfaces are used for
It realizes to the opening operation of the hardware, then checks the state of the hardware.
12. according to the method for claim 11, which is characterized in that the method also includes:
If identifying, second application programming interfaces have exclusive operational attribute, and second application programming interfaces are used for
It realizes to the shutoff operation of the hardware, then the state of the hardware is set to idle state.
13. according to the method described in claim 8, it is characterized in that, the method also includes:
If identifying, second application programming interfaces do not have exclusive operational attribute, according to call request calling
Second application programming interfaces, to execute the hardware operation instruction.
14. the method according to claim 9 or 13, which is characterized in that the method also includes:
Corresponding hardware operation result is instructed to feed back to first process hardware operation.
15. according to the method for claim 14, which is characterized in that described to instruct corresponding hardware to grasp the hardware operation
First process is fed back to as result, comprising:
If the hardware executes the hardware operation instruction and the data volume of the hardware data of generation is less than preset threshold, by institute
Hardware data is stated as the hardware operation result and is sent to first process;
If the data volume of the hardware data is greater than or equal to the preset threshold, the hardware data is stored in shared drive
In, and storage address of the hardware data in the shared drive is sent to first process.
16. according to the method described in claim 9, it is characterized in that, the method also includes:
The inquiry request that third process is sent by striding course communication in second operating system is received, the inquiry request is used
In the state for inquiring the hardware;
The state of the hardware is sent to the third process, so that the third process determines whether to adjust according to the state
With the hardware abstraction layer.
17. a kind of hardware abstraction layer multiplexer, which is characterized in that applied in the first process of the first operating system, comprising:
Receiving module, it is described for receiving the call request that the second process is sent by striding course communication in the second operating system
Call request is that second process instructs in response to hardware operation and calls the corresponding virtual hardware of second operating system
What the first application programming interfaces in level of abstraction triggered;
Calling module, for calling second in the corresponding hardware abstraction layer of second operating system according to the call request
Application programming interfaces, to execute the hardware operation instruction;
Wherein, configuration of first application programming interfaces in the virtual hardware level of abstraction connects with second application program
Configuration of the mouth in the hardware abstraction layer has corresponding relationship.
18. a kind of operating system characterized by comprising
Application framework layer and striding course communication interface, include a process in the application framework layer, and the process is used
In hardware abstraction layer multiplexing method of the realization as described in any one of claim 8 to 16.
19. a kind of electronic equipment, which is characterized in that including memory and processor;Wherein,
The memory is for storing one or more computer instruction, wherein one or more computer instruction is by institute
State the hardware abstraction layer multiplexing method realized as described in any one of claim 8 to 16 when processor executes.
Priority Applications (3)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710953523.1A CN109669782A (en) | 2017-10-13 | 2017-10-13 | Hardware abstraction layer multiplexing method, device, operating system and equipment |
TW107128180A TW201937364A (en) | 2017-10-13 | 2018-08-13 | Hardware abstraction layer multiplexing method and device, operating system and device |
PCT/CN2018/109550 WO2019072182A1 (en) | 2017-10-13 | 2018-10-10 | Hardware abstraction layer multiplexing method and apparatus, operating system and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710953523.1A CN109669782A (en) | 2017-10-13 | 2017-10-13 | Hardware abstraction layer multiplexing method, device, operating system and equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109669782A true CN109669782A (en) | 2019-04-23 |
Family
ID=66100422
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710953523.1A Pending CN109669782A (en) | 2017-10-13 | 2017-10-13 | Hardware abstraction layer multiplexing method, device, operating system and equipment |
Country Status (3)
Country | Link |
---|---|
CN (1) | CN109669782A (en) |
TW (1) | TW201937364A (en) |
WO (1) | WO2019072182A1 (en) |
Cited By (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109669723A (en) * | 2017-10-13 | 2019-04-23 | 阿里巴巴集团控股有限公司 | Hardware access method, apparatus, equipment and machine readable media |
CN110708581A (en) * | 2019-08-27 | 2020-01-17 | 青岛海信电器股份有限公司 | Display device and method for presenting multimedia screen saver information |
CN110933275A (en) * | 2019-12-09 | 2020-03-27 | Oppo广东移动通信有限公司 | Photographing method and related equipment |
CN111225153A (en) * | 2020-01-21 | 2020-06-02 | Oppo广东移动通信有限公司 | Image data processing method, image data processing device and mobile terminal |
CN111614900A (en) * | 2020-05-26 | 2020-09-01 | 上海龙旗科技股份有限公司 | Camera driving method and apparatus |
CN112231017A (en) * | 2020-10-27 | 2021-01-15 | 北京技德系统技术有限公司 | Virtual keyboard and mouse method and device for compatible operation of Android operating system on Linux |
WO2021057351A1 (en) * | 2019-09-24 | 2021-04-01 | 中兴通讯股份有限公司 | Apparatus and method for controlling android bluetooth in glibc environment, and terminal device |
WO2021120092A1 (en) * | 2019-12-19 | 2021-06-24 | Intel Corporation | Hardware based abstraction sharing of hardware devices across computing platforms |
WO2021147282A1 (en) * | 2020-01-20 | 2021-07-29 | 华为技术有限公司 | Method, apparatus and device for detecting malicious file, and storage medium |
CN113379589A (en) * | 2021-07-06 | 2021-09-10 | 湖北亿咖通科技有限公司 | Dual-system graphic processing method and device and terminal |
CN113626224A (en) * | 2021-07-12 | 2021-11-09 | 北京鲸鲮信息系统技术有限公司 | NFC data interaction method and device, electronic equipment and storage medium |
CN113852718A (en) * | 2021-09-26 | 2021-12-28 | 北京鲸鲮信息系统技术有限公司 | Voice channel establishing method and device, electronic equipment and storage medium |
CN114020364A (en) * | 2021-11-16 | 2022-02-08 | 北京鲸鲮信息系统技术有限公司 | Sensor device adapting method and device, electronic device and storage medium |
CN115562765A (en) * | 2022-12-05 | 2023-01-03 | 北京小米移动软件有限公司 | Control method and device of positioning assembly, electronic equipment and storage medium |
CN114020364B (en) * | 2021-11-16 | 2024-04-26 | 北京字节跳动网络技术有限公司 | Sensor device adaptation method, device, electronic device and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060206904A1 (en) * | 2005-03-11 | 2006-09-14 | Microsoft Corporation | Systems and methods for supporting device access from multiple operating systems |
CN105760239A (en) * | 2016-02-03 | 2016-07-13 | 北京元心科技有限公司 | Method and system for accessing third party library for first system in second system |
CN105808320A (en) * | 2016-03-11 | 2016-07-27 | 四川安嵌科技有限公司 | Equipment virtualization system and method based on Linux container |
CN107077377A (en) * | 2016-12-29 | 2017-08-18 | 深圳前海达闼云端智能科技有限公司 | A kind of device virtualization method, device, system and electronic equipment, computer program product |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6763327B1 (en) * | 2000-02-17 | 2004-07-13 | Tensilica, Inc. | Abstraction of configurable processor functionality for operating systems portability |
-
2017
- 2017-10-13 CN CN201710953523.1A patent/CN109669782A/en active Pending
-
2018
- 2018-08-13 TW TW107128180A patent/TW201937364A/en unknown
- 2018-10-10 WO PCT/CN2018/109550 patent/WO2019072182A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060206904A1 (en) * | 2005-03-11 | 2006-09-14 | Microsoft Corporation | Systems and methods for supporting device access from multiple operating systems |
CN105760239A (en) * | 2016-02-03 | 2016-07-13 | 北京元心科技有限公司 | Method and system for accessing third party library for first system in second system |
CN105808320A (en) * | 2016-03-11 | 2016-07-27 | 四川安嵌科技有限公司 | Equipment virtualization system and method based on Linux container |
CN107077377A (en) * | 2016-12-29 | 2017-08-18 | 深圳前海达闼云端智能科技有限公司 | A kind of device virtualization method, device, system and electronic equipment, computer program product |
Cited By (23)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109669723B (en) * | 2017-10-13 | 2023-06-13 | 斑马智行网络(香港)有限公司 | Hardware access method, apparatus, device and machine readable medium |
CN109669723A (en) * | 2017-10-13 | 2019-04-23 | 阿里巴巴集团控股有限公司 | Hardware access method, apparatus, equipment and machine readable media |
CN110708581A (en) * | 2019-08-27 | 2020-01-17 | 青岛海信电器股份有限公司 | Display device and method for presenting multimedia screen saver information |
CN110708581B (en) * | 2019-08-27 | 2021-09-24 | 海信视像科技股份有限公司 | Display device and method for presenting multimedia screen saver information |
WO2021057351A1 (en) * | 2019-09-24 | 2021-04-01 | 中兴通讯股份有限公司 | Apparatus and method for controlling android bluetooth in glibc environment, and terminal device |
CN110933275B (en) * | 2019-12-09 | 2021-07-23 | Oppo广东移动通信有限公司 | Photographing method and related equipment |
CN110933275A (en) * | 2019-12-09 | 2020-03-27 | Oppo广东移动通信有限公司 | Photographing method and related equipment |
WO2021120092A1 (en) * | 2019-12-19 | 2021-06-24 | Intel Corporation | Hardware based abstraction sharing of hardware devices across computing platforms |
WO2021147282A1 (en) * | 2020-01-20 | 2021-07-29 | 华为技术有限公司 | Method, apparatus and device for detecting malicious file, and storage medium |
CN111225153B (en) * | 2020-01-21 | 2021-08-06 | Oppo广东移动通信有限公司 | Image data processing method, image data processing device and mobile terminal |
CN111225153A (en) * | 2020-01-21 | 2020-06-02 | Oppo广东移动通信有限公司 | Image data processing method, image data processing device and mobile terminal |
CN111614900B (en) * | 2020-05-26 | 2022-07-15 | 上海龙旗科技股份有限公司 | Camera driving method and apparatus |
CN111614900A (en) * | 2020-05-26 | 2020-09-01 | 上海龙旗科技股份有限公司 | Camera driving method and apparatus |
CN112231017A (en) * | 2020-10-27 | 2021-01-15 | 北京技德系统技术有限公司 | Virtual keyboard and mouse method and device for compatible operation of Android operating system on Linux |
CN113379589A (en) * | 2021-07-06 | 2021-09-10 | 湖北亿咖通科技有限公司 | Dual-system graphic processing method and device and terminal |
CN113626224A (en) * | 2021-07-12 | 2021-11-09 | 北京鲸鲮信息系统技术有限公司 | NFC data interaction method and device, electronic equipment and storage medium |
CN113626224B (en) * | 2021-07-12 | 2024-03-19 | 北京字节跳动网络技术有限公司 | NFC data interaction method and device, electronic equipment and storage medium |
CN113852718A (en) * | 2021-09-26 | 2021-12-28 | 北京鲸鲮信息系统技术有限公司 | Voice channel establishing method and device, electronic equipment and storage medium |
CN113852718B (en) * | 2021-09-26 | 2022-11-15 | 北京字节跳动网络技术有限公司 | Voice channel establishing method and device, electronic equipment and storage medium |
WO2023045510A1 (en) * | 2021-09-26 | 2023-03-30 | 北京字节跳动网络技术有限公司 | Method and apparatus for establishing voice channel, electronic device, and storage medium |
CN114020364A (en) * | 2021-11-16 | 2022-02-08 | 北京鲸鲮信息系统技术有限公司 | Sensor device adapting method and device, electronic device and storage medium |
CN114020364B (en) * | 2021-11-16 | 2024-04-26 | 北京字节跳动网络技术有限公司 | Sensor device adaptation method, device, electronic device and storage medium |
CN115562765A (en) * | 2022-12-05 | 2023-01-03 | 北京小米移动软件有限公司 | Control method and device of positioning assembly, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
WO2019072182A1 (en) | 2019-04-18 |
TW201937364A (en) | 2019-09-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109669782A (en) | Hardware abstraction layer multiplexing method, device, operating system and equipment | |
US10567397B2 (en) | Security-based container scheduling | |
CN104765678B (en) | The method and device tested the application on mobile terminal device | |
CN103559150B (en) | The implementation method of main frame external camera and device and mobile terminal | |
CN104978261B (en) | The test method of application program, apparatus and system | |
TWI301365B (en) | ||
CN104767655B (en) | A kind of analog result detection method and device | |
CN110213121B (en) | Test platform, test method and test device for virtual communication product | |
CN107209694A (en) | Method for controlling on-demand service to supply | |
CN107390832A (en) | Server system and cooling means | |
CN109032746A (en) | A kind of display interface customizing method, system and the electronic equipment of wearable device | |
WO2019057089A1 (en) | Network card image packet capture method, terminal, and readable storage medium | |
CN101820359B (en) | Fault processing method and equipment for network equipment | |
US20140040441A1 (en) | System and method for the configuration of a clustered simulation network | |
WO2017222595A3 (en) | Device and method for nfv life cycle management | |
CN111049686A (en) | Safety protection virtual laboratory of power monitoring system and construction method thereof | |
CN104735176A (en) | PXE booting method and device and server single board | |
CN112187671A (en) | Network access method and related equipment thereof | |
CN105915387A (en) | External network bandwidth speed limiting method, device and system of cloud host in IaaS cloud platform | |
CN107343158A (en) | Accelerate the convergent method and devices of AEC, terminal device | |
JP6195465B2 (en) | Remote card content management using synchronous server-side scripting | |
CN110928554A (en) | Deployment method, device, equipment and storage medium | |
CN110224897A (en) | Vulnerable network test method, device, mobile device and the storage medium of application program | |
CN112799970B (en) | Test data processing method, device, electronic equipment and medium | |
CN109858257A (en) | Access control method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
TA01 | Transfer of patent application right | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20201210 Address after: Room 603, 6 / F, Roche Plaza, 788 Cheung Sha Wan Road, Kowloon, China Applicant after: Zebra smart travel network (Hong Kong) Ltd. Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands Applicant before: Alibaba Group Holding Ltd. |
|
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190423 |