CN115437723A - Application scene fast switching method and device, electronic equipment and storage medium - Google Patents

Application scene fast switching method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115437723A
CN115437723A CN202110608940.9A CN202110608940A CN115437723A CN 115437723 A CN115437723 A CN 115437723A CN 202110608940 A CN202110608940 A CN 202110608940A CN 115437723 A CN115437723 A CN 115437723A
Authority
CN
China
Prior art keywords
application scene
container
application
switching
hardware
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
Application number
CN202110608940.9A
Other languages
Chinese (zh)
Inventor
杨冬东
董俊杰
李芳�
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN202110608940.9A priority Critical patent/CN115437723A/en
Publication of CN115437723A publication Critical patent/CN115437723A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • G06F9/452Remote windowing, e.g. X-Window System, desktop virtualisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/14Digital output to display device ; Cooperation and interconnection of the display device with other functional units
    • G06F3/1454Digital output to display device ; Cooperation and interconnection of the display device with other functional units involving copying of the display data of a local workstation or window to a remote workstation or window so that an actual copy of the data is displayed simultaneously on two or more displays, e.g. teledisplay
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The disclosure relates to a method and a device for fast switching application scenes, an electronic device and a storage medium, wherein the method for fast switching application scenes comprises the following steps: acquiring hardware resources required by a plurality of application scenes, and loading corresponding hardware resources through a virtual machine corresponding to each application scene; the virtual machine is established in the containers of the corresponding application scenes; acquiring an application scene switching instruction; and switching among the containers according to the application scene switching instruction. Compared with the prior art that hardware resources need to be called among different servers when application scenes are switched, the method provided by the embodiment of the disclosure loads the corresponding hardware resources through the virtual machine corresponding to the application scenes when the application scenes are switched among a plurality of containers, so that the application scenes can be quickly switched, and user experience is improved.

Description

