Hardware using method and device, storage medium and electronic equipment

By introducing multiplexing selection mechanism and permission configuration information into the terminal device, the problem that terminal devices can only support a single operating system application in the prior art is solved, and the coexistence and hardware allocation of multiple operating system applications are realized, improving the user experience.

CN119690633APending Publication Date: 2025-03-25BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311245707.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-25
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

In the prior art, terminal devices using a certain operating system can only support the operation of applications developed based on the operating system, and cannot support the operation of applications developed based on other operating systems at the same time. This results in users who need to use applications developed by different operating systems at the same time need to carry multiple terminal devices, which has a poor user experience.

Method used

By introducing a multiplexed selection mechanism, a hardware allocation mechanism based on permission configuration information is implemented in the terminal device, allowing applications developed based on different operating systems to use the hardware on the terminal device, including cameras, audio, screens, etc.

Benefits of technology

The terminal device using the first operating system supports the operation of applications developed based on the second operating system, allowing users to use applications developed by different operating systems on one terminal device at the same time, improving the user's user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119690633A_ABST
    Figure CN119690633A_ABST
Patent Text Reader

Abstract

The invention provides a hardware use method and device, a storage medium and electronic equipment, and the method comprises the steps: responding to a received request message which is sent by a first application program and is used for requesting to use first hardware, and determining whether the first application program has the permission to use the first hardware or not based on preset permission configuration information. Wherein the permission configuration information comprises a mapping relation between the first application program and available hardware. And in response to determining that the first application program has the use permission, allocating the first hardware to the first application program. Through the hardware use method provided by the embodiment of the invention, the first terminal equipment using the first operating system can support the running of the first application program developed based on the second operating system, a user is supported to use the application programs developed based on different operating systems on one terminal equipment at the same time, and the use experience of the user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The technical solution disclosed herein relates to the field of computer technology, and in particular to a hardware use method and device, a storage medium, and an electronic device. Background Art

[0002] In the related art, a terminal device using a certain operating system can only support the operation of applications developed based on the operating system, and cannot simultaneously support the operation of applications developed based on other operating systems. When a user needs to use applications developed based on different operating systems at the same time, he or she can only carry multiple terminal devices using different operating systems to operate them separately, which results in a poor user experience. Summary of the invention

[0003] In view of this, embodiments of the present disclosure provide a hardware use method and device, a storage medium, and an electronic device.

[0004] According to a first aspect of the present disclosure, a hardware use method is proposed, the method comprising:

[0005] In response to receiving a request message sent by the first application to use the first hardware, determining whether the first application has permission to use the first hardware based on preset permission configuration information; the first hardware is hardware on the first terminal device, and the permission configuration information includes a mapping relationship between the first application and the usable hardware;

[0006] In response to determining that the first application has the usage permission, the first hardware is allocated to the first application.

[0007] In combination with any implementation manner provided in the present disclosure, the determining whether the first application has permission to use the first hardware based on preset permission configuration information includes:

[0008] When it is determined that the first hardware is the preset target hardware, an inquiry prompt message is output; the inquiry prompt message is used to inquire the user whether to allow the first application to use the first hardware;

[0009] Based on a received user selection message in response to the inquiry prompt message, it is determined whether the first application has permission to use the first hardware.

[0010] In combination with any embodiment provided in the present disclosure, the method further includes:

[0011] In response to determining that whether the first application is allowed to use the first hardware as indicated by the user's selection message is inconsistent with the information stored in the permission configuration information, the permission configuration information is updated based on the user's selection message.

[0012] In combination with any embodiment provided in the present disclosure, the method further includes:

[0013] In response to detecting that the query prompt message is output a preset number of times within a preset time period, determining whether the first application has permission to use the first hardware based on the permission configuration information.

[0014] In combination with any implementation manner provided in the present disclosure, in response to receiving a request message sent by the first application to request to use the first hardware, before determining whether the first application has permission to use the first hardware based on preset permission configuration information, the method further includes:

[0015] receiving a hardware configuration description file of the first hardware and a program configuration description file of the first application; the hardware configuration description file includes hardware information of the first hardware, and the program configuration description file includes hardware information of hardware that can be used by the first application;

[0016] The permission configuration information is generated based on the hardware configuration description file and the program configuration description file.

