Disclosure of Invention
In order to overcome the above technical problems or at least partially solve the above technical problems, the following technical solutions are proposed:
one embodiment of the present invention provides a method for using an Mtp function by multiple systems, including:
the first subsystem sends an Mtp resource application request message to a multi-system control service in the master control system;
the multi-system control service in the master control system detects whether the Mtp resource is occupied by other subsystems;
if the Mtp resources are not occupied by other subsystems, the multi-system control service in the master control system sends an activation permission request message to the Mtp function hardware equipment node of the kernel;
and the Mtp functional hardware equipment node of the kernel activates the Mtp resource control authority of the first subsystem according to the activation authority request message.
Optionally, after the step of activating the http resource control authority of the first subsystem by the mp functional hardware device node of the kernel according to the activation authority request message, the method further includes:
and the multi-system control service in the main control system respectively sends first notification messages to other subsystems, and the first notification messages are used for notifying the other subsystems that Mtp resources are occupied.
Optionally, the method further comprises:
when the first subsystem does not need to use the Mtp resource, the first subsystem sends an Mtp resource cancellation message to a multi-system control service of the master control system;
the multi-system control service of the master control system sends a permission canceling request message to an Mtp functional hardware equipment node of the kernel;
and the Mtp functional hardware equipment node of the kernel cancels the Mtp resource control authority of the first subsystem according to the authority canceling request message.
Optionally, after the step of canceling the http resource control authority of the first subsystem by the mp functional hardware device node of the kernel according to the cancel authority request message, the method further includes:
and the multi-system control service of the main control system sends a second notification message to other subsystems, wherein the second notification message is used for notifying other subsystems that the current Mtp resources are idle, so that the other subsystems can apply for occupying the Mtp resources.
Optionally, the system identifier of the first subsystem is carried in the activation permission request message;
the step that the Mtp function hardware equipment node of the kernel activates the Mtp resource control authority of the first subsystem according to the activation authority request message comprises the following steps:
and the Mtp function hardware equipment node of the kernel activates the Mtp resource control authority of the first subsystem according to the system identification of the first subsystem in the activation authority request message.
The invention provides a device for using an Mtp function by multiple systems, which comprises:
the sending module is positioned in the first subsystem and used for sending an Mtp resource application request message to the multi-system control service in the main control system;
the multi-system control module is positioned in the main control system and used for detecting whether the Mtp resources are occupied by other subsystems; when the Mtp resources are not occupied by other subsystems, sending an activation permission request message to an Mtp function hardware equipment node of the kernel;
and the activation module is positioned in the Mtp function hardware equipment node of the kernel and used for activating the Mtp resource control authority of the first subsystem according to the activation authority request message sent by the multi-system control module.
Optionally, the multi-system control module is further configured to send a first notification message to other subsystems respectively, where the first notification message is used to notify other subsystems that the resource of the Mtp is occupied.
Optionally, the sending module is further configured to send an http resource cancellation message to a multi-system control service of the main control system when the first subsystem does not need to use the http resource;
the multi-system control module is also used for sending a permission canceling request message to an Mtp function hardware equipment node of the kernel;
the device still includes: a cancellation module;
and the cancelling module is positioned in the Mtp function hardware equipment node of the kernel and used for cancelling the Mtp resource control authority of the first subsystem according to the permission cancelling request message sent by the multi-system control module.
Optionally, the multi-system control module is further configured to send a second notification message to the other subsystems, where the second notification message is used to notify the other subsystems that the current Mtp resource is idle, so that the other subsystems can apply for occupying the Mtp resource.
Specifically, the system identifier of the first subsystem is carried in the activation permission request message;
and the activation module is specifically used for activating the Mtp resource control authority of the first subsystem according to the system identifier of the first subsystem in the activation authority request message.
Compared with the method and the device for using the Mtp function by multiple systems, any system of the mobile terminal can send an Mtp resource request message to a multi-system control service in a main control system, and after detecting that the Mtp resource is not occupied by other subsystems, the Mtp resource control authority of a first subsystem is activated, so that the first subsystem uses the Mtp function, namely each subsystem in the mobile terminal supports the Mtp function.
Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative only and should not be construed as limiting the invention.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. As used herein, the term "and/or" includes all or any element and all combinations of one or more of the associated listed items.
It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein. As will be appreciated by those skilled in the art, a "terminal" as used herein includes both devices having a wireless signal receiver, which are devices having only a wireless signal receiver without transmit capability, and devices having receive and transmit hardware, which have devices having receive and transmit hardware capable of two-way communication over a two-way communication link. Such a device may include: a cellular or other communication device having a single line display or a multi-line display or a cellular or other communication device without a multi-line display; PCS (Personal Communications Service), which may combine voice, data processing, facsimile and/or data communication capabilities; a PDA (Personal Digital Assistant), which may include a radio frequency receiver, a pager, internet/intranet access, a web browser, a notepad, a calendar and/or a GPS (Global Positioning System) receiver; a conventional laptop and/or palmtop computer or other device having and/or including a radio frequency receiver. As used herein, a "terminal" or "terminal device" may be portable, transportable, installed in a vehicle (aeronautical, maritime, and/or land-based), or situated and/or configured to operate locally and/or in a distributed fashion at any other location(s) on earth and/or in space. As used herein, a "terminal Device" may also be a communication terminal, a web terminal, a music/video playing terminal, such as a PDA, an MID (Mobile Internet Device) and/or a Mobile phone with music/video playing function, or a smart tv, a set-top box, etc.
A frame schematic diagram of an internal structure of a terminal device according to an embodiment of the present invention is shown in fig. 1, and includes: a main control system and more than two subsystems.
The subsystem in the embodiment of the present invention may be a container system that is provided in Linux container virtualization technology. The container system may be a Linux operating system or a Unix operating system in the conventional sense, an Android system, an Ubuntu system or a FireFox system derived from the Linux operating system, or a Windows system based on a Windows platform. In fact, the system of the present invention is not limited to the aforementioned exemplary operating systems, and can encompass all operating systems capable of operating in a container.
Preferably, the master control system may be the above conventional operating system, and may also be an operating system obtained by modifying the conventional kernel and/or adding functional modules outside the kernel (for example, a framework layer and an application layer).
The main control system is mainly used for performing foreground and background management on a plurality of subsystems, performing interaction with each system and the like.
Preferably, the master control system may communicate with the subsystems through predefined channels. Similarly, the systems can communicate with each other through the channel. Wherein the predefined channel may be a socket channel.
As shown in fig. 2, a method for using an Mtp function by multiple systems in an embodiment of the present invention includes:
step 201, the first subsystem sends an Mtp resource application request message to a multi-system control service in the master control system.
For the embodiment of the present invention, the Mtp resource may include: audio resources and video resources. The present invention is not limited to the embodiments.
And the Mtp resource application request message carries the system identifier of the first subsystem. For example, the system identifier of the first subsystem carried in the Mtp resource application request message is OS1。
For the embodiment of the invention, when the file in the first subsystem is transmitted to the mobile phone through a Universal Serial Bus (USB), the first subsystem first sends a request message to the multi-system control service in the main control system to request to activate the Mtp function of the first subsystem.
Step 202, the multi-system control service in the main control system detects whether the Mtp resource is occupied by other subsystems.
For the embodiment of the invention, after the multi-system control service in the main control system receives the Mtp resource application request message sent by the first container system, whether the Mtp resource is occupied by other subsystems is detected.
For the embodiment of the present invention, step 202 may further include: and if the multi-system control service in the main control system detects that the Mtp resource is occupied by other subsystems, the multi-system control service in the main control system returns a notification message that the Mtp resource is occupied by other subsystems to the first container system.
And 203, if the Mtp resources are not occupied by other subsystems, the multi-system control service in the main control system sends an activation permission request message to the Mtp function hardware equipment node of the kernel.
For the embodiment of the invention, the multi-system control service in the main control system detects whether the Mtp resource is occupied by other subsystems, so that the condition that two or more subsystems use the Mtp function at the same time to cause the conflict of the two subsystems is avoided.
For example, the Mtp resource is currently occupied by the second subsystem and the sound is output through the Mtp resource, which would result in possible output errors if the Mtp function of the first subsystem is still activated and the first subsystem is also outputting sound at the same time.
And step 204, the Mtp function hardware equipment node of the kernel activates the Mtp resource control authority of the first subsystem according to the activation authority request message.
For the embodiment of the invention, the activation permission request message received by the Mtp function hardware equipment node of the kernel generally carries a system identifier, and the Mtp function hardware equipment node of the kernel determines a subsystem needing to activate the Mtp resource control permission according to the system identifier and activates the Mtp resource control permission of the subsystem. In the embodiment of the invention, if the activation permission request message received by the Mtp function hardware equipment node of the kernel does not carry the system identifier, the Mtp function hardware equipment node of the kernel activates the Mtp resource control permission of the current foreground running subsystem.
For example, if the system identifier carried in the activation permission request message received by the Mtp function hardware device node of the kernel is the OS1If the Mtp function hardware equipment node of the kernel activates the Mtp resource control authority of the first subsystem; and if the system identifier does not exist in the activation permission request message received by the Mtp function hardware equipment node of the kernel and the subsystem operated in the foreground is the second subsystem, activating the Mtp resource control permission of the second subsystem by the Mtp function hardware equipment node of the kernel.
Compared with the method that only one system in a mobile terminal supports the Mtp function, any system of the mobile terminal in the embodiment of the invention can send an Mtp resource request message to a multi-system control service in a main control system, and after detecting that the Mtp resource is not occupied by other subsystems, the Mtp resource control authority of a first subsystem is activated, so that the first subsystem uses the Mtp function, namely each subsystem in the mobile terminal supports the Mtp function.
Another possible implementation manner of the embodiment of the present invention is, on the basis as shown in fig. 2, the step 204, the http function hardware device node of the kernel activates the http resource control authority of the first subsystem according to the activation authority request message, and then further includes a step 305 as shown in fig. 3, where the operation performed in the step 301 and 304 is the same as the operation performed in the step 201 and 204 in fig. 2, and is not described herein again.
Step 305, the multi-system control service in the master control system sends first notification messages to other subsystems respectively.
Wherein, the first informing message is used for informing other subsystems that Mtp resources are occupied.
For the embodiment of the invention, after the Mtp function hardware device node of the kernel activates the Mtp resource control authority of the first subsystem, the multi-system control service in the main control system respectively sends notification messages to other subsystems in the mobile terminal. In the embodiment of the present invention, the first notification message may or may not carry the system identifier of the first subsystem. The present invention is not limited to the embodiments.
For the embodiment of the invention, the multi-system control service in the main control system respectively sends the first notification message to other subsystems to notify the other subsystems that the Mtp resources are occupied, so that the situation that the other subsystems send Mtp resource application request messages to the multi-system control service in the main control system can be avoided, and the signaling overhead can be reduced.
Another possible implementation manner of the embodiment of the present invention is as shown in fig. 3, and further includes steps 406 and 408 as shown in fig. 4, wherein the operations performed in the steps 401 and 405 are the same as the operations performed in the steps 301 and 305, and are not described herein again.
And step 406, when the first subsystem does not need to use the Mtp resource, the first subsystem sends an Mtp resource cancellation message to a multi-system control service of the main control system.
For the embodiment of the invention, after the first subsystem in the mobile terminal and other mobile systems complete data transmission, the first subsystem sends an Mtp resource cancellation message to the multi-system control service of the main control system so as to cancel the Mtp resource control authority of the first subsystem.
For the embodiment of the present invention, the Mtp resource cancellation message may or may not carry the system identifier of the first subsystem. The present invention is not limited to the embodiments.
Step 407, the multi-system control service of the main control system sends a permission canceling request message to the Mtp function hardware device node of the kernel.
And step 408, the Mtp function hardware equipment node of the kernel cancels the Mtp resource control authority of the first subsystem according to the authority canceling request message.
For example, when the permission cancellation request message received by the Mtp function hardware device node of the kernel carries the OS1When the Mtp function hardware equipment node of the kernel directly cancels the Mtp resource control authority of the first subsystem; when the permission canceling request message received by the Mtp function hardware device node of the kernel does not carry the system identifier, the Mtp function hardware device node of the kernel can check the subsystem occupying the Mtp resource currently and cancel the Mtp resource control permission of the subsystem.
For the embodiment of the invention, when the first subsystem does not need to use the Mtp resource, the first subsystem sends the permission canceling request message to the Mtp function hardware equipment node of the kernel through the multi-system control service of the main control system, so that the Mtp function hardware equipment node of the kernel cancels the Mtp resource control permission of the first subsystem, other subsystems can apply for the Mtp resource, the first subsystem is prevented from occupying the Mtp resource when the Mtp resource does not need to be used, and the waste of the Mtp resource can be reduced.
Another possible implementation manner of the embodiment of the present invention is, on the basis as shown in fig. 4, the step 408, the Mtp function hardware device node of the kernel, according to the cancellation permission request message, cancels the Mtp resource control permission of the first subsystem, and then further includes a step 509 as shown in fig. 5, where the operation performed in the steps 501-508 is the same as the operation performed in the steps 401-408, and is not described herein again.
Step 509, the multi-system control service of the main control system sends a second notification message to the other subsystems.
The second informing message is used for informing other subsystems that the current Mtp resource is idle, so that the other subsystems can apply for occupying the Mtp resource.
For the embodiment of the present invention, the second notification message may carry a system identifier to notify that the first subsystem of the other subsystems does not occupy the http resource currently, or may not carry the system identifier to notify that the current http resource of the other subsystems is idle. The present invention is not limited to the embodiments.
For the embodiment of the invention, the multi-system control service of the main control information sends the second notification message to other subsystems, so that the idle state of the Mtp resource of other subsystems can be notified, other subsystems can apply for occupying the Mtp resource in time, the waiting time of the Mtp resource occupied by other subsystems can be avoided, the waiting time of the user using the Mtp function of other subsystems can be further reduced, and the user experience is improved.
Another possible implementation manner of the embodiment of the present invention is based on the operation shown in fig. 2, where the activation permission request message carries the system identifier of the first subsystem, and the step 204 activates the mptp resource control permission of the first subsystem by the mptp function hardware device node of the kernel according to the activation permission request message, including the operation 604 shown in fig. 6, and the operation shown in the step 601 and 603 is the same as the operation shown in the step 201 and 203, and is not described herein again.
And step 604, activating the Mtp resource control authority of the first subsystem by the Mtp function hardware equipment node of the kernel according to the system identifier of the first subsystem in the activation authority request message.
The embodiment of the invention provides another method for using Mtp resources by multiple systems, which is characterized in that first notification messages are respectively sent to other subsystems through multiple system control services in a main control system to notify the other subsystems that Mtp resources are occupied, so that the situation that the other subsystems send Mtp resource application request messages to the multiple system control services in the main control system can be avoided, and the signaling overhead can be reduced; when the first subsystem does not need to use the Mtp resource, the first subsystem sends an authority cancelling request message to the Mtp function hardware equipment node of the kernel through the multi-system control service of the master control system, so that the Mtp function hardware equipment node of the kernel cancels the Mtp resource control authority of the first subsystem, other subsystems can apply for the Mtp resource, the Mtp resource is prevented from being occupied when the first subsystem does not need to use the Mtp resource, and the waste of the Mtp resource can be reduced; the multi-system control service of the main control information sends a second notification message to other subsystems, and can notify that the Mtp resources of the other subsystems are idle, so that the other subsystems can apply for occupying the Mtp resources in time, waiting time of the Mtp resources occupied by the other subsystems can be avoided, waiting time of users using the Mtp functions of the other subsystems can be reduced, and user experience is improved.
An embodiment of the present invention provides a device for multiple systems to use an Mtp function, and as shown in fig. 7, the device includes: a sending module 71, a multi-system control module 72, an activation module 73, wherein,
and the sending module 71 is located in the first subsystem, and is configured to send an Mtp resource application request message to a multi-system control service in the master control system.
The multi-system control module 72 is located in the main control system and used for detecting whether the Mtp resource is occupied by other subsystems; and when the Mtp resource is not occupied by other subsystems, sending an activation permission request message to the Mtp function hardware equipment node of the kernel.
And the activation module 73 is located in the mp function hardware device node of the kernel, and is configured to activate the mp resource control authority of the first subsystem according to the activation authority request message sent by the multi-system control module 72.
The multi-system control module 72 is further configured to send first notification messages to the other subsystems, respectively.
Wherein, the first informing message is used for informing other subsystems that Mtp resources are occupied.
The sending module 71 is further configured to send an http resource cancellation message to a multi-system control service of the main control system when the first subsystem does not need to use the http resource.
The multisystem control module 72 is further configured to send a permission cancellation request message to the Mtp function hardware device node of the kernel.
Further, as shown in fig. 8, the apparatus further includes: the module 81 is cancelled.
And the canceling module 81 is located in the Mtp function hardware device node of the kernel, and is configured to cancel the Mtp resource control permission of the first subsystem according to the permission canceling request message sent by the multi-system control module 72.
The multi-system control module 72 is further configured to send a second notification message to the other subsystems.
The second informing message is used for informing other subsystems that the current Mtp resource is idle, so that the other subsystems can apply for occupying the Mtp resource.
The activation module 73 is specifically configured to activate the Mtp resource control permission of the first subsystem according to the system identifier of the first subsystem in the activation permission request message when the system identifier of the first subsystem is carried in the activation permission request message.
Compared with the method that only one system in a mobile terminal supports the Mtp function, any system of the mobile terminal in the embodiment of the invention can send an Mtp resource request message to a multi-system control service in a main control system, and after detecting that the Mtp resource is not occupied by other subsystems, the Mtp resource control authority of a first subsystem is activated, so that the first subsystem uses the Mtp function, namely each subsystem in the mobile terminal supports the Mtp function.
The embodiment of the invention provides another device for using Mtp resources by multiple systems, which is characterized in that first notification messages are respectively sent to other subsystems through multiple system control services in a main control system to notify the other subsystems that Mtp resources are occupied, so that the situation that the other subsystems send Mtp resource application request messages to the multiple system control services in the main control system can be avoided, and the signaling overhead can be reduced; when the first subsystem does not need to use the Mtp resource, the first subsystem sends an authority cancelling request message to the Mtp function hardware equipment node of the kernel through the multi-system control service of the master control system, so that the Mtp function hardware equipment node of the kernel cancels the Mtp resource control authority of the first subsystem, other subsystems can apply for the Mtp resource, the Mtp resource is prevented from being occupied when the first subsystem does not need to use the Mtp resource, and the waste of the Mtp resource can be reduced; the multi-system control service of the main control information sends a second notification message to other subsystems, and can notify that the Mtp resources of the other subsystems are idle, so that the other subsystems can apply for occupying the Mtp resources in time, waiting time of the Mtp resources occupied by the other subsystems can be avoided, waiting time of users using the Mtp functions of the other subsystems can be reduced, and user experience is improved.
The device for multiple systems using the Mtp function provided by the embodiment of the present invention can implement the method embodiment provided above, and for specific implementation of the function, reference is made to the description of the method embodiment, which is not described herein again. The method and the device for using the Mtp function by the multiple systems provided by the embodiment of the invention can be suitable for the mobile terminal of the multiple systems, and each subsystem in the mobile terminal supports the Mtp function, but not limited to the Mtp function.
Those skilled in the art will appreciate that the invention includes apparatus relating to performing one or more of the operations herein. These devices may be specially designed and manufactured for the required purposes, or they may comprise known devices in general-purpose computers. These devices have stored therein computer programs that are selectively activated or reconfigured. Such a computer program may be stored in a device (e.g., computer) readable medium, including, but not limited to, any type of disk including floppy disks, hard disks, optical disks, CD-ROMs, and magnetic-optical disks, ROMs (Read-Only memories), RAMs (Random Access memories), EPROMs (Erasable Programmable Read-Only memories), EEPROMs (Electrically Erasable Programmable Read-Only memories), flash memories, magnetic cards, or optical cards, or any type of media suitable for storing electronic instructions, and each coupled to a bus. That is, a readable medium includes any medium that stores or transmits information in a form readable by a device (e.g., a computer).
It will be understood by those within the art that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by computer program instructions. Those skilled in the art will appreciate that the computer program instructions may be implemented by a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, implement the features specified in the block or blocks of the block diagrams and/or flowchart illustrations of the present disclosure.
Those of skill in the art will appreciate that various operations, methods, steps in the processes, acts, or solutions discussed in the present application may be alternated, modified, combined, or deleted. Further, various operations, methods, steps in the flows, which have been discussed in the present application, may be interchanged, modified, rearranged, decomposed, combined, or eliminated. Further, steps, measures, schemes in the various operations, methods, procedures disclosed in the prior art and the present invention can also be alternated, changed, rearranged, decomposed, combined, or deleted.
The foregoing is only a partial embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.