Application scene fast switching method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of electronic devices, and in particular, to a method and an apparatus for fast switching application scenarios, an electronic device, and a non-transitory computer-readable storage medium.
Background
With the continuous development of electronic devices, the requirements for interconnection and intercommunication among electronic devices are also higher and higher. For example, in a home environment, a user may call hardware resources of other smart devices through a mobile terminal such as a mobile phone, for example, call a display screen of a smart television to project a screen through the mobile phone, or call a speaker of a smart speaker to play through the mobile phone.
Currently, in the related art, a user needs to install a screen-casting calling APP (Application) to call a display screen of a smart television to perform screen casting; the calling APP needing to be installed for playing can call the loudspeaker of the intelligent sound box for playing. However, as the demand for intelligence is continuously increased, the interaction between the intelligent devices is more and more frequent, and the user has a new demand for the speed of switching the application scenes.
Therefore, how to realize the fast switching of the application scenes becomes a problem to be solved urgently at present.
Disclosure of Invention
The present disclosure provides a method and an apparatus for fast switching application scenarios, an electronic device, and a storage medium, so as to at least solve the problem of slow switching of application scenarios in the related art. The technical scheme of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, a method for fast switching application scenarios is provided, including: acquiring hardware resources required by a plurality of application scenes, and loading corresponding hardware resources through a virtual machine corresponding to each application scene; the virtual machines are established in the containers corresponding to the application scenes; acquiring an application scene switching instruction; and switching among the containers according to the application scene switching instruction.
In an embodiment of the disclosure, a display terminal is shared by a plurality of containers, and one container among the plurality of containers occupies the display terminal, and switching between the plurality of containers according to the application scene switching instruction includes: acquiring a current container occupying the display terminal; and acquiring a target container according to the application scene switching instruction, and displaying the output content of the target container through the display terminal.
In an embodiment of the disclosure, the displaying the output content of the target container through the display terminal includes: and opening a new window on the display terminal, and displaying the output content of the target container in the new window.
In an embodiment of the present disclosure, the method further includes: acquiring a plurality of accessed intelligent devices; broadcasting a hardware report message to a plurality of intelligent devices; receiving hardware resource information reported by a plurality of intelligent devices; and generating a hardware resource library according to the hardware information reported by the intelligent equipment.
In an embodiment of the present disclosure, the loading, by the virtual machine corresponding to each application scenario, the corresponding hardware resource includes: and calling corresponding hardware resources from the hardware resource library according to the hardware resources required by each application scene and loading the hardware resources to the corresponding virtual machine.
In an embodiment of the present disclosure, the method further includes: generating a resource descriptor corresponding to each container according to the hardware resources loaded by each virtual machine; wherein the resource descriptor is used for describing the hardware resource loaded by each virtual machine.
In an embodiment of the disclosure, the switching between the plurality of containers according to the application scene switching instruction includes: acquiring a resource descriptor of a container corresponding to a source application scene and a resource descriptor of a container corresponding to a target application scene; judging whether the resource descriptor of the container corresponding to the source application scene and the resource descriptor of the container corresponding to the target application scene have hardware resource conflict or not; and if the hardware resource conflict exists, switching the conflicting hardware resource to a container corresponding to the target application scene according to preset configuration, or sharing the conflicting hardware resource by the container corresponding to the source application scene and the container corresponding to the target application scene in a time-sharing multiplexing mode.
In one embodiment of the present disclosure, the application scene switching instruction is generated by a voice instruction or a gesture instruction of a user, or is generated by a network event.
According to a second aspect of the embodiments of the present disclosure, a fast switching device of an application scenario is provided, including: the loading module is used for acquiring hardware resources required by a plurality of application scenes and loading corresponding hardware resources through a virtual machine corresponding to each application scene; the virtual machine is established in the container corresponding to the application scene; the instruction acquisition module is used for acquiring an application scene switching instruction; and the switching module is used for switching among the containers according to the application scene switching instruction.
In an embodiment of the disclosure, a plurality of the containers share a display terminal, and one of the plurality of containers occupies the display terminal, the switching module obtains a current container occupying the display terminal, obtains a target container according to the application scene switching instruction, and displays output content of the target container through the display terminal.
In one embodiment of the present disclosure, the switching module opens a new window on the display terminal and displays the output content of the target container in the new window.
In an embodiment of the present disclosure, the above apparatus further includes: the acquisition module is used for acquiring a plurality of accessed intelligent devices; the broadcasting module is used for broadcasting a hardware report message to the plurality of intelligent devices; the receiving module is used for receiving the hardware resource information reported by the intelligent equipment; and the first generating module is used for generating a hardware resource library according to the hardware information reported by the intelligent equipment.
In an embodiment of the present disclosure, the loading module invokes, according to a hardware resource required by each application scenario, a corresponding hardware resource from the hardware resource library and loads the hardware resource to the corresponding virtual machine.
In an embodiment of the present disclosure, the above apparatus further includes: a second generating module, configured to generate a resource descriptor corresponding to each container according to the hardware resource loaded by each virtual machine; wherein the resource descriptor is used for describing the hardware resource loaded by each virtual machine.
In an embodiment of the disclosure, the above apparatus, the switching module, includes: the acquisition unit is used for acquiring the resource descriptor of the container corresponding to the source application scene and the resource descriptor of the container corresponding to the target application scene; a judging unit, configured to judge whether a hardware resource conflict exists between the resource descriptor of the container corresponding to the source application scenario and the resource descriptor of the container corresponding to the target application scenario; and the switching unit is used for switching the conflicted hardware resource to the container corresponding to the target application scene according to preset configuration when the hardware resource confliction exists, or sharing the conflicted hardware resource by the container corresponding to the source application scene and the container corresponding to the target application scene according to a time-sharing multiplexing mode.
In one embodiment of the present disclosure, the application scene switching instruction is generated by a voice instruction or a gesture instruction of a user, or is generated by a network event.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic device, including: a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement the fast switching method of the application scenario.
According to a fourth aspect of the embodiments of the present disclosure, a non-transitory computer-readable storage medium is provided, where instructions of the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the above-mentioned method for fast switching of application scenarios.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
according to the embodiment of the disclosure, corresponding containers are respectively established for a plurality of application scenes in advance, corresponding virtual machines are established in the containers corresponding to the application scenes, when hardware resources required by the application scenes are obtained, the corresponding hardware resources are loaded through the virtual machines corresponding to the application scenes, and when an application scene switching instruction is obtained, switching is carried out among the containers according to the application scene switching instruction. Therefore, compared with the prior art that hardware resources need to be called among different servers when application scenes are switched, the application scenes can be rapidly switched by loading the corresponding hardware resources through the virtual machines corresponding to the application scenes when the application scenes are switched and the multiple containers are switched, and user experience is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
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 disclosure and are not to be construed as limiting the disclosure.
FIG. 1 is a flow chart of a method of fast switching of application scenarios according to an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of an application scenario-container-virtual machine, according to one embodiment of the present disclosure;
FIG. 3 is a schematic diagram of an arrangement of application scenes in a display terminal according to a specific embodiment of the present disclosure;
FIG. 4 is a schematic diagram of an arrangement of application scenes in a display terminal according to another specific embodiment of the present disclosure;
FIG. 5 is a flowchart of a method for fast switching of application scenarios, according to a specific embodiment of the present disclosure;
FIG. 6 is a flow chart of a method for fast switching of application scenarios according to another specific embodiment of the present disclosure;
FIG. 7 is a block diagram representation of a fast switching apparatus of an application scenario in accordance with an embodiment of the present disclosure;
fig. 8 is a block diagram of a structure of an electronic device according to an embodiment of the present disclosure.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the foregoing drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
A fast switching method of an application scenario, a fast switching apparatus of an application scenario, an electronic device, and a non-transitory computer-readable storage medium according to embodiments of the present disclosure are described below with reference to the drawings.
In an embodiment of the present disclosure, a heterogeneous computing engine is provided, where heterogeneous computing mainly refers to a computing manner of a system composed of computing units using different types of instruction sets and architectures, and common computing Unit types include coprocessors such as a CPU (Central Processing Unit), a GPU (Graphics Processing Unit), a DSP (Digital Signal Processing), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), and the like. The heterogeneous compute engine may act as a communication intermediary between the first operating system and the second operating system to enable mutual invocation of resources between the first operating system and the second operating system. The heterogeneous computing engine may be disposed in the first operating system or in the second operating system, and is not limited herein.
For example, the heterogeneous compute engine is located in a first operating system and can be called by an APP (Application) in the first operating system to directly call hardware resources or software resources in a second operating system. That is, the APP within the first operating system may call a hardware resource or a software resource of the APP within the second operating system.
For another example, an APP with an IOS operating system in a mobile terminal (e.g., a mobile phone) may directly call a hardware resource or a software resource of an APP with an android operating system or a Linux operating system.
Fig. 1 is a flowchart of a fast switching method of an application scenario according to an embodiment of the present disclosure.
In this embodiment, an execution subject of the fast switching method of the application scenario is APPs such as a video APP, a takeaway APP, an intelligent door lock APP, a map APP, a browser APP, and a music playing APP in a mobile terminal (e.g., a mobile phone), where an operating system of the mobile terminal may be an IOS system or an android system, and a heterogeneous computing engine is provided in the operating system of the mobile terminal, and the method may also utilize the heterogeneous computing engine to enable calling between the first operating system and the second operating system.
As shown in fig. 1, a method for rapidly switching application scenarios according to an embodiment of the present disclosure includes the following steps:
in step S101, acquiring hardware resources required by a plurality of application scenarios, and loading corresponding hardware resources through a virtual machine corresponding to each application scenario; the virtual machine is established in the container corresponding to the application scenes.
The multiple application scenes can be application scenes of calling household appliances such as video APPs, takeaway APPs, intelligent door locks APPs, map APPs, browsers APPs and music playing APPs downloaded in the mobile terminal (such as a mobile phone). For example, the video APP calls an application scene (application scene one) of a display screen of the smart television to launch a video; the map APP calls a display screen of the intelligent television to display an application scene (application scene two) of the map; the browser APP calls a display screen of the intelligent television to view an application scene (application scene three) of the browsing content; calling a display screen of the smart television by the takeout APP to display an application scene (application scene four) of the takeout interface; calling an application scene (application scene five) for playing music by the intelligent sound box through the music playing APP; and the intelligent door lock APP calls an application scene (application scene six) of the intelligent sound playing door ring, and the like.
As shown in fig. 2, in this embodiment, corresponding containers may be established in advance for a plurality of application scenarios, and corresponding virtual machines may be established in each container. For example, a first container (container one) may be established for the application scenario one, and a corresponding first virtual machine (virtual machine one) may be established in the first container; establishing a second container (container two) for the application scene two, and establishing a corresponding second virtual machine (virtual machine two) in the second container; establishing a third container (container III) for the application scene III, and establishing a corresponding third virtual machine (virtual machine III) in the third container; establishing a fourth container (virtual machine four) for the application scene four, and establishing a corresponding fourth virtual machine (virtual machine four) in the fourth container; establishing a fifth container (container five) for the application scene five, and establishing a corresponding fifth virtual machine (virtual machine five) in the fifth container; a sixth container (container six) is established for application scenario six, and a corresponding sixth virtual machine (virtual machine six) is established in the sixth container.
After a user starts a certain APP, monitoring the application scene through the APP, acquiring hardware resources required by the application scene, and after acquiring the hardware resources, loading the corresponding hardware resources through the corresponding virtual machine to control the hardware resources to work. For example, when monitoring that an application scene is an application scene for calling a display screen of a smart television to play a video, a video APP acquires a hardware resource required by the application scene as the display screen of the smart television, loads the display screen of the smart television through a first virtual machine, and controls the display screen to play the video; when the map APP monitors that the application scene is the application scene for calling the display screen of the intelligent television to display the map, acquiring hardware resources required by the application scene as the display screen of the intelligent television, loading the display screen of the intelligent television through a second virtual machine, and controlling the display screen to display the map; when monitoring that the application scene is the application scene for calling the display screen of the intelligent television to view the browser, the browser APP acquires that the hardware resource required by the application scene is the display screen of the intelligent television, loads the display screen of the intelligent television through a third virtual machine, and views the browser through the display screen; when the takeout APP monitors that the application scene is an application scene for calling a display screen of the intelligent television to display a takeout interface, acquiring hardware resources required by the application scene as the display screen of the intelligent television, loading the display screen of the intelligent television through a fourth virtual machine, and displaying the takeout interface by using the display screen; when the music playing APP monitors that the application scene is the application scene calling the loudspeaker of the intelligent sound box to play music, acquiring the hardware resource required by the application scene as the loudspeaker of the intelligent sound box, loading the loudspeaker of the intelligent sound box through a fifth virtual machine, and controlling the loudspeaker of the intelligent sound box to play music; when monitoring the application scene of the application scene for calling the loudspeaker playing doorbell of the intelligent sound box, the intelligent door lock APP acquires the loudspeaker of the intelligent sound box as the hardware resource required by the application scene, and controls the loudspeaker playing doorbell of the intelligent sound box by loading the loudspeaker of the intelligent sound box through the sixth virtual machine.
In step S102, an application scene switching instruction is acquired.
In this embodiment, the application scene switching instruction may be generated by a voice instruction or a gesture instruction of the user, or generated by a network event, for switching the current application scene to another application scene through the corresponding APP.
For example, each APP may generate a voice instruction according to voice information input by a user through a human-computer interaction interface corresponding to the APP, for example, when the user sends "the display screen of the smart television displays the takeaway interface" voice information through a voice input module of the takeaway APP, or sends "the display screen of the smart television displays the map" voice information through a voice input module of the map APP, an application scene switching instruction may be generated; the video APP and the music playing APP can generate gesture instructions of a user according to gesture information input by the user through a human-computer interaction interface of the APP, and the instructions represented by specific gestures can be preset by the user and stored in the respective APPs, namely, application scene switching instructions can be generated; takeaway APP can generate application scene switching instruction according to network event, for example, when the user watches video using the display screen of smart television, takeaway platform has pushed a takeaway to arrive the information in appointed place, this moment this information send to takeaway APP, takeaway APP generates corresponding application scene switching instruction according to this network event, if, the user is when using intelligent stereo to play music, the doorbell has sounded, the information that this moment doorbell will be triggered sends to intelligent lock APP, intelligent lock APP generates corresponding application scene switching instruction according to doorbell sound.
In step S103, switching is performed between a plurality of containers in accordance with the application scene switching instruction.
In practical applications, multiple application scenarios may share some hardware resources, and the call between the hardware resources may conflict. For example, the first application scenario needs to call the display screen of the smart television, and at this time, the display screen of the smart television is occupied by the second application scenario, which may cause conflict of hardware resource call. In order to solve the problem of conflict, the hardware resources occupied by the application scene two need to be released first during switching, and then new hardware resources are established for the application scene one, so that the switching of the application scenes is very slow, and the user experience is influenced.
In order to solve the problem, when an APP, such as a video APP, a takeaway APP, an intelligent door lock APP, a map APP, a browser APP, a music playing APP and the like, acquires an application scene switching instruction of a user, acquires a target container corresponding to a target application scene, switches the container to the target container corresponding to the target application scene, acquires hardware resources required by the target container corresponding to the target application scene, and loads the hardware resources required by the target application scene through a virtual machine in the target container corresponding to the target application scene to control the hardware resources to work.
It should be noted that, if the hardware resources are the same hardware resource such as the display screen of the smart television before and after the application scene is switched, the two application scenes may be displayed in the display screen at the same time, the area where the specific application scene is allocated and displayed may be set according to actual needs, and the content displayed by the application scene after the switching may also be used to directly cover the content displayed by the application scene before the switching, which is not limited specifically here.
As an alternative implementation manner, as shown in fig. 3, when the output content of the target container is displayed through the display terminal, a new window may be opened on the display terminal, and the output content of the target container may be displayed in the new window. That is to say, the two application scenes, such as the first application scene and the second application scene, can be displayed on the display terminal at the same time, the second application scene covers the first application scene, and the specific area for allocating and displaying the application scenes can be set according to actual needs. It should be noted that the display terminal may also be used to display more application scenes, such as application scene one, application scene two, and application scene three. For example, under the condition that the display terminal displays the first application scene and the second application scene, if the takeaway platform pushes information that takeaway arrives at a specified place, the takeaway APP is triggered, the takeaway APP generates a corresponding application scene switching instruction according to the network event, and simultaneously displays the first application scene, the second application scene and the third application scene on the display terminal, wherein the second application scene and the third application scene are overlaid on the first application scene, and the layout of the first application scene, the second application scene and the third application scene can be adaptively adjusted.
As another optional implementation manner, when the output content of the target container is displayed through the display terminal, a new window may not be opened on the display terminal, and the output content of the target container is displayed to cover the content of the previous application scene.
As another alternative implementation, when the output content of the target container is displayed through the display terminal, the content output by the current container and the content output by the target container may be displayed through the display terminal in a time division multiplexing manner, for example, each of the content and the content may occupy 50% of a screen of the display terminal, and as shown in fig. 4, each of the application scene one and the application scene two occupies half of the screen.
In summary, in the method for rapidly switching application scenes according to the embodiment of the present disclosure, corresponding containers are respectively established for a plurality of application scenes in advance, corresponding virtual machines are established in the containers corresponding to the application scenes, when hardware resources required by the plurality of application scenes are obtained, the corresponding hardware resources are loaded through the virtual machines corresponding to the application scenes, and when an application scene switching instruction is obtained, switching is performed among the plurality of containers according to the application scene switching instruction. Therefore, compared with the prior art that hardware resources need to be called among different servers when application scenes are switched, the application scenes can be switched quickly by loading the corresponding hardware resources through the virtual machines corresponding to the application scenes when the application scenes are switched and the multiple containers are switched, and user experience is improved.
Fig. 5 is a flowchart of a method for fast switching application scenarios according to an embodiment of the present disclosure, and as shown in fig. 5, when a plurality of containers share a display terminal, such as a display screen of a smart television, and one container in the plurality of containers occupies the display terminal, the method for fast switching application scenarios according to the embodiment of the present disclosure includes the following steps:
in step S501, hardware resources required by multiple application scenes are obtained, and corresponding hardware resources are loaded through a virtual machine corresponding to each application scene; the virtual machine is established in the container corresponding to the application scene.
The multiple application scenes can be application scenes of calling household appliances by various APPs downloaded in a mobile terminal (such as a mobile phone), such as a video APP, a take-away APP, a map APP and a browser APP. For example, the video APP calls an application scene (application scene one) of a display screen of the smart television to launch a video; calling a display screen of the intelligent television by the map APP to display an application scene (application scene II) of the map; the browser APP calls a display screen of the intelligent television to view an application scene (application scene three) of the browsing content; and the takeout APP calls a display screen of the smart television to display an application scene (application scene four) of the takeout interface.
As shown in fig. 2, in this embodiment, as shown in fig. 2, corresponding containers may be established in advance for a plurality of application scenarios, and corresponding virtual machines may be established in each container. For example, a first container (container one) may be established for the application scenario one, and a corresponding first virtual machine (virtual machine one) may be established in the first container; establishing a second container (container two) for the application scene two, and establishing a corresponding second virtual machine (virtual machine two) in the second container; establishing a third container (container III) for the application scene III, and establishing a corresponding third virtual machine (virtual machine III) in the third container; a fourth container (virtual machine four) is established for application scenario four, and a corresponding fourth virtual machine (virtual machine four) is established among the fourth container.
After starting an APP, a user monitors an application scene through the APP, obtains hardware resources required by the application scene, and loads corresponding hardware resources through a corresponding virtual machine after obtaining the hardware resources, so as to control the hardware resources to work. For example, when the video APP monitors that the application scene is the application scene for calling the display screen of the smart television to play the video, acquiring a hardware resource required by the application scene as the display screen of the smart television, and loading the display screen of the smart television through the first virtual machine to control the display screen to play the video; when the map APP monitors that the application scene is the application scene for calling the display screen of the intelligent television to display the map, acquiring hardware resources required by the application scene as the display screen of the intelligent television, loading the display screen of the intelligent television through a second virtual machine, and controlling the display screen to display the map; when monitoring that the application scene is the application scene for calling the display screen of the intelligent television to view the browser, the browser APP acquires that the hardware resource required by the application scene is the display screen of the intelligent television, loads the display screen of the intelligent television through a third virtual machine, and views the browser through the display screen; when the takeaway APP monitors that the application scene is the application scene for calling the display screen of the intelligent television to display the takeaway interface, the hardware resource required by the application scene is acquired as the display screen of the intelligent television, the display screen of the intelligent television is loaded through the fourth virtual machine, and the takeaway interface is displayed through the display screen.
In step S502, an application scene switching instruction is acquired.
In this embodiment, the application scene switching instruction may be generated by a voice instruction or a gesture instruction of the user, or generated by a network event, and is used to switch the current application scene to another application scene through the corresponding APP.
For example, each APP can generate a voice instruction according to voice information input by a user through a human-computer interaction interface corresponding to the APP, for example, when the user sends "the display screen of the smart television displays the takeaway interface" voice information through a voice input module of the takeaway APP, or sends "the display screen of the smart television displays the map" voice information through a voice input module of the map APP, an application scene switching instruction can be generated; the video APP can generate a gesture instruction of a user according to gesture information input by the user through a human-computer interaction interface of the APP, and the instruction represented by a specific gesture can be preset by the user and stored in the APP, namely an application scene switching instruction can be generated; the takeaway APP can generate an application scene switching instruction according to a network event, for example, when a user uses a display screen of the smart television to watch videos, the takeaway platform pushes information that takeaway arrives at a specified place, at the moment, the information is sent to the takeaway APP, and the takeaway APP generates a corresponding application scene switching instruction according to the network event.
In step S503, the current container occupying the display terminal is acquired.
In step S504, the target container is acquired according to the application scene switching instruction, and the output content of the target container is displayed through the display terminal.
In this embodiment, when obtaining an application scene switching instruction of a user, APPs such as a video APP, a take-away APP, a map APP, and a browser APP, obtain a current container occupying a display terminal and a target container corresponding to a target application scene, switch the current container to the target container, and display output content through the display terminal by using a virtual machine established in the target container. For example, when an application scene is switched from a video played by using a display screen of a smart television to a map displayed by using the display screen of the smart television, the map APP acquires an application scene switching instruction, switches the first container to the second container at the moment, acquires hardware resources required by the application scene of displaying the map by using the display screen of the smart television as the display screen of the smart television, and controls the display screen to display the map by loading the display screen of the smart television through a second virtual machine established in the second container.
As an alternative implementation manner, as shown in fig. 3, when the output content of the target container is displayed through the display terminal, a new window may be opened on the display terminal, and the output content of the target container may be displayed in the new window. That is to say, the two application scenes, such as the first application scene and the second application scene, can be displayed on the display terminal at the same time, the second application scene covers the first application scene, and the specific area for allocating and displaying the application scenes can be set according to actual needs. It should be noted that the display terminal may also be used to display more application scenes, such as application scene one, application scene two, and application scene three. For example, under the condition that the display terminal displays the first application scene and the second application scene, if the takeaway platform pushes information that takeaway arrives at a specified place, the takeaway APP is triggered, the takeaway APP generates a corresponding application scene switching instruction according to the network event, and simultaneously displays the first application scene, the second application scene and the third application scene on the display terminal, wherein the second application scene and the third application scene are overlaid on the first application scene, and the layout of the first application scene, the second application scene and the third application scene can be adaptively adjusted.
As another optional implementation manner, when the output content of the target container is displayed through the display terminal, a new window may not be opened on the display terminal, and the output content of the target container is displayed to cover the content of the previous application scene.
Therefore, according to the method for rapidly switching application scenes, corresponding containers are established for a plurality of application scenes in advance, corresponding virtual machines are established in the containers corresponding to the application scenes, when hardware resources required by the application scenes are obtained, the corresponding hardware resources are loaded through the virtual machines corresponding to the application scenes, after an application scene switching instruction of a user is obtained, a current container occupying a display terminal is obtained, a target container is obtained according to the application scene switching instruction, and output contents of the target container are displayed through the display terminal. Therefore, compared with the prior art that hardware resources need to be called among different servers when application scenes are switched and the same hardware resource occupies conflict, the application scenes can be quickly switched by loading the corresponding hardware resource through the virtual machine corresponding to the application scenes when the application scenes are switched and a plurality of containers are switched, and user experience is improved.
Fig. 6 is a flowchart illustrating a fast switching method of an application scenario according to another embodiment of the present disclosure, and as shown in fig. 6, the fast switching method of an application scenario includes:
in step S601, a plurality of smart devices are accessed.
The intelligent equipment can be intelligent household appliances such as an intelligent television and an intelligent sound box.
In step S602, a hardware report message is broadcast to a plurality of smart devices.
In step S603, hardware resource information reported by a plurality of intelligent devices is received.
In step S604, a hardware resource library is generated according to the hardware information reported by the plurality of intelligent devices.
In this embodiment, the APP can with a plurality of intelligent device wireless connections after mobile terminal networking like video APP, takeaway APP, intelligent lock APP, map APP, browser APP, music broadcast APP etc to after wireless connection succeeds, acquire a plurality of intelligent device of access. After acquiring the plurality of accessed intelligent devices, sending a hardware report message to each intelligent device, so that each intelligent device reports the respective hardware to the corresponding APP. After receiving the hardware resource information reported by each intelligent device, each APP counts the corresponding hardware resource of each intelligent device, and generates a hardware resource library.
For example, after the APPs such as the video APP, the take-away APP, the smart door lock APP, the map APP, the browser APP, the music playing APP and the like are successfully wirelessly connected with the smart television and the smart audio, the hardware report message is sent to the smart television and the smart audio. After receiving the hardware report message, the smart television respectively reports the display screen to a video APP, a take-away APP, a map APP, a browser APP and the like; after receiving the hardware report message, the intelligent sound equipment reports the loudspeaker to an intelligent door lock APP, a music playing APP and the like. And after each APP receives the display screen reported by the smart television and the loudspeaker reported by the smart sound, a hardware resource library is generated.
In step S605, acquiring hardware resources required by a plurality of application scenarios, and loading corresponding hardware resources through a virtual machine corresponding to each application scenario; the virtual machine is established in the container corresponding to the application scene.
The multiple application scenes can be application scenes of calling household appliances such as video APPs, takeaway APPs, intelligent door locks APPs, map APPs, browsers APPs and music playing APPs downloaded in the mobile terminal (such as a mobile phone). For example, the video APP calls an application scene (application scene one) of a display screen of the smart television to launch a video; calling a display screen of the intelligent television by the map APP to display an application scene (application scene II) of the map; the browser APP calls a display screen of the intelligent television to view an application scene (application scene three) of the browsing content; calling a display screen of the smart television by the takeout APP to display an application scene (application scene four) of the takeout interface; calling an application scene (application scene five) for playing music by the intelligent sound equipment through the music playing APP; and the intelligent door lock APP calls an application scene (application scene six) of the intelligent sound playing door ring, and the like.
As shown in fig. 2, in this embodiment, corresponding containers may be established in advance for a plurality of application scenarios, and corresponding virtual machines may be established in each container. For example, a first container (container one) may be established for the application scenario one, and a corresponding first virtual machine (virtual machine one) may be established in the first container; establishing a second container (container two) for the application scene two, and establishing a corresponding second virtual machine (virtual machine two) in the second container; establishing a third container (container III) for the application scene III, and establishing a corresponding third virtual machine (virtual machine III) in the third container; establishing a fourth container (virtual machine four) for the application scene four, and establishing a corresponding fourth virtual machine (virtual machine four) in the fourth container; establishing a fifth container (container five) for the application scene five, and establishing a corresponding fifth virtual machine (virtual machine five) in the fifth container; a sixth container (container six) is established for application scenario six, and a corresponding sixth virtual machine (virtual machine six) is established among the sixth container.
After starting an APP, a user monitors an application scene through the APP, obtains hardware resources required by the application scene, and loads corresponding hardware resources through a corresponding virtual machine after obtaining the hardware resources, so as to control the hardware resources to work. For example, when monitoring that an application scene is an application scene for calling a display screen of a smart television to play a video, a video APP acquires a hardware resource required by the application scene as the display screen of the smart television, loads the display screen of the smart television through a first virtual machine, and controls the display screen to play the video; when the map APP monitors that the application scene is the application scene for calling the display screen of the intelligent television to display the map, acquiring hardware resources required by the application scene as the display screen of the intelligent television, loading the display screen of the intelligent television through a second virtual machine, and controlling the display screen to display the map; when monitoring that the application scene is the application scene for calling the display screen of the intelligent television to view the browser, the browser APP acquires that the hardware resource required by the application scene is the display screen of the intelligent television, loads the display screen of the intelligent television through a third virtual machine, and views the browser through the display screen; when the takeaway APP monitors that the application scene is the application scene for calling the display screen of the intelligent television to display the takeaway interface, the hardware resource required by the application scene is acquired as the display screen of the intelligent television, the display screen of the intelligent television is loaded through the fourth virtual machine, and the takeaway interface is displayed through the display screen.
In step S606, a resource descriptor corresponding to each container is generated according to the hardware resource loaded by each virtual machine, where the resource descriptor is used to describe the hardware resource loaded by each virtual machine.
For example, when a video APP loads a display screen of a smart television in a first virtual machine, a resource descriptor corresponding to a first container is generated as the display screen; when the map APP loads a display screen of the smart television in the second virtual machine, generating a resource descriptor corresponding to the second container as the display screen; when the display screen of the intelligent television is loaded by the browser APP in the third virtual machine, generating a resource descriptor corresponding to the third container as the display screen; when the takeout APP loads the display screen of the smart television in the fourth virtual machine, generating a resource descriptor corresponding to the fourth container as the display screen; when the fifth virtual machine loads a loudspeaker of the intelligent sound box, the music player APP generates a resource descriptor corresponding to the fifth container as the loudspeaker; when the intelligent door lock APP loads the loudspeaker of the intelligent sound box in the sixth virtual machine, the resource descriptor corresponding to the sixth container is generated to be the loudspeaker.
In step S607, an application scene switching instruction is acquired.
In this embodiment, the application scene switching instruction may be generated by a voice instruction or a gesture instruction of the user, or generated by a network event, and is used to switch the current application scene to another application scene through the corresponding APP.
For example, each APP can generate a voice instruction according to voice information input by a user through a human-computer interaction interface corresponding to the APP, for example, when the user sends "the display screen of the smart television displays the takeaway interface" voice information through a voice input module of the takeaway APP, or sends "the display screen of the smart television displays the map" voice information through a voice input module of the map APP, an application scene switching instruction can be generated; the video APP and the music playing APP can generate gesture instructions of a user according to gesture information input by the user through a human-computer interaction interface of the APPs, and the instructions represented by specific gestures can be preset by the user and stored in the respective APPs, namely, application scene switching instructions can be generated; the takeaway APP can generate an application scene switching instruction according to a network event, for example, when a user watches videos by using a display screen of a smart television, a takeaway platform pushes information that takeaway arrives at an appointed place, the information is sent to the takeaway APP at the moment, the takeaway APP generates a corresponding application scene switching instruction according to the network event, if the user plays music by using an intelligent sound box, a doorbell rings, the information triggered by the doorbell at the moment is sent to the intelligent door lock APP, and the intelligent door lock APP generates a corresponding application scene switching instruction according to the doorbell sound.
In step S608, the resource descriptor of the container corresponding to the source application scenario and the resource descriptor of the container corresponding to the target application scenario are obtained.
In step S609, it is determined whether there is a hardware resource conflict between the resource descriptor of the container corresponding to the source application scenario and the resource descriptor of the container corresponding to the target application scenario.
In step S610, if there is a hardware resource conflict, the conflicting hardware resource is switched to a container corresponding to the target application scenario according to a preset configuration, or the conflicting hardware resource is shared by the container corresponding to the source application scenario and the container corresponding to the target application scenario in a time-division multiplexing manner.
The preset configuration may be a configuration such as preset brightness, a preset font size, and the like, and the specific parameters may be set differently according to different application scenarios.
In this embodiment, when an APP, such as a video APP, a take-away APP, an intelligent door lock APP, a map APP, a browser APP, a music playing APP, and the like, acquires an application scene switching instruction of a user, acquires a resource descriptor of a container corresponding to a source application scene (a current application scene) and a resource descriptor of a container corresponding to an application scene (a target application scene) to be switched, and determines whether hardware resources of the resource descriptor of the container corresponding to the source application scene are the same as hardware resources of the resource descriptor of the container corresponding to the target application scene. When the hardware resources are the same, the current container may be switched to a container corresponding to the target application scenario in an overlay manner, and output contents of the target container are displayed through the display terminal, or the contents output by the current container and the contents output by the target container are simultaneously displayed through the display terminal in a time division multiplexing manner, for example, each of the contents may occupy 50% of a screen of the display terminal, and as shown in fig. 4, each of the application scenario one and the application scenario two occupies half of the screen; when the hardware resources are different, the corresponding hardware resources can be directly controlled to work.
Therefore, in the method for rapidly switching application scenarios of the embodiment of the present disclosure, an APP acquires a plurality of accessed smart devices in advance, broadcasts a hardware report message to the plurality of smart devices, receives hardware resource information reported by the plurality of smart devices, generates a hardware resource library according to the hardware information reported by the plurality of smart devices, that is, completes establishment of the hardware resource library, establishes corresponding containers for the plurality of application scenarios in advance, respectively, establishes corresponding virtual machines in the containers corresponding to the application scenarios, calls corresponding hardware resources from the hardware resource library according to the hardware resources required by each application scenario and loads the hardware resources to the corresponding virtual machines when acquiring the hardware resources required by the plurality of application scenarios, generates a resource descriptor corresponding to each container and used for describing the hardware resources loaded by each virtual machine according to the hardware resources loaded by each virtual machine, acquires a resource descriptor corresponding to the container of a source application scenario after acquiring an application scenario switching instruction of a user, and determines whether a resource descriptor corresponding to the container of the source application scenario conflicts and a resource descriptor corresponding to the container of the target application scenario conflict, and switches the application resources of the application scenarios to the corresponding containers according to a preset time sharing mode of the hardware resources when acquiring the application scenarios and the application scenarios. Therefore, compared with the prior art that hardware resources need to be called among different servers when application scenes are switched and the same hardware resource occupies conflict, the application scenes can be switched quickly by loading the corresponding hardware resource through the virtual machine corresponding to the application scenes when the application scenes are switched and switching among a plurality of containers, and user experience is improved.
Fig. 7 is a block diagram illustrating a fast switching apparatus for application scenarios according to an embodiment of the present disclosure, and as shown in fig. 7, the fast switching apparatus 700 for application scenarios according to an embodiment of the present disclosure includes: a loading module 710, an instruction fetching module 720, and a switching module 730.
The loading module 710 is configured to acquire hardware resources required by multiple application scenarios, and load corresponding hardware resources through a virtual machine corresponding to each application scenario; the virtual machine is established in the container corresponding to the application scene. The instruction obtaining module 720 is configured to obtain an application scene switching instruction. The switching module 730 is configured to switch between multiple containers according to the application scenario switching instruction.
In an embodiment of the disclosure, a plurality of containers share a display terminal, and one container among the plurality of containers occupies the display terminal, the switching module 730 obtains a current container occupying the display terminal, obtains a target container according to an application scene switching instruction, and displays output content of the target container through the display terminal.
In one embodiment of the present disclosure, the switching module 730 opens a new window on the display terminal and displays the output content of the target container in the new window.
In an embodiment of the present disclosure, the above apparatus further includes: the acquisition module is used for acquiring a plurality of accessed intelligent devices; the broadcast module is used for broadcasting hardware report information to a plurality of intelligent devices; the receiving module is used for receiving the hardware resource information reported by the intelligent equipment; and the first generation module is used for generating a hardware resource library according to the hardware information reported by the plurality of intelligent devices.
In an embodiment of the present disclosure, the loading module 710 invokes, according to the hardware resource required by each application scenario, a corresponding hardware resource from the hardware resource library and loads the hardware resource to the corresponding virtual machine.
In an embodiment of the present disclosure, the above apparatus further includes: the second generation module is used for generating a resource descriptor corresponding to each container according to the hardware resource loaded by each virtual machine; the resource descriptor is used for describing the hardware resource loaded by each virtual machine.
In an embodiment of the present disclosure, the switching module 730 includes: the acquisition unit is used for acquiring the resource descriptor of the container corresponding to the source application scene and the resource descriptor of the container corresponding to the target application scene; the judging unit is used for judging whether the resource descriptor of the container corresponding to the source application scene and the resource descriptor of the container corresponding to the target application scene have hardware resource conflict or not; and the switching unit is used for switching the conflicted hardware resource to the container corresponding to the target application scene according to preset configuration when the hardware resource confliction exists, or sharing the conflicted hardware resource by the container corresponding to the source application scene and the container corresponding to the target application scene according to a time-sharing multiplexing mode.
In one embodiment of the present disclosure, the application scene switching instruction is generated by a voice instruction or a gesture instruction of a user, or generated by a network event.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
According to the quick flower cutting device for the application scenes, the corresponding containers are respectively established for the application scenes in advance, the corresponding virtual machines are established in the containers corresponding to the application scenes, the hardware resources needed by the application scenes are obtained through the loading module, the corresponding hardware resources are loaded through the virtual machines corresponding to the application scenes, the application scene switching instruction is obtained through the instruction obtaining module, and the switching module switches among the containers according to the application scene switching instruction. Therefore, compared with the prior art that hardware resources need to be called among different servers when application scenes are switched, the device can realize the quick switching of the application scenes by loading the corresponding hardware resources through the virtual machines corresponding to the application scenes when the application scenes are switched and switching among a plurality of containers, and user experience is improved.
To achieve the above object, the present disclosure also provides an electronic device, including: a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement the above-mentioned fast switching method of the application scenario.
Fig. 8 is a block diagram of a structure of an electronic device according to an embodiment of the present disclosure.
As shown in fig. 8, the electronic device 800 includes: a memory 810 and a processor 820, and a bus 830 connecting the various components, including the memory 810 and the processor 820.
Wherein, the memory 810 is used for storing executable instructions of the processor 820; the processor 801 is configured to call and execute the executable instructions stored in the memory 802 to implement the calibration method of the electronic compass in the robot proposed by the above-mentioned embodiments of the present disclosure.
Bus 830 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
The electronic device 800 typically includes a variety of electronic device readable media. Such media may be any available media that is accessible by electronic device 800 and includes both volatile and nonvolatile media, removable and non-removable media.
Memory 810 may also include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 840 and/or cache memory 850. The electronic device 800 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 860 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 8, and commonly referred to as a "hard drive"). Although not shown in FIG. 8, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 830 by one or more data media interfaces. Memory 810 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the disclosure.
A program/utility 880 having a set (at least one) of program modules 870, each of which may include an implementation of the network environment in each or some combination of examples, may be stored in, for example, memory 810, such program modules 870 including, but not limited to, an operating system, one or more functions, other program modules, and program data. Program modules 870 generally perform the functions and/or methodologies of embodiments described in this disclosure.
The electronic device 800 may also communicate with one or more external devices 890 (e.g., keyboard, pointing device, display 891, etc.), with one or more devices that enable a user to interact with the electronic device 800, and/or with any devices (e.g., network card, modem, etc.) that enable the electronic device 800 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 892. Also, the electronic device 800 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the internet) via the network adapter 893. As shown, the network adapter 893 communicates with the other modules of the electronic device 800 over a bus 830. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processor 820 executes various functional applications and data processing by executing programs stored in the memory 810.
It should be noted that, for the implementation process of the electronic device according to the embodiment of the present disclosure, reference is made to the foregoing explanation of the method according to the embodiment of the present disclosure, and details are not described here again.
To achieve the above object, the present disclosure also proposes a non-transitory computer-readable storage medium, in which instructions, when executed by a processor of an electronic device, enable the electronic device to perform the above-mentioned fast switching method of application scenarios.
In order to implement the foregoing embodiments, the present disclosure also provides a computer program product, which, when executed by a processor of an electronic device, enables the electronic device to execute the fast switching method of application scenarios as described above.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
according to the embodiment of the disclosure, corresponding containers are respectively established for a plurality of application scenes in advance, corresponding virtual machines are established in the containers corresponding to the application scenes, when hardware resources required by the application scenes are obtained, the corresponding hardware resources are loaded through the virtual machines corresponding to the application scenes, and when an application scene switching instruction is obtained, switching is performed among the containers according to the application scene switching instruction. Therefore, compared with the prior art that hardware resources need to be called among different servers when application scenes are switched, the application scenes can be rapidly switched by loading the corresponding hardware resources through the virtual machines corresponding to the application scenes when the application scenes are switched and the multiple containers are switched, and user experience is improved.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements 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 (18)