[0017] In combination with any implementation manner provided in the present disclosure, the first terminal device is connected to a second terminal device, and the second terminal device also has the first hardware, and the first hardware includes a screen and / or a speaker;

[0018] Allocating the first hardware to the first application comprises:

[0019] In response to determining that the first hardware of the first terminal device is in a busy state, the first hardware of the second terminal device is allocated to the first application.

[0020] In combination with any implementation manner provided in the present disclosure, a second application developed based on the first operating system is also installed on the first terminal device;

[0021] Allocating the first hardware to the first application comprises:

[0022] In response to receiving a request message for using the first hardware sent by the second application program at the same time as receiving the request message sent by the first application program, determining whether the second application program has permission to use the first hardware based on the permission configuration information;

[0023] In response to determining that the second application also has the use permission, determining the application where the touch point is located on the screen of the first terminal device;

[0024] When it is determined that the application where the touch point is located is the first application, allocating the first hardware to the first application;

[0025] When it is determined that the application where the touch point is located is the second application, the first hardware is allocated to the second application.

[0026] According to a second aspect of the present disclosure, a hardware using device is provided, the device comprising:

[0027] A first permission determination module, configured to determine, in response to receiving a request message sent by the first application to use the first hardware, whether the first application has permission to use the first hardware based on preset permission configuration information; the first hardware is hardware on the first terminal device, and the permission configuration information includes a mapping relationship between the first application and the usable hardware;

[0028] The hardware allocation module is used to allocate the first hardware to the first application in response to determining that the first application has the use permission.

[0029] According to a third aspect of the present disclosure, a computer-readable storage medium is provided, wherein the machine-readable storage medium stores machine-readable instructions, and when the machine-readable instructions are called and executed by a processor, the processor is prompted to implement the hardware usage device of any embodiment of the present disclosure.

[0030] According to a fourth aspect of the present disclosure, there is provided an electronic device, comprising:

[0031] processor;

[0032] a memory for storing processor-executable instructions;

[0033] The processor is configured as a hardware usage device for executing any embodiment of the present disclosure.

[0034] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:

[0035] The hardware usage method and apparatus, storage medium, and electronic device provided in the embodiments of the present disclosure can determine whether a first application developed based on a second operating system has permission to use the first hardware based on preset permission configuration information when a first terminal device using a first operating system receives a request message from the first application developed based on a second operating system to use the first hardware. When it is determined that the first application has the permission to use the first hardware, the first hardware is allocated to the first application. The hardware usage method provided in the embodiments of the present disclosure can enable a first terminal device using a first operating system to support the operation of a first application developed based on a second operating system, and support users to use applications developed based on different operating systems on a single terminal device, thereby improving the user experience.

[0036] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0038] Figure 1 is a flowchart of a method for using hardware according to an exemplary embodiment of the present disclosure;

[0039] Figure 2 is a flow chart of another method for using hardware according to an exemplary embodiment of the present disclosure;

[0040] Figure 3 is a flow chart of another method for using hardware according to an exemplary embodiment of the present disclosure;

[0041] Figure 4 is a structural diagram of a hardware using device according to an exemplary embodiment of the present disclosure;

[0042] Figure 5 It is a schematic structural diagram of an electronic device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0043] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0044] The terms used in this disclosure are for the purpose of describing specific embodiments only and are not intended to limit the disclosure. The singular forms of "a", "said" and "the" used in this disclosure and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0045] It should be understood that although the terms first, second, third, etc. may be used in the present disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present disclosure, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0046] In the related art, a terminal device using a certain operating system can only support the operation of applications developed based on the operating system, and cannot simultaneously support the operation of applications developed based on other operating systems. When a user needs to use applications developed based on different operating systems at the same time, he or she can only carry multiple terminal devices using different operating systems to operate them separately, which results in a poor user experience.

[0047] In view of this, an embodiment of the present disclosure provides a method for using hardware. In the method, a multiplexing selection mechanism can be introduced into a terminal device, and through the multiplexing selection mechanism, a first terminal device using a first operating system can simultaneously support the operation of an application developed based on the first operating system and an application developed based on the second operating system. The following is a detailed description of the method for using hardware in an embodiment of the present disclosure in conjunction with the accompanying drawings.

