A method for displaying an interface and a wearable device
By executing the switching animation rendering and interface construction in parallel within wearable devices and generating dynamic switching effects using interface screenshots, the problem of high response latency after dynamic switching is solved, improving user operation response speed and device smoothness.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HONOR DEVICE CO LTD
- Filing Date
- 2024-01-26
- Publication Date
- 2026-04-28
AI Technical Summary
Wearable devices experience high response latency after dynamic interface switching, making it difficult to respond to user operations in a timely manner, resulting in a poor user experience.
During the dynamic switching process, the switching animation is drawn and the second interface is constructed in parallel. The switching animation is generated by taking screenshots of the first and second interfaces, and the second interface is constructed and displayed at the same time.
It reduces response latency, improves the response speed of wearable devices after dynamic switching, and enhances the immediacy of user operation and the smoothness of the device.
Smart Images

Figure CN120429042B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, and in particular to a method for displaying an interface and a wearable device. Background Technology
[0002] More and more wearable devices can achieve dynamic switching between interfaces. For example, when switching interfaces, wearable devices display a switching animation where the interface to be displayed moves in from one side of the screen and the displayed interface moves out from the other side of the screen.
[0003] Typically, wearable devices use screenshots of the interface to be displayed and the currently displayed interface to generate and render transition animations before displaying them. After the transition animation is displayed, the wearable device can first show the screenshot of the interface to be displayed, visually completing the interface transition. This way, during dynamic transitions, it's not necessary to use the actual interface to be displayed to generate the transition animation, thus eliminating the need to render every element in the interface, reducing computational load and improving the smoothness of the transition animation. However, after a dynamic transition, the wearable device cannot respond to user actions on the display screen immediately, resulting in higher response latency. Summary of the Invention
[0004] This application provides a method for displaying an interface and a wearable device, which can reduce the response latency of the wearable device after dynamically switching interfaces.
[0005] To achieve the above objectives, the embodiments of this application adopt the following technical solutions:
[0006] Firstly, a method for displaying an interface is provided, applied to a wearable device, the wearable device including a display screen. The method includes: displaying a first interface; receiving a first operation from a user on the first interface, the first operation triggering the wearable device to display a second interface; responding to the first operation, generating and displaying a transition animation from the first interface to the second interface based on a first screenshot and a second screenshot; simultaneously constructing and drawing the second interface in response to the first operation; and displaying the second interface after displaying the transition animation. Wherein, the first interface is a screenshot of the first interface, and the second screenshot is a screenshot corresponding to the second interface.
[0007] As can be seen, the display interface method provided in this application allows the wearable device to execute the drawing of switching animations and the construction of the second interface in parallel during the dynamic interface switching process. This shortens the waiting time for the wearable device to display the second interface, enabling it to display the actually constructed second interface more quickly. Therefore, it can reduce response latency and respond more quickly to user operations on the display screen.
[0008] In one possible implementation of the first aspect, the wearable device can be, for example, a smartwatch or a smart bracelet. Since smartwatches or smart bracelets are lightweight wearable devices, they typically include only one processor and execute various UI tasks based on a single UI main thread. Applying this application to smartwatches or smart bracelets can significantly improve the speed of displaying a second interface and reduce response latency.
[0009] In one possible implementation of the first aspect, the first interface is the display interface of a first app in the wearable device, and the second interface is the display interface of a second app in the wearable device. This reduces the response latency when switching between interfaces of different apps.
[0010] In one possible implementation of the first aspect, the first app and the second app are different. The second app is a desktop app for the wearable device, and the desktop app's display interface includes the icon of the first app. The desktop app's display interface can be the main interface of the wearable device. This solution enables dynamic switching when returning to the main interface from another app's interface while reducing response latency after the switch.
[0011] In one possible implementation of the first aspect, the first APP and the second APP can be the same APP, and the first interface and the second interface are different interfaces of the same APP.
[0012] In one possible implementation of the first aspect, the first app and the second app are different. The second app is the initial interface of the wearable device's desktop app, and the desktop app's display interface includes the icon of the first app. This solution enables dynamic switching when returning from another app's interface to the main interface's initial interface, while reducing response latency after the switch.
[0013] In one possible implementation of the first aspect, the wearable device includes a UI main thread, which is used to construct and draw the interface to be displayed. In response to a first operation, the first thread generates a switching animation based on a first screenshot and a second screenshot; the switching animation is then displayed. Simultaneously, in response to the first operation, the UI main thread constructs and draws a second interface. The first thread and the UI main thread run in parallel. The wearable device can respond to the first operation by running the first thread and the UI main thread in parallel. Specifically, the wearable device generates and displays the switching animation by running the first thread. The wearable device constructs and draws the second interface by running the UI main thread. The parallel operation of the first thread and the UI thread helps improve the speed at which the wearable device displays the second interface and reduces response latency.
[0014] In one possible implementation of the first aspect, the wearable device includes an interrupt module that can send interrupts to a first thread and the UI main thread, driving the first thread and the UI main thread to run. In response to a first operation, the UI main thread sets the state of a first parameter to a first state. The interrupt module periodically reads the state of the first parameter and, based on the state, instructs the first thread to call the GPU to draw the switching animation, and instructs the UI main thread to construct a second interface based on the state of the first parameter, or to call the GPU to draw the second interface. Specifically, if the state of the first parameter is the first state, the interrupt module sends an interrupt signal to the first thread and the UI main thread; wherein the interrupt signal is used to instruct the first thread to draw the switching animation and instruct the UI main thread to construct and draw the interface to be displayed based on the state of the first parameter. In response to the interrupt signal, the first thread draws each frame of the switching animation; wherein, after all the images of the switching animation are displayed, the first thread sets the state of the first parameter to a second state. In response to the first interrupt signal, the UI main thread reads the state of the first parameter. If the state of the first parameter is the first state, it constructs the interface data of the interface to be displayed until construction is complete. In response to the next interrupt signal, it reads the state of the first parameter. If the state of the first parameter is the second state, then the GPU is invoked to draw the second interface based on the created interface data and display it. This provides a possible implementation method for the UI main thread and the first thread to run in parallel.
[0015] In one possible implementation of the first aspect, the wearable device includes an interrupt module that can send interrupt signals to a first thread and the UI main thread, driving the first thread and the UI main thread to run. In response to a first operation, the UI main thread sets the state of a first parameter to a first state and the state of a second parameter to a first state. The interrupt module periodically reads the state of the first parameter and, based on the state of the first parameter, instructs the first thread to call the GPU to draw the switching animation, and instructs the UI main thread to construct a second interface based on the states of the first and second parameters, or to call the GPU to draw the second interface. Specifically, if the state of the first parameter is the first state, the interrupt module sends an interrupt signal to the first thread and the UI main thread; wherein the interrupt signal is used to instruct the first thread to draw the switching animation and instruct the UI main thread to construct and draw the interface to be displayed based on the state of the first parameter. In response to the interrupt signal, the first thread draws each frame of the switching animation; wherein, after all the images of the switching animation are displayed, the first thread sets the state of the first parameter to the second state. In response to the first interrupt signal, the UI main thread reads the state of the first parameter. If both the state of the first parameter and the state of the second parameter are the first state, the interface data for the interface to be displayed is constructed until construction is complete. In response to the next interrupt signal, the state of the first parameter is read. If the state of the first parameter is the second state and the state of the second parameter is the first state, the state of the second parameter is corrected to the second state. Afterward, the UI main thread uses the GPU to draw the second UI based on the created UI data and displays it. This provides another possible implementation method for the UI main thread and the first thread to run in parallel.
[0016] In one possible implementation of the first aspect, the switching animation includes M image frames, where M is an integer greater than 1.
[0017] At time i, the interrupt module sends the i-th interrupt signal to the first thread based on the first parameter being in the first state. In response to the i-th interrupt signal, the first thread generates the i-th image frame in the switching animation based on the first screenshot of the first interface and the second screenshot of the second interface. i takes values sequentially in (1,2,3,...,M) until the switching animation is drawn and displayed. At the first time, the interrupt module sends the first interrupt signal to the UI main thread based on the first parameter being in the first state. In response to the first interrupt signal, the UI main thread constructs the second interface until the second interface is completed. Afterward, the UI main thread can respond to the next interrupt signal by calling the GPU to draw the second interface based on the created interface data and display it. The next interrupt signal can be the M+a-th interrupt signal, where a is an integer greater than 1. Another possible implementation method for the UI main thread and the first thread to run in parallel is provided.
[0018] In one possible implementation of the first aspect, the UI main thread does not respond to interrupt signals until it has completed constructing the UI data for the interface to be displayed. The UI main thread only responds to interrupt signals after it has completed constructing the UI data for the interface to be displayed.
[0019] In one possible implementation of the first aspect, if the state of the first parameter is the second state, the interrupt module only sends an interrupt signal to the UI main thread. If the state of the first parameter is the first state, the interrupt module sends interrupt signals to both the UI main thread and the first thread. This provides a mechanism for the UI main thread and the first thread to run in parallel.
[0020] A second aspect provides a wearable device, the wearable device comprising: a memory, a display screen, and a processor; the memory, the display screen, and the processor are coupled; wherein the memory is used to store computer program code, the computer program code including computer instructions; when the computer instructions are executed by the processor, the wearable device performs the method as described in any of the first aspects.
[0021] Thirdly, this application provides a chip system applicable to wearable devices including memory. The chip system includes one or more interface circuits and one or more processors. The interface circuits and processors are interconnected via lines. The interface circuits are used to receive signals from the aforementioned memory and send the signals to the processor, the signals including computer instructions stored in the memory. When the processor executes the computer instructions, the wearable device performs the method as described in the first aspect and any of its possible design embodiments.
[0022] Fourthly, this application provides a computer-readable storage medium including computer instructions. When the computer instructions are executed on a wearable device, they cause the wearable device to perform the method as described in the first aspect and any of its possible design embodiments.
[0023] Fifthly, this application provides a computer program product that, when run on a computer, causes the computer to perform a method as described in the first aspect and any of its possible design methods.
[0024] Understandably, the beneficial effects that can be achieved by the wearable device of any of the possible designs of the second aspect, the chip system of the third aspect, the computer-readable storage medium of the fourth aspect, and the computer program product of the fifth aspect can be referred to as the beneficial effects of the first aspect and any of its possible designs, which will not be repeated here. Attached Figure Description
[0025] Figure 1 A flowchart illustrating a dynamic interface switching process for related technologies;
[0026] Figure 2 This is a schematic diagram of the hardware structure of a wearable device provided in an embodiment of this application;
[0027] Figure 3 This is a schematic diagram of the software architecture of a wearable device provided in an embodiment of this application;
[0028] Figure 4 A flowchart illustrating a method for displaying an interface provided in an embodiment of this application;
[0029] Figure 5 This is a schematic diagram of an interface display method provided in an embodiment of this application;
[0030] Figure 6 This is a schematic diagram of a switching animation provided in an embodiment of this application;
[0031] Figure 7 This application provides a schematic diagram of the interaction process between internal threads and modules of a wearable device.
[0032] Figure 8 This is a schematic diagram illustrating the interaction process between internal threads and modules of a wearable device, as provided in an embodiment of this application. Detailed Implementation
[0033] More and more wearable devices can dynamically switch between interfaces. For example, when switching interfaces, such as from one interface to another, wearable devices typically display a switching animation. This animation could be, for instance, the first interface fading out and the second interface fading in; the first interface moving out from one side of the display and the second interface moving in from the other side; or the first interface gradually shrinking from large to small and the second interface gradually enlarging from small to large. Wearable devices may include a display screen. Optionally, the wearable device can be a smartwatch or a smart bracelet.
[0034] Typically, wearable devices render dynamic transition effects based on screenshots of the interface. This eliminates the need to use the actual interface to generate the transition animation during dynamic switching, thus reducing computational load and improving the smoothness of the transition. However, after a dynamic transition, wearable devices cannot respond promptly to user actions on the display, resulting in high latency. To achieve longer battery life, wearable devices often use single-core low-power processors with limited processing power. Furthermore, wearable devices generally employ a single user interface (UI) thread to handle UI tasks. This single UI thread can be the main UI thread. During dynamic interface transitions, the main UI thread must sequentially execute tasks such as input event processing, rendering and displaying transition animations, and constructing and rendering the interface to be displayed. This leads to high latency in wearable products after dynamic transitions.
[0035] The following uses a smartwatch as an example of a wearable device to introduce a dynamic interface switching method provided by related technologies. The smartwatch executes S1-S5, switching from the current interface of the desktop application (APP) to the initial interface of the exercise APP.
[0036] S1: The smartwatch displays the current interface of the desktop app. The current interface includes the application icons of the apps installed on the smartwatch.
[0037] S2, in response to the user's operation 1 on the smartwatch's display screen, the smartwatch takes a screenshot of the current interface displayed on the screen.
[0038] The current interface displayed on the screen is as shown in Interface 1, and the screenshot is a screenshot of that interface. Figure 1 Operation 1 is used to trigger a switch in the smartwatch's interface. For example, Operation 1 could be the user clicking the app icon of a workout app. Figure 1 This refers to the desktop interface of the workout app displayed on the current screen when the user clicks the app icon. The smartwatch will then capture... Figure 1 Cached in buffer1.
[0039] At the same time, the smartwatch captures a screenshot of the initial interface of the desktop app, such as... Figure 2 For example, cut Figure 2 This is a screenshot of the initial screen of a desktop app when the user enters from the lock screen and has not swiped. Figure 2 It can be pre-stored in the smartwatch. The smartwatch will then intercept... Figure 2 It's cached in buffer2. It should be understood that the desktop app's interface can be considered the smartwatch's main interface.
[0040] S3, the smartwatch creates the initial interface of the workout app as shown in interface 2, and obtains a screenshot of interface 2. Figure 3 .
[0041] Smartwatches can intercept Figure 3 It is cached in buffer3.
[0042] S4, smartwatch according to screenshot Figure 1 and intercept Figure 3 Draw the transition animation 1 and send it to the display.
[0043] After displaying the transition animation 1, the S5 smartwatch shows the initial interface of the built-in workout app, namely interface 2.
[0044] In this way, the smartwatch can dynamically switch from the current interface of the desktop app to the initial interface of the workout app.
[0045] Furthermore, to shorten the switching time between the current interface of the desktop app and the initial interface of the exercise app, the smartwatch can directly obtain screenshots of interface 2 pre-configured in the smartwatch. Figure 3 Afterwards, the smartwatch, based on the screenshot... Figure 1 and intercept Figure 3 Draw and display transition animation 1. After displaying transition animation 1, the smartwatch can first display a screenshot. Figure 3 The smartwatch re-builds its interface 2. This shortens the switching time, but due to the... Figure 3 This is not the actual interface; it's just a screenshot. If the user is currently taking a screenshot... Figure 3 When performing actions such as clicking on controls, the smartwatch does not respond to any user input, giving the user the feeling that the smartwatch is running slowly.
[0046] Similarly, the same issue exists when the smartwatch returns from the current interface of the workout app to the initial interface of the desktop app. For example, the smartwatch executes steps S6-S11, switching from the current interface of the workout app to the initial interface of the desktop app.
[0047] The S6 smartwatch displays the current interface of the workout app.
[0048] The current interface could be, for example, interface 3.
[0049] S7, in response to the user's operation on the smartwatch's display screen 2, the smartwatch takes a screenshot of the current interface displayed on the screen.
[0050] A screenshot of the current interface could be, for example, a screenshot of... Figure 4 ,cut Figure 4 With intercept Figure 3 They can be the same or different. (Excerpt) Figure 4 This is a screenshot of the current interface of the exercise app. Figure 3 This is a screenshot of the initial interface of a workout app. The initial interface is the screen displayed after launching the workout app. For example, the interface when entering the workout app from the main screen and the user has not swiped. The current interface is the screen displayed when the user performs operation 2 on the screen. Operation 2 could be the user clicking the back control, swiping right on the screen, swiping left on the screen, etc. The smartwatch can capture the screenshot... Figure 4 Place it in buffer3.
[0051] S8, Smartwatch Usage Screenshot Figure 4 and intercept Figure 2 Draw the transition animation 2 and send it to the display.
[0052] In this example, transition effect 1 could be the desktop app's interface 1 fading out and the workout app's interface 2 fading in. Transition effect 2 could be the workout app's interface 3 gradually moving out from the right side of the screen and the desktop app's interface 4 gradually appearing.
[0053] After displaying the transition animation 2, the S9 smartwatch shows a screenshot. Figure 2 .
[0054] S10, the initial interface for building desktop apps on the smartwatch, is interface 4.
[0055] After the S11 is built, the smartwatch displays interface 4.
[0056] In this way, the smartwatch dynamically switches from the current interface of the workout app to the initial interface of the desktop app. In some embodiments, the smartwatch can also cache a screenshot of the third interface in buffer2. Thus, in response to user actions on the display, the smartwatch can acquire a screenshot of the desktop app interface, and based on the screenshots of the desktop app and the third interface, generate and display a switching animation effect from the desktop app to the third interface. The third interface can be another interface of the desktop app, or an interface of another app; this embodiment does not specifically limit its use.
[0057] Similarly, after S11, if the user takes a screenshot Figure 2 The above operation, due to the interception Figure 2 It's not the actual initial interface of a desktop app, and the smartwatch won't respond to any user actions, giving the user the feeling that the smartwatch is running slowly.
[0058] In summary, the smartwatch uses screenshots to dynamically switch between the first and second interfaces. After rendering and displaying the switching animation using a screenshot, the smartwatch first shows a screenshot of either the first or second interface, visually completing the interface transition. Then, the smartwatch constructs the actual second or first interface. Because the smartwatch displays a screenshot of the first or second interface, it won't respond to user actions within that screenshot, leading to a subjective feeling of lag and a poor user experience. Furthermore, the smartwatch only responds to user actions on the interface after constructing the actual first or second interface, resulting in a relatively high response latency.
[0059] Therefore, this application provides a display interface method applied to a wearable device. The wearable device can first display a first interface, and in response to a user's first operation on the first interface, trigger the wearable device to switch from displaying the first interface to displaying a second interface. Specifically, in response to the user's first operation on the first interface, the wearable device generates and displays a switching animation effect from the first interface to the second interface based on a first screenshot and a second screenshot. Simultaneously, the wearable device constructs the second interface during the generation and display of the switching animation effect. And after the display of the switching animation effect ends, the second interface is displayed.
[0060] As can be seen, the display interface method provided in this application allows the wearable device to execute the drawing of switching animations and the construction of the second interface in parallel during dynamic switching, shortening the waiting time for the wearable device to display the second interface. This enables the wearable device to display the actually constructed second interface more quickly. Therefore, it can reduce response latency and respond more quickly to user operations on the display screen.
[0061] The method provided in this application can be applied to wearable devices with data processing capabilities. The wearable device includes a display screen. For example, the wearable device may include a smartwatch and a smart bracelet; this application does not impose any limitations on this. In this application, the wearable device is one that can run an operating system and install applications. Optionally, the operating system running on the wearable device may be… system, system, The system, etc. This operating system could be, for example, a lightweight operating system.
[0062] For example, please refer to Figure 2The diagram illustrates the structure of a wearable device 200. The wearable device 200 may include a processor 210, an external memory interface 220, internal memory 221, an audio module 230, a speaker 230A, a microphone 230B, a display screen 240, a communication module 250, a power module 260, an input device 270, a sensor module 280, a camera 290, etc. The sensor module 280 may include pressure sensors, touch sensors, etc.
[0063] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the wearable device 200. In other embodiments of this application, the wearable device 200 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0064] Processor 210 may include one or more processing units. For example, processor 210 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), and / or a neural network processing unit (NPU). Different processing units may be independent components or integrated into one or more processors. In some embodiments, wearable device 200 may also include one or more processors 210.
[0065] The processor 210 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. This memory can store instructions or data that the processor 210 has just used or that are used repeatedly. If the processor 210 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 210, and thus improves the efficiency of the system.
[0066] In some embodiments, the processor 210 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a SIM card interface, and / or a USB interface, etc.
[0067] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the wearable device 200. In other embodiments of this application, the wearable device 200 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.
[0068] The external storage interface 220 can be used to connect an external storage card, such as a MicroSD card, to expand the storage capacity of the wearable device 200. The external storage card communicates with the processor 210 through the external storage interface 220 to perform data storage functions. For example, music, video, and other files can be saved on the external storage card.
[0069] Internal memory 221 can be used to store one or more computer programs, which include instructions. Processor 210 can execute the aforementioned instructions stored in internal memory 221, thereby causing wearable device 200 to perform application operation methods, various applications, and data management, etc., as provided in some embodiments of this application.
[0070] The wearable device 200 can implement audio functions through an audio module 230, a speaker 230A, a microphone 230B, and an application processor. Examples include music playback and recording. The audio module 230 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 230 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 230 can be located in the processor 210, or some functional modules of the audio module 230 can be located in the processor 210.
[0071] The 230A loudspeaker, also known as a "loudspeaker", is used to convert audio electrical signals into sound signals.
[0072] Microphone 230B, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals. Users can speak by bringing their mouth close to microphone 230B, inputting sound signals into microphone 230B.
[0073] The communication function of the wearable device 200 can be achieved through antenna 1, antenna 2 and communication module 250, etc.
[0074] The communication module 250 can provide wireless communication solutions for wearable devices 200, including cellular, Wi-Fi, Bluetooth, and wireless data transmission modules (e.g., 433MHz, 868MHz, 915MHz). The communication module 250 can be one or more devices integrating at least one communication processing module. The communication module 250 receives electromagnetic waves via antenna 1 or antenna 2, filters and frequency-modulates the electromagnetic wave signals, and sends the processed signal to processor 210. The communication module 250 can also receive signals to be transmitted from processor 210, frequency-modulate and amplify them, and then convert them into electromagnetic waves for radiation via antenna 1 or antenna 2.
[0075] Wearable device 200 implements display functions through a GPU, display screen 240, and application processor. The GPU is a microprocessor for image processing, connected to the display screen 240 and the application processor. The GPU performs mathematical and geometric calculations and is used for graphics rendering. Processor 210 may include one or more GPUs, which execute program instructions to generate or modify display information. In this embodiment, the UI main thread can call the GPU to draw the interface to be displayed. The first thread can call the GPU to draw each frame in the transition animation. It should be understood that the GPU can only be called by one thread at a time. Therefore, while the first thread is calling the GPU to draw each frame in the transition animation, the UI main thread can construct the second interface. Only after the first thread has completed its call does the UI main thread call the GPU to draw the second interface based on the constructed interface data.
[0076] The display screen 240 is used to display images, videos, etc. The display screen 240 includes a display panel. In some embodiments, the wearable device 200 may include one or N display screens 240, where N is a positive integer greater than 1. In this embodiment, the display screen 240 can be used to display a UI and receive user operations on the UI. In some embodiments, the display screen 240 is provided with pressure sensors, touch sensors, etc. In this embodiment, the display screen includes a display screen driver. The display screen driver can periodically retrieve image frames from a buffer that have been drawn in a switching animation and trigger the display screen to display the image frame, or a drawn second interface and trigger the display screen to display the second interface. In this embodiment, the display screen is used to display the display interface of an app installed in the wearable device 200, detect user operations on the display screen, such as a first operation, and trigger the system to respond to the operation.
[0077] The power module 260 can be used to power the various components included in the wearable device 200. In some embodiments, the power module 260 can be a battery, such as a rechargeable battery.
[0078] Input device 270 may include a keyboard, mouse, etc. The keyboard is used to input English letters, numbers, punctuation marks, etc., into wearable device 200, thereby issuing commands and inputting data to wearable device 200. The mouse is an indicator for the horizontal and vertical coordinate positioning of the wearable device 200 display system, used to input instructions into wearable device 200. Input device 270 can be connected to wearable device 200 via a wired connection, such as through a GPIO interface or USB interface. Input device 270 can also be connected to wearable device 200 wirelessly, such as through Bluetooth or infrared.
[0079] The wearable device 200 can achieve its shooting function through an ISP, camera 290, video codec, GPU, display 240, and application processor. The ISP processes data fed back by the camera 290. The camera 290 captures still images or videos. In some embodiments, the wearable device 200 may include one or N cameras 290, where N is a positive integer greater than 1. The digital signal processor processes digital signals, including digital image signals and other digital signals. For example, when the wearable device 290 selects a frequency, the digital signal processor performs a Fourier transform on the frequency energy. The video codec compresses or decompresses digital video.
[0080] Taking the aforementioned wearable device 200 as an example, which is a smartwatch, the software system of the wearable device 200 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This embodiment of the invention uses the layered architecture of the Android system as an example to exemplify the software structure of the wearable device 200.
[0081] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime, the system libraries, and the kernel layer.
[0082] The application layer can include a series of application packages.
[0083] like Figure 3 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, SMS, and social networking.
[0084] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0085] like Figure 3 As shown, the application framework layer may include a content provider, a view system, a resource manager, a notification manager, an input system, an interrupt module, a drawing module, an interface building module, etc.
[0086] The input system is used to monitor the phone's input modules (such as touchscreen drivers) and convert the parameters input by the input modules into usable events, which are then passed to the relevant upper-layer modules. For example, the input system is used to monitor the phone's touchscreen through the touchscreen driver and convert the touch parameters generated by the touchscreen input into usable events, which are then passed to the upper-layer APP.
[0087] Content providers store and retrieve data, making that data accessible to applications. This data can include videos, images, audio, phone calls made and received, browsing history and bookmarks, phone books, and more.
[0088] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build the display interface of an application.
[0089] The interrupt module is used to periodically issue interrupt signals. The interrupt module can periodically issue interrupt signals at a rate equal to 1 / 2 the display's frame rate. For example, if the display's frame rate is 60 frames per second, the interrupt module can send an interrupt signal every 16.6 seconds.
[0090] The interface construction module is used to build the interface data for the second interface. It loads the code for the second interface and constructs its interface data. For example, the interface construction module can build the page attributes of each view in the second interface. A view can be any interface element in the second interface, such as a button, text, icon, progress bar, etc. The page attributes of a view include its layout information in the second interface, its display information, and its interaction information. The layout information includes position, size, shape, etc.
[0091] The drawing module is used to call the GPU or CPU to draw the image that will be displayed on the screen. As in this embodiment, the drawing module can call the GPU to draw switching animations based on screenshots of the first interface and the second interface. The drawing module can also call the GPU to draw the already constructed second interface. For example, the drawn image can be placed in the display screen's buffer, and the display screen can retrieve the drawn image from the buffer and display it.
[0092] The notification manager allows applications to display notification information in the status bar. It can be used to convey informational messages and can disappear automatically after a short time without user interaction.
[0093] The Android Runtime comprises the core libraries and the virtual machine. The Android Runtime is responsible for the scheduling and management of the Android system. The core libraries consist of two parts: one part contains the functionalities that Java calls, and the other part is the core Android library itself. The application layer and application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0094] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.
[0095] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.
[0096] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.
[0097] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0098] A 2D graphics engine is a graphics engine for 2D drawing.
[0099] The kernel layer can include display drivers, sensor drivers, and audio drivers. The display driver can periodically retrieve drawn images from a buffer and trigger the display to show those images. These images can be frames from a transition animation or a secondary interface.
[0100] The following uses a smartwatch as an example of a wearable device to introduce a method for displaying an interface and a wearable device provided in the embodiments of this application. Figure 4 This is a flowchart illustrating a method for displaying an interface provided in an embodiment of this application.
[0101] The S401 smartwatch displays the first interface and receives the user's first operation on the first interface.
[0102] The first interface is the screen currently displayed on the smartwatch, and it can be any interface of any app. For example, the first interface could be the initial interface of a desktop app, or it could be the interface currently displayed on the desktop app after the user swipes on the initial interface. As another example, the first interface could be the initial interface of a workout app, or a workout app could include multiple interfaces, with the first interface being the currently displayed interface of the workout app.
[0103] The first operation is used to trigger the smartwatch to switch from the first interface to the second interface; that is, the first operation is used to trigger the smartwatch to display the second interface.
[0104] S402, in response to the user's first operation on the first interface, generates and displays a switching animation from the first interface to the second interface based on the first and second screenshots.
[0105] The second interface can be any interface of any app.
[0106] The first and second interfaces can be different interfaces from different apps. For example, the first interface can be the display interface of a first app, and the second interface can be the display interface of a second app. Alternatively, the first interface might be the currently displayed interface of a desktop app, and the second interface might be the initial interface of a workout app. The first operation specifically triggers the smartwatch to switch from the current interface of the desktop app to the initial interface of the workout app. For example, the first interface might be the currently displayed interface of the workout app, and the second interface might be the initial interface of the desktop app. The first operation specifically involves the user triggering the smartwatch to switch from the current interface of the workout app to the initial interface of the desktop app.
[0107] The first and second interfaces can be different interfaces within the same app. For example, a workout app may have multiple interfaces, and the first and second interfaces can be different interfaces within that app. Alternatively, the first and second interfaces can be interfaces at the same level within the same app, or interfaces at different levels within the same level app. For example, the first interface can be the parent interface of the second interface, or the first interface can be the child interface of the second interface.
[0108] The first action could be a tap or a swipe. For example, the first action could be tapping the workout app icon on the currently displayed screen of the desktop app. Alternatively, the first action could be tapping the back button on the currently displayed screen of the workout app. Swipe actions include swiping up, down, left, and right. Taking a finger swipe as an example, the first action could be swiping to the right of the point where the finger touches the screen, and then lifting the finger off the screen.
[0109] The swipe operation includes three processes: touching and pressing, swiping, and releasing. When the smartwatch detects that the user swipes and releases on the first screen, it displays a switching animation.
[0110] When the smartwatch detects that the user is swiping on the first screen, the smartwatch's display interface may remain unchanged. The switching animation will only be displayed when the user releases their hand.
[0111] Alternatively, when the smartwatch detects that the user is swiping on the first screen, the smartwatch can move the first screenshot of the first screen to the position of the screen and gradually display the second screenshot of the second screen. When the user releases their hand, a switching animation is displayed.
[0112] For example, the smartwatch displays a first interface. The smartwatch detects the user's finger pressing the display screen and acquires a first screenshot of the first interface, which is a screenshot of the first interface currently displayed on the screen. For instance, the smartwatch can acquire the first screenshot of the currently displayed first interface from the display screen's buffer. This first screenshot can be a bitmap corresponding to the first interface. Then, the smartwatch detects the user's finger sliding on the display screen and moves the first screenshot of the first interface accordingly. Figure 5 As shown, the first interface is the current display interface of the exercise app. In response to the user's finger pressing on the screen, the smartwatch obtains a screenshot of the current interface of the exercise app (first interface) (first screenshot) and a screenshot of the display interface of the desktop app (second interface).
[0113] In response to the user's finger swiping on the first screen, the smartwatch moves the finger to capture the first screenshot of the first screen. (Example) Figure 5 As shown, following the user's finger swipe to the right, the first screenshot moves to the right and gradually disappears from the display. The second screenshot on the second screen then appears on the display as the first screenshot moves. Afterwards, upon detecting the user releasing their finger, the smartwatch executes a display transition animation.
[0114] The process of displaying a switching animation on a smartwatch includes generating the switching animation and drawing the switching animation. Specifically, S402 may include S402a-S402b (not shown in the figure).
[0115] S402a, the smartwatch captures a first screenshot of the first interface and a second screenshot of the second interface.
[0116] For example, the smartwatch can acquire a first screenshot of the first interface and a second screenshot of the second interface when it detects that the user presses the display screen. Alternatively, the smartwatch can acquire a first screenshot of the first interface and a second screenshot of the second interface when it detects that the user swipes the display screen and releases their hand. In other words, the smartwatch can acquire a first screenshot of the first interface and a second screenshot of the second interface at any point during the entire process of contacting, pressing, swiping, and releasing the hand.
[0117] The smartwatch retrieves a first screenshot of the first interface currently displayed on the screen from the display's buffer. The smartwatch then retrieves a second screenshot, a preset screenshot stored in a preset location. Alternatively, the smartwatch may have already retrieved and cached a second screenshot of the second interface prior to the current moment.
[0118] The second screenshot is a screenshot of the second interface. The second screenshot may be the same as or different from the second interface.
[0119] The S402b smartwatch uses the first and second screenshots to generate and display a switching animation.
[0120] Smartwatches include a GPU and / or CPU. A smartwatch can utilize the GPU or CPU to render transition animations. These transition animations consist of M frames, where N is an integer greater than 2. The transition animation can be a first screen fading out and a second screen fading in, or a second screen sliding in from the edge of the display while the first screen moves out, or a second screen gradually enlarging while the first screen gradually shrinks, etc. Therefore, the relative positions of the first and second screenshots change within the M frames. Alternatively, one or more parameters of the first screenshot (size, position, brightness, transparency, etc.) may change. Similarly, one or more parameters of the second screenshot (size, position, brightness, transparency, etc.) may change.
[0121] Taking the transition animation as an example, where the first interface gradually exits from one side of the screen, and the second interface gradually appears fully on the screen. An example transition animation is as follows: Figure 6 As shown, the animation includes four frames. The smartwatch generates frame t1 based on the positions of the first and second screenshots on the current screen when the user releases the swipe from the right, the first screenshot, the second screenshot, and the screen size. The smartwatch then changes the relative positions of the first and second screenshots to generate frame t2. Specifically, the smartwatch moves the first screenshot to the right. Then, based on the new position of the first screenshot on the screen, the first and second screenshots, and the screen size, it generates frame t2. Next, the smartwatch reduces the brightness of the second screenshot to generate frame t3. Finally, the smartwatch increases the brightness of the second screenshot to generate frame t4. This animation effectively shows the first interface gradually fading from the side of the screen, the second interface gradually appearing fully on the screen, and then the brightness of the second interface gradually increasing.
[0122] S403, in response to the first operation, the smartwatch constructs and draws the second interface.
[0123] It should be understood that the process of a smartwatch displaying a second interface includes interface construction and interface rendering. Interface construction involves loading the interface code of the second interface to build its interface data. For example, interface construction can build the page attributes of each view in the second interface. A view can be a UI element in the second interface, such as a button, text, icon, progress bar, etc. The page attributes of a view include its layout information in the second interface, its display information, and its interaction information. Layout information includes position, size, and shape. Display information includes color, transparency, and brightness. Interaction information includes interaction attributes. Interface rendering is used to draw the second interface based on the constructed interface data and then display it.
[0124] For example, a smartwatch can execute S402 via a first thread and S403 via the UI main thread. The first thread and the UI main thread run in parallel. The first thread is used to draw and display the switching animation based on the first and second screenshots. The UI main thread is used to construct and draw the second interface.
[0125] S404: After the display switching animation ends, the smartwatch displays the second interface.
[0126] After the display transition animation ends, the smartwatch displays the constructed second interface. The first duration of the smartwatch drawing and displaying the transition animation may be greater than or equal to, or less than, the second duration required for the smartwatch to construct the second interface. If the first duration is greater than the second duration, the second interface has already been constructed before the display transition animation ends, and the smartwatch can directly display the constructed second interface after the display transition animation ends. If the first duration is less than the second duration, the second interface may not be fully constructed when the display transition animation ends, and the smartwatch can first display a second screenshot of the second interface, and then display the second interface after the second duration is fully constructed. For example, the first duration is 240ms, and the second duration is 300ms. In conventional technology, after a dynamic transition, the smartwatch needs another 300ms to construct the second interface, meaning that the smartwatch can only respond to user operations after 300ms. In this embodiment, after a dynamic transition, the smartwatch needs another 60ms to complete the construction of the second interface, improving the interface display speed and helping to quickly respond to user operations. That is, this solution modifies the asynchronous processing of UI tasks to the concurrent processing of UI tasks, improving task processing efficiency.
[0127] For example, the smartwatch can execute S402 via a first thread and S403-S404 via the UI main thread. The first thread and the UI main thread run in parallel. The first thread is used to draw the switching animation based on the first and second screenshots and display it. The UI main thread is used to construct and draw the second interface and display it.
[0128] As can be seen, the display interface method provided in this application allows the wearable device to execute the drawing of switching animations and the construction of the second interface in parallel during the dynamic interface switching process. This shortens the waiting time for the wearable device to display the second interface, enabling it to display the actually constructed second interface more quickly. Therefore, it can reduce response latency and respond more quickly to user operations on the display screen.
[0129] Combined with the preceding text Figures 1-6 This application introduces a method for displaying an interface according to an embodiment. The following describes the interaction process between threads and modules in a smartwatch.
[0130] The smartwatch includes an interrupt module. This interrupt module can be embedded within the smartwatch's application framework layer. The interrupt module can send interrupt signals to the first thread and the UI main thread, driving their execution. The UI main thread handles various UI tasks, such as input tasks, drawing tasks, and app business logic tasks. The UI main thread can automatically start after the smartwatch screen is turned on. In this embodiment, the UI main thread responds to a first operation by constructing and drawing a second interface. The first thread responds to the first operation by generating and displaying a transition animation from the first interface to the second interface based on a first and a second screenshot. The first thread can be pre-configured in the smartwatch; before startup, it can be in a dormant state. The first thread generates and displays each frame of the transition animation.
[0131] The following is combined Figure 7 and Figure 8 This solution will now be introduced.
[0132] S701 (not shown in the figure), the UI main thread detects the user's first operation and sets the first parameter to the first state.
[0133] The UI main thread responds to the user's first action by setting the state of the first parameter to the first state. The first action could be, for example, the user swiping and releasing on the screen.
[0134] The first parameter can be used to indicate whether the first thread should invoke the GPU toggle animation. The first parameter includes a first state and a second state. The first state of the first parameter indicates that the first thread should invoke the GPU toggle animation. The second state of the first parameter indicates that the first thread should not invoke the GPU toggle animation. The first state can be True, and the second state can be False. The first parameter can also be the `leRunning` parameter.
[0135] Optionally, S701 can also be S701a.
[0136] S701a: The UI main thread detects the user's first operation, sets the first parameter to the first state, and sets the state of the second parameter to the first state.
[0137] The second parameter can be used to indicate whether the UI main thread can access the GPU. The second parameter includes a first state and a second state. The first state of the second parameter indicates that the UI main thread cannot access the GPU. The second state of the second parameter indicates that the UI main thread can access the GPU. The first state can be True, and the second state can be False. The second parameter can be the `limitMainUI` parameter.
[0138] For example, in response to the user's first action, the UI main thread can call the StartLightEngine function, setting the first parameter to True and the second parameter to True.
[0139] The interrupt module can periodically read the state of the first parameter; for example, it can read the state of the first parameter every 16.6ms. Based on the state of the first parameter, the interrupt module can send interrupt signals to the first thread and the UI main thread, driving them to run. The first thread can then use the interrupt signal to draw image frames in the transition animation. The UI main thread can use the interrupt signal to read either the first parameter or the second parameter and its state, and based on the parameter state, execute the construction or drawing tasks for the second interface.
[0140] Specifically, the interrupt module periodically reads the state of the first parameter. If the state of the first parameter is the first state, it sends an interrupt signal to the first thread and the UI main thread. This interrupt signal is used to instruct the first thread to draw the switching animation and to instruct the UI main thread to build and draw the interface to be displayed (the second interface) based on the state of the first parameter.
[0141] The first thread can respond to the interrupt signal from the interrupt module and draw each frame of the transition animation. After the transition animation is completed, the first thread can set the first parameter state to the second state.
[0142] The UI main thread can respond to the first interrupt signal from the interrupt module, identify the state of the first parameter, and if the state of the first parameter is in the first state, indicating that the first thread is calling the GPU, the UI main thread constructs the interface data for the second interface until construction is complete. Then, in response to the next interrupt signal, it reads the state of the first parameter. If the state of the first parameter is in the second state, indicating that the first thread is not calling the GPU, the UI main thread calls the GPU to draw the second interface based on the created interface data.
[0143] Optionally, to avoid GPU call conflicts and further ensure that only one thread calls the GPU at any given time, the UI main thread can execute the construction task or the drawing task of the second interface based on the state of the first and second parameters.
[0144] The UI main thread can respond to the first interrupt signal from the interrupt module, reading the states of both the first and second parameters. If both the first and second parameters are in state 1, it instructs the first thread to call the GPU to draw the transition animation. Since the UI main thread cannot call the GPU, it constructs the UI data for the second interface until completion. Then, responding to the next interrupt signal, it reads the states of both the first and second parameters. If the first parameter is in state 2 and the second parameter is in state 1, it corrects the state of the second parameter to state 2. After correction, if both the first and second parameters are in state 2, it instructs the first thread not to call the GPU to draw the transition animation. Since the UI main thread can call the GPU, it draws the second interface based on the created UI data using the GPU.
[0145] Specifically, at time i, the interrupt module sends the i-th interrupt signal to the first thread based on the first parameter being in the first state. In response to the i-th interrupt signal, the first thread generates the i-th image frame in the switching animation based on the first screenshot of the first interface and the second screenshot of the second interface. i takes values sequentially from (1,2,3,...,M) until the switching animation is drawn and displayed. At the first time, the interrupt module sends the first interrupt signal to the UI main thread based on the first parameter being in the first state. In response to the first interrupt signal, the UI main thread constructs the second interface until the second interface is completed. Afterward, the UI main thread can respond to the next interrupt signal by calling the GPU to draw the second interface based on the created interface data and display it. The next interrupt signal can be the M+a-th interrupt signal, where a is an integer greater than 1.
[0146] For example, taking M=2 as an example, that is, the switching animation includes two image frames, and the UI main thread executes the construction or drawing of the second interface based on the state of the first parameter and the second parameter, this solution is introduced.
[0147] S702, at the first moment, the interrupt module reads the state of the first parameter, and the state of the first parameter is the first state.
[0148] S703, the interrupt module sends the first interrupt signal to the first thread and the UI main thread.
[0149] S704, in response to the first interrupt signal, the first thread generates the first image frame in the switching animation.
[0150] For example, the first thread can acquire a first screenshot and a second screenshot. The first thread can also acquire the first screenshot at a first position 1 on the screen when the user swipes and releases their finger, and the second screenshot at a first position 2 on the screen when the user swipes and releases their finger. Figure 6 As shown, when the user slides and releases their finger, such as at time t1, the first screenshot at the first position 1 on the display screen can be [x1, y1]. Here, x1 is the distance from the center of the first screenshot to the center of the display screen in the x-direction, and y1 is the distance from the center of the first screenshot to the center of the display screen in the y-direction. For example, the first position 1 can be [-20, 0]. The second screenshot at the first position 2 on the display screen can be [x2, y2]. Here, x2 is the distance from the center of the second screenshot to the center of the display screen in the x-direction, and y2 is the distance from the center of the second screenshot to the center of the display screen in the y-direction. For example, the first position 2 can be [0, 0].
[0151] The first thread can calculate the position of the first screenshot on the screen based on its position 1 on the screen when the user swipes and releases, and the screen size. The first thread then draws each frame of the switching animation based on the first information of the animation, including the animation duration, the frame movement step, the screen frame rate, the screen size, and the movement direction of the first and / or second screenshots. For example, the frame movement step of the first screenshot could be n, and the movement direction could be rightward. Therefore, the first thread can move the first screenshot to the right with a fixed step of n, based on its position 1 on the screen when the user swipes and releases, until the first screenshot moves off the screen. For example, the animation duration could be 300ms, and the movement direction could be rightward. Finally, the first thread uses the animation duration and the screen frame rate to calculate the number M of image frames included in the switching animation. Then, based on the number M of image frames included in the switching animation, the first thread can calculate the positions of the first screenshot on the screen when the user slides and releases the first screenshot at the first position 1 on the screen, and draw the M image frames.
[0152] Optionally, the first thread can first identify the state of the first parameter. If the state of the first parameter is the first state, the first thread can execute S704. That is, if the state of the first parameter is the first state, the first thread will only draw the image frame in the switching animation based on the interrupt signal. This is because the interrupt module sending the interrupt signal and the first thread drawing the image frame are parallel logics. The interrupt module may send multiple interrupt signals to the first thread, therefore, the first thread can perform a filtering.
[0153] S705, the first thread calls the GPU to draw the first image frame.
[0154] The first thread can perform GPU-related initializations, such as power-on. Afterward, the first thread can call GPU-related interfaces to draw the first image frame. The first thread can invoke the `workCallback` callback function to call the GPU to draw the first image frame.
[0155] After drawing is complete, the first thread can display the first image frame. For example, the first thread places the drawn first image frame in the display's buffer. Then, the first thread sets the buffer state of the first image frame to "ready". The display driver periodically retrieves the first image frame whose buffer state is "ready" and triggers the display to show it.
[0156] After the GPU call is complete, the first thread can perform GPU initialization operations, such as power-down operations.
[0157] S706, in response to the first interrupt signal, the UI main thread reads the status of the first and second parameters.
[0158] S707, the state of the first parameter is the first state, the state of the second parameter is the first state, and the UI main thread builds the second interface.
[0159] The first parameter's state is set to "first state," and the second parameter's state is also set to "first state," indicating that the first thread is calling the GPU to draw the image frames in the animation transition, and the second process cannot call the GPU. Therefore, the UI main thread can construct the second interface.
[0160] S708, at the second moment, the interrupt module reads the status of the first parameter, and the status of the first parameter is the first state.
[0161] S709, the interrupt module sends a second interrupt signal to the first thread, and the interrupt module sends a second interrupt signal to the UI main thread.
[0162] S710, in response to the second interrupt signal, the first thread generates the second image frame.
[0163] The method for the first thread to draw the second image frame is similar to the method for the first thread to draw the first image frame, and will not be described again here.
[0164] Optionally, the first thread can first identify the state of the first parameter. If the state of the first parameter is the first state, the first thread can execute S711.
[0165] S711, the first thread calls the GPU to draw the second image frame.
[0166] The first thread can perform GPU-related initializations, such as power-on. Then, the first thread can invoke the GPU to draw the first image frame. The first thread can also invoke the `workCallback` callback function to invoke the GPU to draw the second image frame. Similarly, after drawing is complete, the first thread can place the second image frame in the display's buffer and set the buffer state of the second image frame to `ready`.
[0167] After the GPU call is complete, the first thread can perform GPU initialization operations, such as power-down operations.
[0168] S712, the first thread changes the state of the first parameter to the second state.
[0169] Since the UI main thread responds to the first interrupt signal and executes the second UI construction task, if the UI main thread completes the construction task at the second moment, the UI main thread can respond to the second interrupt signal. The method may also include S713a-S719a.
[0170] In response to the second interrupt signal, the UI main thread reads the states of the first and second parameters of the S713a.
[0171] S714a, the state of the first parameter is the first state, the state of the second parameter is the first state, and the UI main thread waits for the next interrupt signal.
[0172] In S715a, at the third moment, the interrupt module reads the state of the first parameter, which is the second state.
[0173] The first parameter is in the second state, and the interrupt module only sends interrupt signals to the UI main thread.
[0174] In the S716a, the interrupt module sends a third interrupt signal to the UI main thread.
[0175] In response to the third interrupt signal, the UI main thread reads the status of the first parameter and the status of the second parameter.
[0176] The third interrupt signal is the next interrupt signal mentioned earlier. That is, the next interrupt signal mentioned earlier can be the (M+1)th interrupt signal.
[0177] S718a, the state of the first parameter is the second state, the state of the second parameter is the first state, and the UI main thread changes the state of the first parameter to the second state.
[0178] In the S719a, the UI main thread calls the GPU to draw the second interface.
[0179] After rendering is complete, the second thread can place the second interface in the display buffer and set the buffer state of the second interface to ready. The display driver can periodically retrieve the image from the buffer with the ready state and trigger the display to show it.
[0180] If the UI main thread has not completed building the second interface in the second cycle, it will not respond to the second signal. If, in the third cycle, the UI main thread completes building the second interface upon receiving the third interrupt signal, it will then respond to the third interrupt signal. Taking the example that the UI main thread completes building the second interface upon receiving the fourth interrupt signal, methods after S712 also include S713b-S719b.
[0181] In the S713b, at the third moment, the interrupt module reads the state of the first parameter, which is the second state.
[0182] The first parameter is in the second state, and the interrupt module only sends interrupt signals to the UI main thread.
[0183] S714b, the interrupt module's UI main thread sends a third interrupt signal.
[0184] Because the UI main thread is working to complete the construction of the second interface at the third moment, it does not respond to the third interrupt signal.
[0185] In the S715b, at the fourth moment, the interrupt module reads the status of the first parameter, which is the second status.
[0186] The fourth interrupt signal is the next interrupt signal mentioned earlier. That is, the next interrupt signal mentioned earlier can also be the (M+2)th interrupt signal.
[0187] S716b, the interrupt module's UI main thread sends the fourth interrupt signal.
[0188] In response to the fourth interrupt signal, the UI main thread reads the states of the first and second parameters of the S717b.
[0189] In S718b, if the state of the first parameter is the second state and the state of the second parameter is the first state, the UI main thread will change the state of the first parameter to the second state.
[0190] S719b: The UI main thread calls the GPU to draw the second interface.
[0191] Similarly, the UI main thread can first perform GPU-related initialization, such as power-on. Afterward, the UI main thread can invoke the GPU to draw the second interface. Once the GPU invocation is complete, the UI main thread can perform GPU initialization operations, such as power-off.
[0192] It should be understood that the method provided in this application can be used whenever a wearable device needs to asynchronously execute UI drawing tasks. For example, the UI main thread executes the first drawing task, and the first main thread executes the second drawing task. The first drawing task and the second drawing task can be parallel and independent, or mutually exclusive.
[0193] Furthermore, when switching from the first interface to the second interface, to reduce the switching wait time, the first thread can draw a screenshot of the second interface and display it, while the UI main thread can construct the second interface. This visually completes the switch from the first interface to the second interface, thus subjectively improving the switching speed.
[0194] This application provides a wearable device, which includes a memory, a display screen, and one or more processors. The display screen is coupled to the processors. The memory stores computer program code. The computer program code includes computer instructions. When the processor executes the computer instructions, the wearable device can perform various functions or steps performed by the mobile phone in the above method embodiments. The structure of the wearable device can be referred to... Figure 2 The structure of the wearable device 200 shown is illustrated.
[0195] This application embodiment also provides a computer storage medium, which includes computer instructions, when the computer instructions are executed in the aforementioned wearable device (such as...). Figure 2 When the wearable device 200 shown is run, it causes the wearable device to perform the various functions or steps in the above method embodiments.
[0196] This application also provides a computer program product that, when run on a computer, causes the computer to perform the various functions or steps described in the above method embodiments.
[0197] This application also provides a chip system including at least one processor and at least one interface circuit. The processor and the interface circuit are interconnected via lines. For example, the interface circuit can be used to receive signals from other devices (e.g., the memory of a wearable device). As another example, the interface circuit can be used to send signals to other devices (e.g., the processor). Exemplarily, the interface circuit can read instructions stored in the memory and send the instructions to the processor. When the instructions are executed by the processor, the wearable device can perform the steps in the above embodiments. Of course, the chip system may also include other discrete components, and this application does not specifically limit this.
[0198] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0199] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another apparatus, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0200] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0201] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0202] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, essentially or in other words, the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0203] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for displaying an interface, characterized in that, The method is applied to a wearable device, which includes a display screen, an interrupt module, and a UI main thread. The UI main thread is used to build and draw the interface to be displayed. The method includes: Display a first interface, receive a first operation from the user on the first interface, the first operation being used to trigger the wearable device to display a second interface; In response to the first operation, a switching animation from the first interface to the second interface is generated and displayed based on the first screenshot and the second screenshot; wherein, the first screenshot is a screenshot of the first interface, and the second screenshot is a screenshot corresponding to the second interface; In response to the first operation, the second interface is constructed and drawn; After the switching animation is displayed, the second interface is displayed; The step of constructing and drawing the second interface in response to the first operation includes: In response to the first operation, the UI main thread sets the state of the first parameter to the first state; The interrupt module periodically reads the state of the first parameter. If the state of the first parameter is the first state, it sends an interrupt signal to the first thread and the UI main thread. The interrupt signal is used to instruct the first thread to draw the switching animation and to instruct the UI main thread to construct and draw the interface to be displayed based on the state of the first parameter. In response to the interrupt signal, the first thread draws each frame of the switching animation; wherein, after all the images of the switching animation are displayed, the first thread sets the state of the first parameter to the second state; The UI main thread responds to the first interrupt signal by reading the state of the first parameter; if the state of the first parameter is the first state, it constructs the interface data of the interface to be displayed until the construction is completed, and responds to the next interrupt signal by reading the state of the first parameter; if the state of the first parameter is the second state, it calls the GPU to draw the second interface based on the created interface data and sends it for display.
2. The method according to claim 1, characterized in that, The wearable device includes a smartwatch or a smart bracelet.
3. The method according to claim 1 or 2, characterized in that, The first interface is the display interface of the first APP in the wearable device, and the second interface is the display interface of the second APP in the wearable device.
4. The method according to claim 3, characterized in that, The first app is different from the second app. The second app is the desktop app of the wearable device, and the desktop app's display interface includes the icon of the first app.
5. The method according to claim 3, characterized in that, The second interface is the initial interface of the second APP.
6. The method according to claim 1 or 2, characterized in that, The wearable device includes a UI main thread, which is used to build and draw the interface to be displayed; In response to the first operation, generating and displaying a transition animation from the first interface to the second interface based on the first and second screenshots includes: In response to the first operation, the switching animation effect is generated by the first thread based on the first screenshot and the second screenshot; the switching animation effect is then displayed. The step of constructing and drawing the second interface in response to the first operation includes: In response to the first operation, the second interface is constructed and drawn through the UI main thread; The first thread runs in parallel with the UI main thread.
7. The method according to claim 1 or 2, characterized in that, The UI main thread responds to the first interrupt signal and reads the state of the first parameter, including: The UI main thread responds to the first interrupt signal by reading the status of the first parameter and the status of the second parameter. If the state of the first parameter is the first state, construct the interface data of the interface to be displayed until the construction is completed, and in response to the next interrupt signal, read the state of the first parameter. If the state of the first parameter is the second state, then the GPU is invoked to draw the second interface based on the created interface data and send it to the display, including: If the state of the first parameter is the first state and the state of the second parameter is the first state, then the interface data of the interface to be displayed is constructed until the construction is completed. In response to the next interrupt signal, the state of the first parameter and the state of the second parameter are read. If the state of the first parameter is the second state and the state of the second parameter is the first state, then the second parameter is set to the second state. After the setting, the GPU is called to draw the second interface based on the created interface data and send it to the display.
8. The method according to claim 7, characterized in that, The switching animation includes M image frames, where M is an integer greater than 1; In response to the interrupt signal, the first thread draws each frame of the switching animation, including: At time i, the interrupt module sends the i-th interrupt signal to the first thread based on the first parameter being in the first state; In response to the i-th interrupt signal, the first thread draws the i-th image frame in the switching animation; i takes values sequentially in (1,2,3,...,M).
9. The method according to claim 7, characterized in that, The next interrupt signal is the (M+a)th interrupt signal; where a is an integer greater than 1.
10. The method according to claim 1 or 2, characterized in that, The method further includes: The UI main thread does not respond to interrupt signals until it has completed building the interface data for the interface to be displayed.
11. The method according to claim 1 or 2, characterized in that, The method further includes: If the state of the first parameter is the second state, the interrupt module sends an interrupt signal to the UI main thread.
12. A wearable device, characterized in that, The wearable device includes: a memory, a display screen, and a processor; the memory, the display screen, and the processor are coupled; wherein the memory is used to store computer program code, the computer program code including computer instructions; when the computer instructions are executed by the processor, the wearable device performs the method as described in any one of claims 1-11.
13. A computer-readable storage medium, characterized in that, Includes computer instructions that, when executed on a wearable device, cause the wearable device to perform the method as described in any one of claims 1-11.
14. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method as described in any one of claims 1-11.
Citation Information
Patent Citations
Page display method and wearable equipment
CN112650546A
Display method and electronic equipment
CN115480834A