1. A method for fast switching application scenes is characterized by comprising the following steps:
acquiring hardware resources required by a plurality of application scenes, and loading corresponding hardware resources through a virtual machine corresponding to each application scene; the virtual machine is established in the container corresponding to the application scene;
acquiring an application scene switching instruction;
and switching among the containers according to the application scene switching instruction.
2. The method of claim 1, wherein a plurality of the containers share a display terminal, and one of the plurality of the containers occupies the display terminal, and the switching between the plurality of the containers according to the application scene switching instruction comprises:
acquiring a current container occupying the display terminal;
and acquiring a target container according to the application scene switching instruction, and displaying the output content of the target container through the display terminal.
3. The method of claim 2, wherein the displaying the output content of the target container via the display terminal comprises:
and opening a new window on the display terminal, and displaying the output content of the target container in the new window.
4. The method of claim 1, further comprising:
acquiring a plurality of accessed intelligent devices;
broadcasting a hardware report message to a plurality of intelligent devices;
receiving hardware resource information reported by a plurality of intelligent devices;
and generating a hardware resource library according to the hardware information reported by the intelligent equipment.
5. The method of claim 4, wherein loading the corresponding hardware resource through the virtual machine corresponding to each of the application scenarios comprises:
and calling corresponding hardware resources from the hardware resource library according to the hardware resources required by each application scene and loading the hardware resources to the corresponding virtual machine.
6. The method of claim 4, further comprising:
generating a resource descriptor corresponding to each container according to the hardware resources loaded by each virtual machine; wherein the resource descriptor is used for describing the hardware resource loaded by each virtual machine.
7. The method of claim 6, wherein said switching between a plurality of said containers according to said application scenario switching instructions comprises:
acquiring a resource descriptor of a container corresponding to a source application scene and a resource descriptor of a container corresponding to a target application scene;
judging whether a hardware resource conflict exists between the resource descriptor of the container corresponding to the source application scene and the resource descriptor of the container corresponding to the target application scene;
and if the hardware resource conflict exists, switching the conflicting hardware resource to a container corresponding to the target application scene according to a preset configuration, or sharing the conflicting hardware resource by the container corresponding to the source application scene and the container corresponding to the target application scene in a time division multiplexing mode.
8. The method of claim 1, wherein the application context switching instruction is generated by a voice instruction or a gesture instruction of a user, or is generated by a network event.
9. An apparatus for fast switching application scenes, comprising:
the loading module is used for acquiring hardware resources required by a plurality of application scenes and loading corresponding hardware resources through a virtual machine corresponding to each application scene; the virtual machines are established in the containers corresponding to the application scenes;
the instruction acquisition module is used for acquiring an application scene switching instruction;
and the switching module is used for switching among the containers according to the application scene switching instruction.
10. The apparatus according to claim 9, wherein a plurality of the containers share a display terminal, and one of the plurality of containers occupies the display terminal, and the switching module obtains a current container occupying the display terminal, obtains a target container according to the application scene switching instruction, and displays output content of the target container through the display terminal.
11. The apparatus of claim 10, wherein the switching module opens a new window on the display terminal and displays the output content of the target container in the new window.
12. The apparatus of claim 9, further comprising:
the acquisition module is used for acquiring a plurality of accessed intelligent devices;
the broadcasting module is used for broadcasting a hardware report message to the plurality of intelligent devices;
the receiving module is used for receiving the hardware resource information reported by the intelligent equipment;
and the first generating module is used for generating a hardware resource library according to the hardware information reported by the intelligent equipment.
13. The apparatus according to claim 12, wherein the loading module invokes a corresponding hardware resource from the hardware resource library according to a hardware resource required by each of the application scenarios and loads the hardware resource to the corresponding virtual machine.
14. The apparatus of claim 12, further comprising:
a second generating module, configured to generate a resource descriptor corresponding to each container according to the hardware resource loaded by each virtual machine; wherein the resource descriptor is used for describing the hardware resource loaded by each virtual machine.
15. The apparatus of claim 14, wherein the switching module comprises:
the acquisition unit is used for acquiring the resource descriptor of the container corresponding to the source application scene and the resource descriptor of the container corresponding to the target application scene;
a judging unit, configured to judge whether a hardware resource conflict exists between the resource descriptor of the container corresponding to the source application scenario and the resource descriptor of the container corresponding to the target application scenario;
and the switching unit is used for switching the conflicted hardware resource to the container corresponding to the target application scene according to preset configuration when the hardware resource confliction exists, or sharing the conflicted hardware resource by the container corresponding to the source application scene and the container corresponding to the target application scene according to a time-sharing multiplexing mode.
16. The apparatus of claim 9, wherein the application scenario switching instruction is generated by a voice instruction or a gesture instruction of a user, or is generated by a network event.
17. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the fast switching method of application scenarios of any one of claims 1-8.
18. A non-transitory computer-readable storage medium, wherein instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the fast switching method of application scenarios of any one of claims 1-8.
CN202110608940.9A 2021-06-01 2021-06-01 Application scene fast switching method and device, electronic equipment and storage medium Pending CN115437723A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110608940.9A CN115437723A (en) 2021-06-01 2021-06-01 Application scene fast switching method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110608940.9A CN115437723A (en) 2021-06-01 2021-06-01 Application scene fast switching method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115437723A true CN115437723A (en) 2022-12-06