[0048] Figure 1 The present disclosure is a flowchart of a method for using hardware according to an exemplary embodiment. The method can be executed by a first terminal device using a first operating system, and a first application developed based on a second operating system is installed on the first terminal device. Specifically, the first terminal device introduces the above-mentioned multiplexing mechanism, and the first terminal device can execute the following based on the multiplexing mechanism: Figure 1 Steps shown.

[0049] In step 101, in response to receiving a request message sent by the first application to use the first hardware, it is determined based on preset permission configuration information whether the first application has permission to use the first hardware.

[0050] The first hardware is the hardware on the first terminal device, for example, the first hardware may be: a camera, a speaker, a screen, a processor, a sensor, etc. The permission configuration information includes a mapping relationship between the first application and the usable hardware, for example, the first application may be WeChat, and in the permission configuration information, the hardware that WeChat can use includes: a camera, a screen, a processor, a sensor, etc.

[0051] When a first terminal device using a first operating system receives a request message from a first application developed based on a second operating system (for example, WeChat mentioned above) requesting the use of first hardware (for example, the screen mentioned above), it can determine whether WeChat has permission to use the screen based on preset permission configuration information.

[0052] In step 102, in response to determining that the first application has the use permission, the first hardware is allocated to the first application.

[0053] When the first terminal device using the first operating system determines that WeChat has the right to use the screen, the first terminal device can allocate the screen to WeChat for use.

[0054] In the hardware usage method provided in the embodiment of the present disclosure, a multiplexing mechanism can be introduced in the first terminal device using the first operating system. Based on the multiplexing mechanism, when the first terminal device receives a request message from a first application developed based on the second operating system requesting to use the first hardware, the first terminal device can determine whether the first application has the right to use the first hardware based on the preset permission configuration information. When it is determined that the first application has the right to use, the first hardware is allocated to the first application. Through the hardware usage method provided in the embodiment of the present disclosure, the first terminal device using the first operating system can support the operation of the first application developed based on the second operating system, support users to use applications developed based on different operating systems on one terminal device at the same time, and improve the user experience.

[0055] In one embodiment, the above preset permission configuration information can be obtained based on the following method:

[0056] A hardware configuration description file of the first hardware and a program configuration description file of the first application are received, and then, based on the hardware configuration description file and the program configuration description file, the permission configuration information is generated.

[0057] The hardware configuration description file includes hardware information of the first hardware, and the program configuration description file includes hardware information of hardware that can be used by the first application program.

[0058] Taking the above-mentioned first hardware as a screen and the first application as WeChat as an example, the hardware configuration description file includes information about the screen, such as: screen resolution, screen length and width, etc. The program configuration description file includes hardware information of the hardware that WeChat can use, such as: camera, screen, processor, sensor.

[0059] Based on the above hardware configuration description file and program configuration description file, it can be known that WeChat can use the screen and the first terminal device also has a screen. Therefore, when the above permission configuration information is compiled, the permission configuration information can include the mapping relationship between WeChat and the screen.

[0060] In the permission configuration information, the mapping relationship between the first application and other hardware, as well as the mapping relationship between other applications and various hardware can be obtained based on the above method. For details, please refer to the above description and will not be repeated here.

[0061] Optionally, when the first terminal device is powered on for the first time, the first terminal device may automatically load the compiled permission configuration information to the first terminal device for subsequent use.

[0062] In one embodiment, if Figure 2 As shown, the above step 101 may be specifically as follows:

[0063] In step 101 - 1 , when it is determined that the first hardware is the preset target hardware, an inquiry prompt message is output.

[0064] The target hardware may be part of the hardware preset by the user, or may be hardware related to user privacy, such as a camera, a microphone, etc. The inquiry prompt message is used to inquire the user whether to allow the first application to use the first hardware.

[0065] Taking the first hardware as a camera as an example, when the first terminal device determines that the first hardware is a camera based on the introduced multiplexing mechanism and belongs to the preset target hardware, it can output the above-mentioned inquiry prompt message to ask the user whether to allow the above-mentioned first application to use the camera.

