Interface switching method and electronic device
By receiving trigger instructions and obtaining context data of the target interface, fine-grained switching of interface processes, contents and layout of the terminal device is achieved, which solves the problem of unintelligent interface switching in the prior art and improves user experience and interface switching efficiency.
Patent Information
- Application Number
- CN202110483579.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-30
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2041-04-30
AI Technical Summary
In the prior art, the interface switching method of the terminal device is not intelligent enough to meet the diverse interface switching needs of users, resulting in poor user experience.
By receiving trigger instructions, obtaining context data associated with the target interface, fine-grained switching of interface processes, content information and layout is achieved, multi-level queue caching and the least recent algorithm refresh data, improving the efficiency and user experience of interface switching .
It realizes a smarter interface switching function, avoids conflicts in interface switching requests, and improves the efficiency of user experience and interface switching.
Smart Images

Figure CN115268736B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal display, and in particular to an interface switching method and an electronic device. Background Art
[0002] With the development of terminals, the functions of terminals represented by mobile phones are becoming more and more powerful, and the applications supported by the terminals are becoming more and more abundant. When using the terminals, users often need to switch back and forth between multiple interfaces of multiple applications.
[0003] Currently, users can switch interfaces by clicking on a jump link; or users can switch to the interfaces of multiple applications displayed in the task manager based on the task manager, but users can only switch to the most recently opened interface of different applications through the task manager. The current interface switching method is not smart enough and cannot meet the diverse interface switching needs of users, resulting in a poor user experience. Summary of the invention
[0004] In view of the above problems in the prior art, the present application provides an interface switching method and an electronic device, which can provide users with a more intelligent interface switching function and optimize the user experience.
[0005] To achieve the above object, the present application provides a first aspect of an interface switching method, comprising:
[0006] Display the first interface;
[0007] Receive a trigger instruction, the trigger instruction is used to trigger the interface switching; the trigger instruction includes the process of the second interface and the content information of the second interface;
[0008] Acquire context data associated with the second interface according to the process of the second interface and the content information of the second interface contained in the trigger instruction;
[0009] Switch from the displayed first interface to the second interface according to the context data associated with the second interface.
[0010] As described above, based on the interface switching method provided in this aspect, the interface switching granularity includes the switching to process and content information, the interface switching granularity is refined, and the conflict of interface switching requests can be effectively avoided.
[0011] As an implementation manner of the first aspect, the second interface is an interface that has been opened historically; the cache stores the process of the second interface, content information of the second interface, and context data associated with the second interface.
[0012] From the above, the second interface is an interface that has been opened historically, that is, the relevant interface information and jump information of the second interface are stored in the cache, thereby realizing fast switching of the second interface.
[0013] As an implementation manner of the first aspect, the process of the second interface, the content information of the second interface, and the context data associated with the second interface are cached in the cache in the form of queues.
[0014] As described above, a multi-level queue is used to implement hierarchical caching of the process of the second interface, the content information of the second interface, and the context data associated with the second interface. Each level may not affect each other, making the cache more flexible.
[0015] As an implementation of the first aspect, the trigger instruction further includes: the layout of the second interface. As described above, by making the interface switching granularity also include the interface layout, the interface can be switched to the granularity of the interface layout, avoiding the conflict of interface switching requests.
[0016] As an implementation manner of the first aspect, the context data associated with the second interface is a link to jump to the second interface or address information of the second interface.
[0017] As an implementation of the first aspect, after switching from the displayed first interface to the second interface, the method further includes:
[0018] The data stored in the cache is refreshed using a least recently used algorithm.
[0019] As described above, by using the least recently used algorithm to refresh the data stored in the cache, the update of the new and old nodes is achieved.
[0020] As an implementation method of the first aspect, when the second interface requested by the trigger instruction is opened for the first time, the process, content information and context data matching the interface are extracted, and the extracted process, content information and context data matching the interface are stored.
[0021] As described above, when the second interface requested by the trigger instruction is opened for the first time, the above information related to the second interface is stored for easy use next time, which can improve the speed and efficiency of switching to the second interface next time and improve the user experience.
[0022] As an implementation method of the first aspect, when the trigger instruction is a voice trigger instruction, the slot information of the trigger instruction is obtained through voice recognition; the process of the second interface, the content information of the second interface and the context data associated with the second interface are determined according to the slot information.
[0023] As an implementation manner of the first aspect, the second interface is a network interface opened by interacting with the server; or, the second interface is a local interface.
[0024] As an implementation manner of the first aspect, the second interface is a shopping item related interface.
[0025] As an implementation manner of the first aspect, the second interface is an album-related interface.
[0026] A second aspect of the present application provides an electronic device, including:
[0027] A display module, used for displaying a first interface;
[0028] A receiving module, used to receive a trigger instruction, wherein the trigger instruction is used to trigger the interface switching; the trigger instruction includes the process of the second interface and the content information of the second interface;
[0029] an acquisition module, configured to acquire context data associated with the second interface according to the process of the second interface and the content information of the second interface contained in the trigger instruction;
[0030] A switching module is used to switch from the displayed first interface to the second interface according to the context data associated with the second interface.
[0031] As an implementation manner of the second aspect, the second interface is an interface that has been opened historically; the cache stores the process of the second interface, content information of the second interface, and context data associated with the second interface.
[0032] As an implementation manner of the second aspect, the process of the second interface, the content information of the second interface, and the context data associated with the second interface are cached in the cache in the form of queues.
[0033] As an implementation manner of the second aspect, the trigger instruction also includes: a layout of the second interface.
[0034] As an implementation of the second aspect, the context data associated with the second interface is a link to jump to the second interface or address information of the second interface. As an implementation of the second aspect, after switching from the displayed first interface to the second interface, further comprising:
[0035] The data stored in the cache is refreshed using a least recently used algorithm.
[0036] As an implementation of the second aspect, when the second interface requested by the trigger instruction is opened for the first time, the process, content information and context data matching the interface are extracted, and the extracted process, content information and context data matching the interface are stored.
[0037] As an implementation method of the second aspect, when the trigger instruction is a voice trigger instruction, the slot information of the trigger instruction is obtained through voice recognition; the process of the second interface, the content information of the second interface and the context data associated with the second interface are determined according to the slot information.
[0038] As an implementation manner of the second aspect, the second interface is a network interface opened for interaction with the server; or, the second interface is a local interface.
[0039] As an implementation of the second aspect, the second interface is a shopping product related interface. As an implementation of the second aspect, the second interface is an album related interface.
[0040] The third aspect of the present application provides a terminal, including a memory and a processor, wherein the memory stores executable code, and the processor executes the executable code to implement the interface switching method described in any one of the first aspects above.
[0041] A fourth aspect of the present application provides a computer-readable storage medium having program instructions stored thereon, and when the program instructions are executed by a computer, the computer executes the interface switching method described in any one of the first aspects above.
[0042] The fifth aspect of the present application provides a computer program product, which, when executed on a computing device, enables the computing device to execute the interface switching method described in any one of the first aspects. These and other aspects of the present application will be more concise and understandable in the description of the following (multiple) embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] The following further illustrates the various features of the present application and the connections between the various features with reference to the accompanying drawings. The accompanying drawings are all exemplary, and some features are not shown in actual proportion. Some drawings may omit features that are conventional in the field involved in the present application and are not necessary for the present application, or additional features that are not necessary for the present application may be shown. The combination of the various features shown in the accompanying drawings is not intended to limit the present application. In addition, throughout this specification, the same figure numerals refer to the same content. The specific description of the drawings is as follows:
[0044] Figure 1 A schematic diagram of the structure of a terminal to which the interface switching method provided in an embodiment of the present application is applicable;
[0045] Figure 2 A flowchart of an interface switching method provided in an embodiment of the present application;
[0046] Figure 3 An example diagram of a data structure of an interface summary and context data corresponding to the interface summary provided in an embodiment of the present application;
[0047] Figure 4 An example diagram of a data structure of another interface summary and context data corresponding to the interface summary provided in an embodiment of the present application;
[0048] Figure 5 A flowchart of another implementation of an interface switching method provided in an embodiment of the present application;
[0049] Figure 6 Another flow chart of an interface switching method provided in an embodiment of the present application;
[0050] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0051] The words "first, second, third, etc." or module A, module B, module C and other similar terms in the specification and claims are only used to distinguish similar objects and do not represent a specific ordering of the objects. It is understandable that the specific order or sequence can be interchanged where permitted so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0052] In the following description, the reference numerals representing the steps, such as S110, S120, etc., do not necessarily mean that the steps will be executed in this manner. The order of the steps before and after can be interchanged or performed simultaneously if permitted. If permitted, more or fewer steps can also be included, and this specification does not impose any special restrictions thereon.
[0053] The term "comprising" as used in the description and claims should not be interpreted as being limited to what is listed thereafter; it does not exclude other elements or steps. Therefore, it should be interpreted as specifying the presence of the features, integers, steps or components mentioned, but does not exclude the presence or addition of one or more other features, integers, steps or components and groups thereof. Therefore, the expression "a device comprising means A and B" should not be limited to a device consisting of components A and B only.
[0054] References to "one embodiment" or "an embodiment" in this specification mean that a particular feature, structure, or characteristic described in conjunction with the embodiment is included in at least one embodiment of the present application. Therefore, the phrases "in one embodiment" or "in an embodiment" appearing in various places in this specification do not necessarily refer to the same embodiment, but may refer to the same embodiment. In addition, in one or more embodiments, the particular features, structures, or characteristics can be combined in any appropriate manner, as would be apparent to one of ordinary skill in the art from this disclosure.
[0055] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present application. In case of any inconsistency, the meaning described in this specification or the meaning derived from the contents recorded in this specification shall prevail. In addition, the terms used herein are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.
[0056] Before further describing the specific implementation methods of the present application in detail, the nouns and terms involved in the embodiments of the present application, as well as their corresponding uses, effects, functions, etc. in the embodiments of the present application are described. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations:
[0057] 1. Interface summary technology: It is a technology that extracts the most representative information in the interface to form a summary of the interface. The direct purpose of the interface summary is to identify the interface so as to realize the recognition, distinction and retrieval of the interface through the identification. Among them, the coarse-grained interface summary can include the process corresponding to the interface as the summary of the interface; the fine-grained interface summary can include the summary of the interface obtained by analyzing the content displayed on the interface. Therefore, the granularity of the interface summary is related to its ability to resolve request conflicts. The fine-grained interface summary can avoid the phenomenon of business request conflicts.
[0058] 2. Least Recently Used (LRU) algorithm: It is a page replacement algorithm. The least recently used algorithm is used to eliminate the pages that have not been used for the longest time, that is, to eliminate the unused pages with the longest time from the current time.
[0059] The embodiment of the present application provides an interface switching method, which caches information of opened interfaces for users to switch interfaces, thereby optimizing the user interface switching experience. The embodiment of the present application is described in detail below in conjunction with the accompanying drawings.
[0060] First, a scenario in which an interface switching method provided in an embodiment of the present application is applied is introduced.
[0061] The interface switching method provided in the embodiment of the present application can be applied to any terminal with a display screen and basic interactive functions, such as mobile phones, tablet computers, wearable devices with wireless communication functions (for example: smart watches, bracelets, smart helmets, etc.), vehicle-mounted devices, smart furniture, augmented reality (AR) devices, virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants (PDA), etc. In the interface switching method provided in the embodiment of the present application, the user can initiate an interface trigger command through natural language or touch buttons, and respond to the trigger command on the terminal to achieve rapid switching of a specific interface. Using this method, the switching of a specific interface can be achieved, the intelligence of the interface switching can be improved, and the user experience can be improved.
[0062] The following is an example of applying the method provided in the embodiment of the present application to a mobile phone with a display screen and basic interactive functions.
[0063] For example, Figure 1 A schematic diagram of the structure of a terminal 100 to which an embodiment of the present application is applicable is shown.
[0064] like Figure 1 As shown, the terminal 100 may include a processor 110, a memory 120, a charging management module 130, a power management module 131, a battery 132, an antenna 1, an antenna 2, a mobile communication module 140, a wireless communication module 150, an audio module 160, a speaker 160A, a receiver 160B, a microphone 160C, a button 170, a motor 171, an indicator 172 and a display screen 172, etc. Among them.
[0065] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the terminal 100. In other embodiments of the present application, the terminal 100 may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0066] The processor 110 is used to execute the interface switching method provided in the embodiment of the present application. The processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and / or a neural-network processing unit (neural-network processing unit, NPU), etc. Among them, different processing units can be independent devices or integrated in one or more processors.
[0067] As an implementation method, the processor 110 can be a neural network (NN) computing processor, which can quickly process input information by drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, and can also continuously self-learn, so as to realize applications such as intelligent cognition of the terminal 100, such as voice command recognition, text command understanding, etc.
[0068] The memory 120 can be used to store computer executable program codes, that is, the computer executable program codes involved in the interface switching method provided in the embodiment of the present application can be stored, including the storage of the interface summary and context data that have been opened. In some embodiments, the memory 120 can be a cache memory. The memory 120 can save instructions or data that have been used or used frequently by the processor 110. If the processor 110 needs to use the instruction or data, it can be directly called from the memory 120. Repeated access is avoided, and the waiting time of the processor 110 is reduced, thereby improving the efficiency of the system. In some embodiments, the memory 120 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.). The data storage area can store data created during the use of the terminal 100, etc. In addition, the internal memory 120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional methods or data processing of the terminal 100 by running instructions stored in the memory 120 and / or instructions stored in the memory provided in the processor. The charging management module 130 is used to receive charging input from the charger. The charger may be a wireless charger or a wired charger. In some embodiments of wired charging, the charging management module 130 may receive charging input from the wired charger through the USB interface 130. In some embodiments of wireless charging, the charging management module 130 may receive wireless charging input through the wireless charging coil of the terminal 100. While the charging management module 130 is charging the battery 132, it may also power the electronic device through the power management module 131.
[0069] The power management module 131 is used to connect the battery 132, the charging management module 130 and the processor 110. The power management module 131 receives input from the battery 132 and / or the charging management module 130, and supplies power to the processor 110, the internal memory 121, the display screen 172, and the wireless communication module 150. The power management module 131 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 131 can also be set in the processor 110. In other embodiments, the power management module 131 and the charging management module 130 can also be set in the same device.
[0070] The wireless communication function of the terminal 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 140, the wireless communication module 150, the modem processor and the baseband processor.
[0071] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in terminal 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0072] The mobile communication module 140 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied on the terminal 100. The mobile communication module 140 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 140 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 140 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 140 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 140 can be set in the same device as at least some of the modules of the processor 110.
[0073] The wireless communication module 150 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), bluetooth low energy (BLE), ultra wide band (UWB), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the terminal 100. The wireless communication module 150 can be one or more devices integrating at least one communication processing module. The wireless communication module 150 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 150 can also receive the signal to be sent from the processor 110, modulate the frequency, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0074] In some embodiments, antenna 1 of terminal 100 is coupled to mobile communication module 140, and antenna 2 is coupled to wireless communication module 150, so that terminal 100 can communicate with the network and other electronic devices through wireless communication technology.
[0075] The terminal 100 can realize the display function through a GPU, a display screen 172, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 172 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.
[0076] The display screen 172 is used to display the first interface or the second interface, etc. The display screen 172 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light emitting diode (QLED), etc. In some embodiments, the terminal 100 may include one or more display screens 172.
[0077] The terminal 100 can realize the camera function through the camera module 193, ISP, video codec, GPU, display screen 172, application processor AP, neural network processor NPU, etc.
[0078] The terminal 100 can implement audio functions such as music playing and recording through the audio module 160, the speaker 160A, the receiver 160B, the microphone 160C, the earphone interface 170D, and the application processor.
[0079] The audio module 160 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 160 can also be used to encode and decode audio signals. In some embodiments, the audio module 160 can be arranged in the processor 110, or some functional modules of the audio module 160 can be arranged in the processor 110.
[0080] The speaker 160A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The terminal 100 can listen to music or output an audio signal for a hands-free call through the speaker 160A.
[0081] The receiver 160B, also called a "handset", is used to convert received voice triggering instructions (electrical signals) into sound signals.
[0082] Microphone 160C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals, for example, converting voice commands into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 160C to input the sound signal into the microphone 160C. The terminal 100 may be provided with at least one microphone 160C. In other embodiments, the terminal 100 may be provided with two microphones 160C, which, in addition to collecting sound signals, may also implement a noise reduction function. In other embodiments, the terminal 100 may also be provided with three, four or more microphones 160C to collect sound signals, reduce noise, identify the source of sound, implement a directional recording function, and the like.
[0083] The key 170 may include a power key, a volume key, etc. The key 170 may be a mechanical key or a touch key. The terminal 100 may receive key input and generate key signal input related to user settings and function control of the terminal 100.
[0084] Motor 171 can generate vibration prompts. Motor 171 can be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 172, motor 171 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
[0085] The indicator 172 may be an indicator light, which may be used to indicate the charging status, power change, or may be used to indicate messages, notifications, etc.
[0086] For example, Figure 2 As shown, an interface switching method provided by an embodiment of the present application is provided. The method includes steps S110-S150, and each step is introduced in turn below:
[0087] S110: The terminal receives an interface trigger instruction initiated by the user and parses the trigger instruction.
[0088] As an optional implementation method, the user can actively initiate a trigger instruction to the terminal interface through the terminal's interface interaction entrance. The trigger instruction includes but is not limited to: a trigger instruction initiated by voice (for example, a voice trigger instruction "open a memo", "open a hot search of a certain social software", etc.) and a trigger instruction initiated by a touch button (for example, a user clicks on an album icon), etc.
[0089] Specifically, if the trigger instruction obtained by analysis is an instruction to open an interface, such as opening a new interface, for example, clicking a touch button on the interface, or the intention of the voice instruction is to open an interface, step S120 is executed; if the trigger instruction obtained by analysis is an instruction to initiate an interface jump, for example, jumping back to a previously browsed interface, step S140 is executed. The interface jump instruction can be triggered by a quick jump control of the interface, or when the intention of the voice instruction is to quickly jump to the interface.
[0090] As an optional implementation, the instruction to open the interface may be the first time the interface requested by the instruction is opened in the terminal, or the interface summary and its corresponding context data requested by the instruction are not stored in the buffer of the terminal. The interface jump instruction is not the first time the interface requested by the instruction is opened in the terminal, that is, the interface summary and its corresponding context data requested by the instruction are stored in the buffer of the terminal.
[0091] As another optional implementation, if the trigger instruction is an instruction triggered by voice, then the instruction can also be determined to be an instruction to open the interface or an instruction to initiate an interface jump by performing voice recognition on the instruction. For example: when the instruction includes relevant words such as open and turn on, the instruction is judged to be an instruction to open the interface; when the instruction includes relevant words such as jump, go to, switch, return, etc. obtained through voice recognition, the instruction is judged to be an instruction to initiate an interface jump. For another example: the instruction can also be determined to be an instruction to open the interface or an instruction to initiate an interface jump based on a natural language processing model. Among them, the natural language processing model can be a natural language processing model based on deep learning, and this embodiment does not impose specific restrictions on the natural language processing model.
[0092] S120: The terminal displays the interface requested by the trigger instruction according to the trigger instruction, and extracts an interface summary of the interface.
[0093] As an optional implementation, after receiving the trigger instruction, the terminal may initiate a request to the server to call the interface requested in the trigger instruction, and when the requested interface sent by the server is received, the interface is displayed. When displaying the interface, or after displaying it, the terminal may extract the interface summary of the interface using the interface summary technology. For example, the received trigger instruction may be: opening a popular video of a short video application, opening an order of a food delivery software, etc.
[0094] As another optional implementation, after receiving the trigger instruction, the terminal may also directly obtain the summary and related context data of the interface corresponding to the trigger instruction from the terminal locally, and display the interface. When displaying the interface, or after displaying the interface, the terminal may extract the interface summary of the interface using the interface summary technology. For example, the received trigger instruction may be: open a memo, open a notepad, open an album, etc.
[0095] Optionally, the trigger instruction is a user voice instruction, and the requested interface is displayed according to the semantics carried by the trigger instruction.
[0096] S130: The terminal stores the interface summary extracted in step S120 and the context data corresponding to the interface summary in a buffer.
[0097] The context data corresponding to the interface summary is used to jump to the interface according to the interface summary. The context data corresponding to the interface can be a link to the interface, such as a URL link, an interface address, etc. The context data corresponding to the interface can also be in other forms, which are not limited in the embodiments of the present application.
[0098] Optionally, the terminal may also refresh the cached interface summary, for example, by using an LRU algorithm to refresh the cached interface summary in the cache.
[0099] Specifically, in this step, the interface summary cached in the cache is refreshed using the LRU algorithm, including: inserting a new interface summary in the cache of the terminal, that is, inserting a new node in the nth layer of the interface summary, when the number of nodes in the layer exceeds the constraint length of the layer, the least recently used node is deleted according to the LRU strategy, and a new node is inserted, that is, the node at the head of the queue of the layer (the least recently used node) is deleted, and the new node is inserted at the end of the queue of the layer. Where n∈{1,2,3}, respectively represents process, layout, and content.
[0100] S140: The terminal obtains, according to the trigger instruction, from a cache an interface summary that matches the interface requested by the trigger instruction and context data corresponding to the interface summary.
[0101] As an optional implementation, the data structure of the interface summary and the context data corresponding to the interface summary is as follows: Figure 3 As shown, the data structure including the interface summary and the context data corresponding to the interface summary is as follows Figure 3 As shown, it includes an interface summary part 410 and context data 420 for implementing jumping to a corresponding interface according to the interface summary.
[0102] Specifically, the interface summary part 410 includes processes and content. In the process, max_lem1 can be used to constrain the length of the layer. When the number of process nodes in the layer exceeds max_lem1, the process nodes are refreshed using the LRU algorithm. In the content, max_lem2 can be used to constrain the length of the layer. When the number of content nodes in the layer exceeds max_lem2, the content nodes are refreshed using the LRU algorithm.
[0103] Specifically, the context data 420 is Figure 3 The page context (PageContext) shown. For example, in an Android system, the context data is context class data.
[0104] As another optional implementation, the data structure of the interface summary and the context data corresponding to the interface summary is as follows: Figure 4 As shown, it includes an interface summary part 510 and context data 520 for implementing jumping to a corresponding interface according to the interface summary.
[0105] Optionally, the interface summary part 510 may include processes, layouts, and content. In the process, max_len1 may be used to constrain the length of the layer. When the number of process nodes in the layer exceeds max_len1, the process nodes are refreshed using the LRU algorithm. In the layout, max_len2 may be used to constrain the length of the layer. When the number of layout nodes in the layer exceeds max_len2, the layout nodes are refreshed using the LRU algorithm. In the content, max_len3 may be used to constrain the length of the layer. When the number of content nodes in the layer exceeds max_len3, the content nodes are refreshed using the LRU algorithm.
[0106] Specifically, in this step, the LRU algorithm is used to refresh nodes at each layer, including: performing a matching query in the terminal's cache, when the nth layer in the interface summary is successfully retrieved, that is, the match is successful, then the layer updates the node position according to the LRU strategy, and moves the node to the end of the layer queue, indicating the most recently accessed node. Among them, n∈{1,2,3}, respectively represents the interface process, interface layout, and interface content.
[0107] In this embodiment, the context data 520 is Figure 4The interface context (PageContext) shown. In an embodiment of the present application, the process in the interface summary is the application name or software ID package name, for example: Application B. The layout in the interface summary is the preset presentation method of the interface, for example: the layout of the product details page in shopping software A is a continuous equal-width picture layout; another example: the layout of the chat box of social software C is the other party's avatar and the other party's message box on the left, and the person's avatar and the person's message box on the right. The content in the interface summary is specific information of the text, specific information of the picture, etc. For example: the current temperature of a certain area displayed in a certain meteorological software.
[0108] In this embodiment, the specific implementation method of step S140 is illustrated by taking the trigger instruction as a voice instruction as an example. First, the received voice instruction needs to be parsed to obtain the intent and slot of the voice instruction. For example: the intent is a quick jump interface (it can also be other intent names, such as return interface, jump interface, switch interface, etc.). According to the slot of the voice instruction, an interface summary that matches the interface requested by the trigger instruction and the context data corresponding to the interface summary are obtained from the cache. For example: the trigger instruction is "return to the details page of product a of shopping application AXXX item number". First, the intent of the voice instruction is obtained as a quick jump interface. Then, the slot of the voice instruction is extracted as: "Shopping application A, product a of XXX item number, details page" based on Figure 4 The interface summary and the data structure of the context data corresponding to the interface summary are shown, and it is determined that the "shopping application A" in the instruction corresponds to the process in the data structure, so the process = shopping application A; it is determined that the "details page" in the instruction corresponds to the "layout" in the data structure, so the layout = details page; it is determined that the "commodity a of XXX item number" in the instruction corresponds to the "content" in the data structure, so the content = commodity a of XXX item number. According to "process = shopping application A, layout = details page, content = commodity a of XXX item number", the interface summary matching the interface requested by the trigger instruction is obtained from the cache, and the context data corresponding to the interface summary is obtained.
[0109] S150: The terminal jumps to a corresponding interface and displays the interface according to the interface summary obtained in step S140 and the context data corresponding to the interface summary.
[0110] In addition, if the interface summary and / or corresponding context data of the interface requested by the trigger instruction are not obtained in step S140, the trigger instruction is not responded to.
[0111] The process of extracting the interface summary of the interface by using the interface summary technology in the above step S130 is described in detail below. As an optional implementation method, the interface summary includes process and content.
[0112] First, identify the process to which the interface belongs, and store the process to which the interface belongs in the form of a string, for example: F process =str(process name). The process may be an application name or a software ID package name. For example, the process to which the interface belongs may be photo album, music, shopping application, reading, etc.
[0113] Then, the content displayed on the interface is identified, including the text content and image content of the interface, and the content displayed on the interface is stored in the form of a string, for example: content =Summarize text (TextView)+Summarize image (ImageView). Among them, F content is the content displayed on the interface, Summarize is the summary function used to extract the summary; text Summarize is a function for extracting the summary of the interface text content. image This is a function for extracting the summary of the interface image content. TextView is the text content of the interface, and ImageView is the image content of the interface.
[0114] Finally, the interface summary is constructed according to the process to which the interface belongs and the hierarchy of the interface content.
[0115] As another optional implementation, the interface summary may also include a layout, that is, in this embodiment, the interface summary includes a process, a layout, and a content.
[0116] First, the process to which the interface belongs is identified. This process is substantially the same as the process of identifying the process to which the interface belongs in the previous embodiment, so it will not be described in detail here.
[0117] Secondly, identify the layout of the interface. In this step, firstly, the Extensible Markup Language (XML) corresponding to the interface layout needs to be obtained, and the maximum depth, number of image nodes, and number of text nodes of the interface layout are obtained based on the XML parsing, and the maximum depth, number of image nodes, and number of text nodes of the interface layout are stored in the form of a string, for example: layout =(Depth(XML),Counter(XML,ImageView),Counter(XML,TextView). Among them, F layoutis the layout of the interface, Depth(XML) is the node depth obtained based on XML parsing, Counter(XML,ImageView) is the number of image nodes obtained based on XML parsing, and Counter(XML,TextView) is the number of text nodes obtained based on XML parsing.
[0118] Then, the content displayed on the identification interface is identified. This process is basically the same as the process of identifying the content displayed on the interface in the previous embodiment, so it will not be described in detail here.
[0119] Finally, the interface summary is constructed according to the process to which the interface belongs, the interface layout and the content of the interface.
[0120] It is understandable that the steps and technical features in this embodiment are only examples and do not limit the embodiments of the present invention. Those skilled in the art may use more or fewer steps / technical means to implement the interface switching solution of the present invention.
[0121] It is understandable that the interface summary involved in S120-S150 in this embodiment can also be replaced with other content, such as the title of the interface, the keywords of the interface, the hot words of the interface, the picture information of the interface, the time information of the interface, part or all of the text information of the entire interface, etc., so that the electronic device can match other information of the interface associated with the voice command to obtain the context data of the target interface, thereby switching to the interface corresponding to the context data. That is, the embodiment of the present application can not only realize interface switching (jump) by using the interface summary of the cache interface as an index, but also realize interface switching through other content of the interface. The embodiment of the present application is not limited to this.
[0122] Based on the above embodiments, the embodiments of the present invention provide Figure 5 Another embodiment shown. This embodiment is described by taking the example of a user switching between various interfaces of a mobile phone.
[0123] S210: The user is browsing the mobile phone, and after viewing multiple interfaces of the video application P, the user views multiple interfaces of the memo application.
[0124] When the user views the multiple interfaces of the video application P and the multiple interfaces of the memo, the mobile phone can cache the interface information of the multiple interfaces viewed by the user. For example, when the user opens the corresponding interface, the mobile phone can summarize the interface and cache the interface summary / keywords and interface address. The cached interface information can be as described above. Figure 2 The embodiments shown in the figure are described in detail and will not be described again here.
[0125] For example, the user browses the travel item list recorded on March 1, 2021 and the content recorded on April 14, 2021 in the mobile phone memo note. The first interface currently displayed by the mobile phone is the content recorded on April 14, 2021 in the memo note.
[0126] The mobile phone summarizes the above interface and caches the summary and context data of the above interface.
[0127] S220: When viewing the interface corresponding to April 14, 2021 in the memo, the mobile phone receives a first voice trigger instruction. For example, the voice trigger instruction is "open product b in application B". The trigger instruction is parsed to obtain that the trigger instruction is an instruction to open the interface. The process of parsing the trigger instruction is the same as step S110 of the above embodiment, so it will not be repeated here.
[0128] S230: The mobile phone switches from the first interface in step S210 to the interface corresponding to the product b in application B according to the first voice trigger instruction, and extracts the interface summary of the interface by using the interface summary technology.
[0129] In one example, the interface summary of the interface is: process = application B, content = commodity b. The interface summary of process = application B, content = commodity b and the context data corresponding to the interface summary are stored in the cache of the terminal. The interface summary cached in the cache and the context data corresponding to the interface summary are refreshed using the LRU algorithm, and the interface summary and the corresponding context data corresponding to the interface requested this time are added to the tail of the queue, and the interface summary and the context data corresponding to the interface at the head of the queue are deleted.
[0130] S240: The mobile phone receives a second voice trigger instruction, for example, "return to the movie P in the video application P that was just browsed".
[0131] S250: Analyze the second voice trigger instruction.
[0132] When the mobile phone receives the voice trigger command, it parses the trigger command and finds that the trigger command is an instruction to initiate an interface jump, and obtains the slot / parameter of the trigger command as "video application P, movie p", and further parses the target process in the command as "video application P" and the target content as "movie p".
[0133] S260: The mobile phone obtains the interface summary that matches the target process and target content of the trigger instruction from the cache, and obtains the context data corresponding to the interface summary. That is, the mobile phone determines the interface summary that matches "video application P" and "movie p", and obtains the context data corresponding to the summary, which is the resource link of movie p in video application P.
[0134] S270: According to the interface summary obtained in step S260 and the context data corresponding to the interface summary, switch to the corresponding interface and display the interface.
[0135] Specifically, the mobile phone can obtain the content of movie p according to the resource link of movie p in the video application P and open a page displaying movie p in the video application P.
[0136] Optionally, when the display is successful, it is necessary to use the LRU algorithm to refresh the interface summary and its corresponding context data cached in the cache, that is, to move the summary of the interface requested this time and its corresponding context data to the end of the queue of this layer.
[0137] S280: The mobile phone receives the third voice trigger command and switches to the interface requested by the third voice trigger command, for example, "return to the page recorded on March 1, 2021 in the memo", or "return to the travel item list in the memo".
[0138] According to a processing process similar to S240-S270, the mobile phone switches from the interface of the movie p in the currently displayed video application P to the page of the travel item list recorded on March 1, 2021 in the memo application.
[0139] It is understandable that the steps and technical features in this embodiment are only examples and do not limit the embodiments of the present invention. Those skilled in the art may use more or fewer steps / technical means to implement the interface switching solution of the present invention.
[0140] As described in the aforementioned embodiments, the interface summary cached in the embodiments of the present invention may also be replaced with other content, such as the title of the interface, keywords of the interface, hot words of the interface, picture information of the interface, time information of the interface, part or all of the text information of the entire interface, etc., so that the electronic device can match other information of the interface associated with the voice command to obtain the context data of the target interface, thereby switching to the interface corresponding to the context data. That is, the embodiments of the present application can not only realize interface switching (jump) by using the interface summary of the cached interface as an index, but also realize interface switching through other content of the interface. The embodiments of the present application are not limited to this.
[0141] Based on the interface switching method provided in the embodiment of the present application, unified modeling of interface process, interface layout and interface content is achieved, and a finer-grained interface identification is provided, which can effectively avoid request conflicts. In addition, the interface switching method provided in the embodiment of the present application adopts a multi-level queue to realize hierarchical caching of interface summaries, and each level sets a separate queue length. The nodes and node positions of each queue can be updated separately through the LRU algorithm, making the cache more flexible and ensuring that the updates of new and old nodes at each level are independent of each other and do not affect each other.
[0142] Based on the above embodiments, Figure 6 As shown, it is a flow chart of an interface switching method provided by another embodiment of the present application. The relevant contents and descriptions of the above multiple embodiments are applicable to this embodiment and will not be repeated here. The method mainly includes steps S310-S340, and each step is introduced in turn below:
[0143] S310: Displaying the first interface.
[0144] The first interface is the interface currently displayed on the terminal screen. Optionally, the first interface can be any interface of the terminal, such as an interface of an application or a desktop of the terminal.
[0145] S320: Receive a trigger instruction, the trigger instruction is used to trigger the interface switching; the trigger instruction includes the process of the second interface and the content information of the second interface. The second interface may be an interface that has been opened in the past.
[0146] As an optional implementation, the terminal cache stores the process of the second interface, the content information of the second interface, and the context data associated with the second interface in the form of a queue. Specifically, the data structure of the cache of the process of the second interface, the content information of the second interface, and the context data associated with the second interface is as shown in the above embodiment. Figure 3 As shown, it will not be described again here.
[0147] As another optional implementation, the terminal cache also stores the layout of the second interface in the form of a queue. That is, the terminal cache stores the process of the second interface, the layout of the second interface, the content information of the second interface, and the context data associated with the second interface in the form of a queue. Specifically, the data structure of the cache is as shown in the above embodiment. Figure 4 As shown, it will not be described again here.
[0148] S330: Acquire context data associated with the second interface according to the process of the second interface and the content information of the second interface contained in the trigger instruction, wherein the context data associated with the second interface is a link to jump to the second interface or address information of the second interface.
[0149] Specifically, the specific implementation method of this step can refer to step S140 in the above embodiment, which will not be described in detail here.
[0150] S340: Switching from the displayed first interface to the second interface according to the context data associated with the second interface.
[0151] Specifically, the specific implementation method of this step can refer to step S150 in the above embodiment, so that the terminal switches from displaying the first interface to the second interface, and this embodiment will not repeat this step.
[0152] In an embodiment of the present application, if the relevant information of the second interface requested to be opened by the trigger instruction does not exist in the cache of the terminal, the second interface should be requested from the server at this time. When the second interface requested by the trigger instruction is opened for the first time, the process, content information and context data matching the interface are extracted, and the extracted process, content information and context data matching the interface are stored. In this step, the process of extracting the process, content information and context data matching the interface is basically the same as the process of extracting the interface summary of the interface in step S120 in the above embodiment; storing the extracted process, content information and context data matching the interface is basically the same as the process of storing the extracted interface summary and the context data corresponding to the interface summary in the cache in step S130 in the above embodiment, so it will not be repeated here.
[0153] Another embodiment of the present application further provides an interface switching device, which can be implemented by a software system, can also be implemented by a hardware device, and can also be implemented by a combination of a software system and a hardware device.
[0154] It should be understood that Figure 7 This is only a schematic diagram of a structure of an electronic device, and the present application does not limit the division of functional modules in the interface switching device. Figure 7 As shown, the electronic device can be logically divided into multiple modules, each module can have different functions, and the function of each module can be realized by a processor in the computing device reading and executing instructions in the memory. Exemplarily, the interface switching device includes a display module 610, a receiving module 620, an acquisition module 630 and a switching module 640.
[0155] In one embodiment, the interface switching device is used to perform Figure 6The contents described in steps S310-S340 shown. Specifically, it may be: a display module 610, used to display the first interface. A receiving module 620, used to receive a trigger instruction, the trigger instruction is used to trigger an interface switch; the trigger instruction includes the process of the second interface and the content information of the second interface. The acquisition module 630 is used to acquire context data associated with the second interface according to the process of the second interface and the content information of the second interface contained in the trigger instruction. A switching module 640, used to switch from the displayed first interface to the second interface according to the context data associated with the second interface. It should be noted that the embodiment of the present application only exemplarily divides the structure and functional modules of the interface switching device, but does not impose any restrictions on its specific division.
[0156] For example, in this embodiment, the display module 610 may be the above Figure 1 The display screen 173 in the terminal 100 shown in the figure displays the first interface or the second interface in this embodiment through the display screen 173. The receiving module 620 in this embodiment can be Figure 1 The audio module 160 in the terminal 100 shown receives the trigger instruction through the audio module 160, and converts the trigger instruction (digital audio information) into an analog audio signal and transmits it to the acquisition module 630. The acquisition module 630 and the switching module 640 in this embodiment can be the above Figure 1 The processor 110 in the terminal 100 shown is used to implement interface switching. In addition, the program instructions in this embodiment can be stored in Figure 1 The memory 120 in the terminal 100 is shown. It can be understood that the present application does not limit the division of each module in the interface device, and it can also be implemented in other ways.
[0157] Optionally, the second interface is an interface that has been opened historically; the cache stores the process of the second interface, content information of the second interface, and context data associated with the second interface.
[0158] In one implementation, the process of the second interface, the content information of the second interface, and the context data associated with the second interface are cached in the cache in the form of queues, respectively.
[0159] In one implementation, the trigger instruction also includes: the layout of the second interface.
[0160] Optionally, the context data associated with the second interface is a link to jump to the second interface or address information of the second interface.
[0161] Optionally, after switching from the displayed first interface to the second interface, the method further includes:
[0162] The data stored in the cache is refreshed using a least recently used algorithm.
[0163] In one implementation, when the second interface requested by the trigger instruction is opened for the first time, the process, content information and context data matching the interface are extracted, and the extracted process, content information and context data matching the interface are stored.
[0164] Optionally, when the trigger instruction is a voice trigger instruction, the slot information of the trigger instruction is obtained by voice recognition; the process of the second interface, the content information of the second interface and the context data associated with the second interface are determined according to the slot information.
[0165] In one implementation, the second interface is a network interface opened for interaction with a server; or, the second interface is a local interface.
[0166] The specific implementation of each functional module in this embodiment can refer to the introduction in the above method embodiment, and this embodiment will not describe it in detail.
[0167] Another embodiment of the present application further provides an electronic device, including a memory and a processor, wherein the memory stores executable code, and the processor executes the executable code to implement the interface switching method provided in the above embodiment.
[0168] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the program is used to execute a method for generating diversified questions, which includes at least one of the solutions described in the above embodiments.
[0169] The computer storage medium of the embodiment of the present application can adopt any combination of one or more computer-readable media. Computer-readable media can be computer-readable signal media or computer-readable storage media. Computer-readable storage media can be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of the above. More specific examples (non-exhaustive lists) of computer-readable storage media include: electrical connections with one or more wires, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In this document, computer-readable storage media can be any tangible medium containing or storing programs, which can be used by instruction execution systems, devices or devices or used in combination with them.
[0170] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0171] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0172] Computer program code for performing the operation of the present application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., using an Internet service provider to connect through the Internet).
[0173] Note that the above are only preferred embodiments of the present application and the technical principles used. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may also include more other equivalent embodiments without departing from the concept of the present application, all of which belong to the protection scope of the present application.
Claims
1. An interface switching method, characterized in that: include: Display the first interface; Receive a trigger instruction, where the trigger instruction is used to trigger an interface switch; The trigger instruction includes the process of the second interface and the content information of the second interface; The trigger instruction also includes: the layout of the second interface; Acquire context data associated with the second interface according to the process of the second interface, the content information of the second interface and the layout of the second interface contained in the trigger instruction; the context data associated with the second interface is a link to jump to the second interface or address information of the second interface; Switching from the displayed first interface to the second interface according to the context data associated with the second interface; The process of the second interface, the content information of the second interface, the layout of the second interface and the context data associated with the second interface are cached in the cache in the form of queues, respectively, and a separate queue length is set for each queue; When the second interface requested by the trigger instruction is opened for the first time, the process, layout, content information and context data matching the interface are extracted using interface summary technology, and the extracted process, layout, content information and context data matching the interface are stored.
2. The method according to claim 1, characterized in that The second interface is an interface that has been opened historically; the cache stores the process of the second interface, the content information of the second interface, and the context data associated with the second interface.
3. The method according to claim 2, characterized in that After the display of the first interface is switched to the second interface, the method further includes: The data stored in the cache is refreshed using a least recently used algorithm.
4. The method according to claim 1, characterized in that When the trigger instruction is a voice trigger instruction, the slot information of the trigger instruction is obtained by voice recognition; the process of the second interface, the content information of the second interface and the context data associated with the second interface are determined according to the slot information.
5. The method according to claim 1, characterized in that The second interface is a network interface opened for interaction with the server; or, the second interface is a local interface.
6. The method according to claim 5, characterized in that The second interface is a shopping product related interface.
7. The method according to claim 5, characterized in that The second interface is an album related interface.
8. An electronic device, characterized in that: include: A display module, used for displaying a first interface; A receiving module, used for receiving a trigger instruction, wherein the trigger instruction is used for triggering an interface switch; The trigger instruction includes the process of the second interface and the content information of the second interface; The trigger instruction also includes: the layout of the second interface; an acquisition module, configured to acquire context data associated with the second interface according to the process of the second interface and the content information of the second interface contained in the trigger instruction; the context data associated with the second interface is a link to jump to the second interface or address information of the second interface; A switching module, configured to switch from the displayed first interface to the second interface according to the context data associated with the second interface; Wherein, the process of the second interface, the content information of the second interface and the context data associated with the second interface are cached in the cache in the form of queues respectively; When the second interface requested by the trigger instruction is opened for the first time, the process, layout, content information and context data matching the interface are extracted using interface summary technology, and the extracted process, layout, content information and context data matching the interface are stored.
9. The electronic device according to claim 8, characterized in that: The second interface is an interface that has been opened historically; the cache stores the process of the second interface, the content information of the second interface, and the context data associated with the second interface.
10. The electronic device according to claim 8, characterized in that: After the display of the first interface is switched to the second interface, the method further includes: Refreshes the data stored in the cache using a least recently used algorithm.
11. An electronic device comprising a memory and a processor, characterized in that: The memory stores executable code, and the processor executes the executable code to implement the interface switching method described in any one of claims 1-7.
12. A computer-readable storage medium having program instructions stored thereon, characterized in that: When the program instructions are executed by a computer, the computer executes the interface switching method according to any one of claims 1 to 7.
13. A computer program product, characterized in that When the computer program product is executed on a computing device, the computing device is enabled to execute the interface switching method according to any one of claims 1 to 7.