Family

ID=84240426

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110608940.9A Pending CN115437723A (en) 2021-06-01 2021-06-01 Application scene fast switching method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115437723A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115878296A (en) * 2023-03-06 2023-03-31 南京芯驰半导体科技有限公司 Resource management method and device, electronic equipment and readable storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115878296A (en) * 2023-03-06 2023-03-31 南京芯驰半导体科技有限公司 Resource management method and device, electronic equipment and readable storage medium

Similar Documents

Publication Publication Date Title
EP3754490B1 (en) User interface rendering method and apparatus, and terminal
CN112004086B (en) Video data processing method and device
CN102053871B (en) Application program image display method and device
CN109542614B (en) Resource allocation method, device, terminal and storage medium
EP4013003A1 (en) Communication protocol switching method, apparatus and system
CN103777999A (en) Android software simulation method and device
CN110955499B (en) Processor core configuration method, device, terminal and storage medium
US20150193185A1 (en) Data processing method and electronic device
CN113342455B (en) Layer processing method based on multiple operating systems and vehicle-mounted machine system
US20210224014A1 (en) Display method, display system and vehicle
CN111790148A (en) Information interaction method and device in game scene and computer readable medium
CN113961295A (en) Device interaction control method and device, electronic device and readable storage medium
US11989814B2 (en) Image processing method and apparatus, electronic device, and storage medium
CN111865630B (en) Topological information acquisition method, device, terminal and storage medium
CN115437723A (en) Application scene fast switching method and device, electronic equipment and storage medium
CN111327875B (en) Scene switching method and device and storage medium
CN110362375A (en) Display methods, device, equipment and the storage medium of desktop data
CN110933221A (en) Audio channel management method, device, terminal and storage medium
WO2022110939A1 (en) Device recommendation method and electronic device
CN115629809A (en) Data processing method and device, electronic equipment and computer readable storage medium
AU2022309659A1 (en) Video playing method and apparatus, and storage medium
CN114124165B (en) Method and electronic device for Bluetooth communication
CN113827953A (en) Game control system
CN112817718A (en) Dual-system device, application display method thereof and storage medium
JP2012212253A (en) Control program, portable terminal, and control program for virtual machine

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