[0066] For example, the above inquiry prompt message may be outputted by voice, specifically, "Do you allow the first application to use the camera?" may be outputted by voice. Alternatively, the above inquiry prompt message may be outputted in a pop-up box, for example, "Do you allow the first application to use the camera?" may be displayed at the top of the pop-up box, and two options of "yes" and "no" may be provided at the bottom of the pop-up box for the user to choose.

[0067] In step 101 - 2 , based on a received user selection message for the inquiry prompt message, it is determined whether the first application has permission to use the first hardware.

[0068] When the user is asked in the form of voice output, the first terminal device may open the microphone to receive the voice selection message input by the user within a certain period of time after the voice message is output. Alternatively, similar to the output of the inquiry prompt message in a pop-up box, while the inquiry prompt message is output in voice, two options of "yes" and "no" are given on the screen of the first terminal device in the form of a pop-up box for the user to choose. At this time, the user's selection message for the inquiry prompt message can be received based on the pop-up box.

[0069] When the user selects the query prompt message yes, it can be determined that the first application has the permission to use the first hardware. When the user selects the query prompt message no, it can be determined that the first application does not have the permission to use the first hardware.

[0070] In the hardware usage method provided in the embodiment of the present disclosure, security control can be added to the multiplexing selection mechanism, that is, when the first application wants to use part of the hardware pre-set by the user, or wants to use hardware related to the user's privacy, the corresponding request message is intercepted based on the multiplexing selection mechanism, and the user is asked whether to allow the first application to use the hardware. Through this hardware usage method, hardware resources can be fully used based on the user's wishes, providing users with a better user experience while improving the security of user use.

[0071] In one embodiment, after receiving a user's selection message for the output query prompt message, the first terminal device may determine whether the selection message indicating whether the first application is allowed to use the first hardware is consistent with the permission configuration information stored in the permission configuration information. If not, the permission configuration information is updated based on the user's selection message.

[0072] For example, the query prompt message outputted may be: Is WeChat allowed to use the camera? The received user selection message is yes. At this point, it can be further determined in the permission configuration information whether there is a camera in the hardware that WeChat can use. If not, a camera can be added to the hardware that WeChat can use.

[0073] For another example, the query prompt message outputted may be: Do you allow WeChat to use the microphone? The received user selection message is no. At this point, it can be further determined in the permission configuration information whether there is a microphone in the hardware that WeChat can use. If so, the microphone can be deleted.

[0074] In the hardware usage method provided by the embodiment of the present disclosure, the first terminal device can update the preset permission configuration information in real time based on the user's selection message, fully respect the user's wishes, and bring a better usage experience to the user.

[0075] In one embodiment, in order to avoid excessively disturbing the user while accurately obtaining the user's intention, the first terminal device may no longer output the inquiry prompt message to inquire the user when it detects that the number of times the inquiry prompt message is output within a preset time period reaches a preset number of times, but instead directly determines whether the first application has permission to use the first hardware based on the permission configuration information.

[0076] For example, after detecting the restart, the first terminal device can output the inquiry prompt message, that is, when the number of times the first terminal device is asked whether to use the first hardware reaches 3 times, it will no longer ask the user to output the inquiry prompt message, but directly determine whether it has the permission to use based on the permission configuration information.

[0077] In the hardware usage method provided by the embodiment of the present disclosure, the first terminal device can stop asking the user when it detects that the number of times a certain inquiry prompt message is outputted reaches a preset number of times within a preset time period, for example, when it reaches 3 times. Compared with not asking the user again when it reaches 1 time, it can avoid the situation where the user's intention is incorrectly received due to the user's accidental touch. At the same time, when the preset number of times is reached, the user will no longer be asked, but whether the corresponding use permission is directly determined based on the permission configuration information, which can avoid excessively disturbing the user and improve the user's use experience.

[0078] In one embodiment, a second application developed based on the first operating system is also installed on the first terminal device. Exemplarily, when the first terminal device is in a split-screen state, the first application and the second application are both running in the foreground of the first terminal device, and the first terminal device simultaneously receives request messages from the first application and the second application requesting to use the first hardware, and determines that both the first application and the second application have permission to use the first hardware, the first terminal device may, based on the following example, Figure 3 The steps shown determine the allocation of the first hardware:

[0079] In step 301, the application program at which the touch point on the screen of the first terminal device is located is determined.

[0080] The touch point is formed by the user's finger touching the screen.

[0081] In step 302, when it is determined that the application where the touch point is located is the first application, the first hardware is allocated to the first application.

[0082] In step 303, when it is determined that the application where the touch point is located is the second application, the first hardware is allocated to the second application.

[0083] In the hardware use method provided by the embodiment of the present disclosure, when the first terminal device simultaneously receives use requests for the same hardware from two applications developed based on different operating systems, the first terminal device can determine the allocation of the first hardware based on the position of the touch point on the screen. This prevents conflicts when applications developed based on different operating systems simultaneously request to use the first hardware, and enables the applications developed based on different operating systems to collaborate.

[0084] In one embodiment, the first terminal device and the second terminal device may be connected via Bluetooth or WiFi (Wireless Fidelity). The second terminal device also has the first hardware, which includes a screen and / or a speaker.

[0085] For example, the first terminal device is a smartphone, the second terminal device is a smart TV, and the first hardware is a speaker. When the smartphone is playing music and receives a request message from a video application to use the speaker, since the speaker of the current smartphone is busy, the speaker of the smart TV connected to the smartphone can be assigned to the video application. In other words, the smartphone can send the corresponding audio resource to the smart TV through the connection established with the smart TV, so that the speaker of the smart TV plays the audio resource.

[0086] Exemplarily, take the first terminal device as a smartphone, the second terminal device as a tablet computer, and the first hardware as a screen. When the smartphone is playing a TV series and receives a request message from a video application to use the screen, since the current smartphone screen is busy, the screen of the tablet computer connected to the smartphone can be allocated to the video application. Similar to the above, the smartphone can send the corresponding video resource to the tablet computer through the connection established with the tablet computer, so that the tablet computer screen plays the video resource.

[0087] It should be noted that the above description is based on the example that the terminal device is a smart phone, a smart TV, or a tablet computer, and the first hardware is a screen or a speaker. In actual applications, the terminal device may also be other devices, and the first hardware may also be other hardware, which can be set by relevant staff based on actual conditions, and this disclosure does not limit this.

[0088] In the hardware usage method provided by the embodiment of the present disclosure, based on the introduced multiplexing mechanism, the first terminal device can determine whether there is a second terminal device connected to the first terminal device when receiving a request message sent by the first application to request the use of the first hardware and determining that the first hardware of the first terminal device is currently busy. When it is determined that there is, and the second terminal device also has the first hardware, the first hardware of the second terminal device is allocated to the first application. In other words, in the hardware usage method of this example, the hardware resources on other terminal devices can be managed by the first terminal device, which is highly practical.

[0089] For the aforementioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should know that the present disclosure is not limited by the described order of actions, because according to the present disclosure, certain steps can be performed in other orders or simultaneously.

[0090] Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present disclosure.

[0091] Corresponding to the aforementioned application function implementation method embodiment, the present disclosure also provides an application function implementation device and a corresponding terminal embodiment.

[0092] Figure 4 1 is a schematic diagram of a hardware device according to an exemplary embodiment of the present disclosure, wherein the device is applied to a first terminal device using a first operating system, and a first application developed based on a second operating system is installed on the first terminal device. Figure 4 As shown, the hardware using device may include:

[0093] The first permission determination module 41 is used to determine whether the first application has permission to use the first hardware in response to receiving a request message sent by the first application to use the first hardware, based on preset permission configuration information; the first hardware is the hardware on the first terminal device, and the permission configuration information includes a mapping relationship between the first application and the usable hardware.

[0094] The hardware allocation module 42 is configured to allocate the first hardware to the first application in response to determining that the first application has the usage permission.

[0095] Optionally, the first permission determination module 41, when used to determine whether the first application has permission to use the first hardware based on preset permission configuration information, includes:

[0096] When it is determined that the first hardware is the preset target hardware, an inquiry prompt message is output; the inquiry prompt message is used to inquire the user whether to allow the first application to use the first hardware.

[0097] Based on a received user selection message in response to the inquiry prompt message, it is determined whether the first application has permission to use the first hardware.

[0098] Optional, in Figure 4 Based on the modules shown, the hardware using device may further include:

[0099] An updating module is used for updating the permission configuration information based on the user's selection message in response to determining that whether the first application is allowed to use the first hardware indicated by the user's selection message is inconsistent with the permission configuration information stored in the permission configuration information.

[0100] Optional, in Figure 4 Based on the modules shown, the hardware using device may further include:

[0101] The second permission determination module is used to determine whether the first application has permission to use the first hardware based on the permission configuration information in response to detecting that the number of times the inquiry prompt message is outputted reaches a preset number of times within a preset time period.

[0102] Optional, in Figure 4 Based on the modules shown, the hardware using device may further include:

[0103] A receiving module is used to receive a hardware configuration description file of the first hardware and a program configuration description file of the first application; the hardware configuration description file includes hardware information of the first hardware, and the program configuration description file includes hardware information of hardware that can be used by the first application.

[0104] A generating module is used to generate the permission configuration information based on the hardware configuration description file and the program configuration description file.

[0105] Optionally, the first terminal device is connected to a second terminal device, and the second terminal device also has the first hardware, and the first hardware includes a screen and / or a speaker.

[0106] The hardware allocation module 42, when used to allocate the first hardware to the first application, includes:

[0107] In response to determining that the first hardware of the first terminal device is in a busy state, the first hardware of the second terminal device is allocated to the first application.

[0108] Optionally, a second application developed based on the first operating system is also installed on the first terminal device.

[0109] The hardware allocation module 42, when used to allocate the first hardware to the first application, includes:

[0110] In response to receiving a request message for using the first hardware sent by the second application at the same time as receiving a request message sent by the first application, determining whether the second application has permission to use the first hardware based on the permission configuration information.

[0111] In response to determining that the second application also has the use permission, the application on the screen of the first terminal device where the touch point is located is determined.

[0112] When it is determined that the application where the touch point is located is the first application, the first hardware is allocated to the first application.

[0113] When it is determined that the application where the touch point is located is the second application, the first hardware is allocated to the second application.

[0114] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can refer to the partial description of the method embodiments. The device embodiments described above are only schematic, wherein the units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the disclosed solution. A person of ordinary skill in the art may understand and implement it without creative work.

[0115] Figure 5 1 is a schematic diagram showing the structure of an electronic device 500 according to an exemplary embodiment. For example, the electronic device 500 may be a terminal device, and may specifically be a smart phone, a tablet computer, and the like.

[0116] Reference Figure 5 , the electronic device 500 may include one or more of the following components: a processing component 502 , a memory 504 , a power component 506 , a multimedia component 508 , an audio component 510 , an input / output (I / O) interface 512 , a sensor component 514 , and a communication component 516 .

[0117] The processing component 502 generally controls the overall operation of the electronic device 500, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 502 may include one or more processors 520 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 502 may include one or more modules to facilitate the interaction between the processing component 502 and other components. For example, the processing component 502 may include a multimedia module to facilitate the interaction between the multimedia component 508 and the processing component 502.

[0118] The memory 504 is configured to store various types of data to support operations on the device 500. Examples of such data include instructions for any application or method operating on the electronic device 500, contact data, phone book data, messages, pictures, videos, etc. The memory 504 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0119] The power supply component 506 provides power to the various components of the electronic device 500. The power supply component 506 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 500.

[0120] The multimedia component 508 includes a screen that provides an output interface between the electronic device 500 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 508 includes a front camera and / or a rear camera. When the electronic device 500 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0121] The audio component 510 is configured to output and / or input audio signals. For example, the audio component 510 includes a microphone (MIC), and when the electronic device 500 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 504 or sent via the communication component 516. In some embodiments, the audio component 510 also includes a speaker for outputting audio signals.

[0122] I / O interface 512 provides an interface between processing component 502 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0123] The sensor assembly 514 includes one or more sensors for providing various aspects of status assessment for the electronic device 500. For example, the sensor assembly 514 can detect the open / closed state of the electronic device 500, the relative positioning of the components, such as the display and keypad of the electronic device 500, and the sensor assembly 514 can also detect the position change of the electronic device 500 or a component of the electronic device 500, the presence or absence of contact between the user and the electronic device 500, the orientation or acceleration / deceleration of the electronic device 500, and the temperature change of the electronic device 500. The sensor assembly 514 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 514 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 514 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0124] The communication component 516 is configured to facilitate wired or wireless communication between the electronic device 500 and other devices. The electronic device 500 can access a wireless network based on a communication standard, such as WiFi, 4G or 5G, 4G LTE, 5G NR or a combination thereof. In an exemplary embodiment, the communication component 516 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 516 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0125] In an exemplary embodiment, the electronic device 500 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.

[0126] In an exemplary embodiment, a non-temporary computer-readable storage medium is also provided, such as a memory 504 including instructions. When the instructions in the storage medium are executed by a processor 520 of an electronic device 500, the electronic device 500 is enabled to execute the hardware usage method of any embodiment of the present disclosure.

[0127] The non-transitory computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.

[0128] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0129] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A method for using hardware, characterized in that: The method is applied to a first terminal device using a first operating system; A first application developed based on a second operating system is installed on the first terminal device, and the method includes: In response to receiving a request message sent by the first application to use the first hardware, determining whether the first application has permission to use the first hardware based on preset permission configuration information; the first hardware is hardware on the first terminal device, and the permission configuration information includes a mapping relationship between the first application and the usable hardware; In response to determining that the first application has the usage permission, the first hardware is allocated to the first application.

2. The method according to claim 1, characterized in that: The determining, based on preset permission configuration information, whether the first application has permission to use the first hardware includes: When it is determined that the first hardware is the preset target hardware, an inquiry prompt message is output; the inquiry prompt message is used to inquire the user whether to allow the first application to use the first hardware; Based on a received user selection message in response to the inquiry prompt message, it is determined whether the first application has permission to use the first hardware.

3. The method according to claim 2, characterized in that The method further comprises: In response to determining that whether the first application is allowed to use the first hardware as indicated by the user's selection message is inconsistent with the information stored in the permission configuration information, the permission configuration information is updated based on the user's selection message.

4. The method according to claim 2, characterized in that: The method further comprises: In response to detecting that the query prompt message is output a preset number of times within a preset time period, determining whether the first application has permission to use the first hardware based on the permission configuration information.

5. The method according to claim 1, characterized in that: Before determining, in response to receiving a request message sent by the first application program to use the first hardware, whether the first application program has permission to use the first hardware based on preset permission configuration information, the method further includes: receiving a hardware configuration description file of the first hardware and a program configuration description file of the first application; the hardware configuration description file includes hardware information of the first hardware, and the program configuration description file includes hardware information of hardware that can be used by the first application; The permission configuration information is generated based on the hardware configuration description file and the program configuration description file.

6. The method according to claim 1, characterized in that The first terminal device is connected to a second terminal device, and the second terminal device also has the first hardware, and the first hardware includes a screen and / or a speaker; Allocating the first hardware to the first application comprises: In response to determining that the first hardware of the first terminal device is in a busy state, the first hardware of the second terminal device is allocated to the first application.

7. The method according to claim 1, characterized in that A second application developed based on the first operating system is also installed on the first terminal device; Allocating the first hardware to the first application comprises: In response to receiving a request message for using the first hardware sent by the second application program at the same time as receiving the request message sent by the first application program, determining whether the second application program has permission to use the first hardware based on the permission configuration information; In response to determining that the second application also has the use permission, determining the application where the touch point is located on the screen of the first terminal device; When it is determined that the application where the touch point is located is the first application, allocating the first hardware to the first application; When it is determined that the application where the touch point is located is the second application, the first hardware is allocated to the second application.

8. A hardware using device, characterized in that: The device is applied to a first terminal device using a first operating system; A first application developed based on a second operating system is installed on the first terminal device, and the apparatus includes: A first permission determination module, configured to determine, in response to receiving a request message sent by the first application to use the first hardware, whether the first application has permission to use the first hardware based on preset permission configuration information; the first hardware is hardware on the first terminal device, and the permission configuration information includes a mapping relationship between the first application and the usable hardware; The hardware allocation module is used to allocate the first hardware to the first application in response to determining that the first application has the use permission.

9. A computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

10. An electronic device comprising: processor; a memory for storing processor-executable instructions; The processor is configured to execute the steps of any one of the methods of claims 1-7.

Citation Information

Patent Citations

  • Method and apparatus for sharing hardware device by multiple applications

    CN106293925A

  • Application cross-system running method and apparatus

    CN106371826A