Display method, display device and electronic equipment
By identifying and discarding invalid frames in the e-ink screen, the problem of the stylus being stuck during the interface refresh process is solved, enabling continuous writing of handwritten content and improving user experience.
Patent Information
- Application Number
- CN202310274630.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-09
- Publication Date
- 2024-09-10
AI Technical Summary
In the stylus scenario, the interface refresh of the electronic ink screen due to changes in other application content causes graphics lag in the handwritten content, affecting the user experience.
By detecting the frames synthesized by the UI interface refresh during the writing process, identifying and discarding invalid frames, it avoids interrupting the display process of the stylus and improves the chirality of the stylus. The specific method includes synthesizing the first frame based on the first layer and the second layer, determining whether the frame is an invalid frame, discarding the frame if so, overlaying and displaying the second handwriting on the historical frame, and if it is a valid frame, displaying the second handwriting on the first frame. The second handwriting is displayed superimposed on the frame.
It achieves continuous writing of handwritten content, avoids stylus jamming, and improves user experience.
Smart Images

Figure CN118625969A
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of electronic technology, and more specifically, to a display method, a display device, and an electronic device. Background Art
[0002] The electronic ink screen is a screen that does not emit light itself but relies on external light to achieve its display effect. Its display effect is very similar to that of paper materials, so it can be compared to the experience of reading paper materials. It has been widely used in screen hardware such as walls, billboards, and smart terminal products, improving the user experience comfort.
[0003] The current ink screen is limited by physical characteristics, and the refresh speed is slower than that of traditional displays, and the frame rate is inversely proportional to the image quality. For example, the ink screen stylus scene generally requires a high frame rate and low image quality refresh mode, and the UI interface scene requires a high image quality and low frame rate refresh mode.
[0004] When the stylus is writing, the interface may be refreshed due to changes in other application content. For example, changes in system status information such as system time, signal strength, and battery level may hinder the display of handwritten content, causing the stylus writing to freeze and affecting the user experience. Summary of the invention
[0005] The present application provides a display method, a display device and an electronic device. The technical solution detects the frames synthesized by refreshing the UI interface during the writing process, identifies and discards invalid frames, thereby avoiding interrupting the display process of the stylus, improving the hand tracking performance of the stylus, and enhancing the user experience.
[0006] In a first aspect, a display method is provided, which is applied to an electronic device, and the method includes: synthesizing a first frame based on a first layer and a second layer, the first layer is a stylus layer for displaying a first handwriting, the second layer is a non-stylus layer for displaying other application content, and the second layer includes at least one layer; if it is determined that the first frame is an invalid frame, the first frame is discarded, and the second handwriting is superimposed and displayed on a history frame, and the history frame is a frame previous to the first frame; if it is determined that the first frame is a valid frame, the second handwriting is superimposed and displayed on the first frame, wherein the second handwriting is generated after the first handwriting.
[0007] In a possible implementation, other application content may be system status information, for example, system time, signal strength, power level, and other system-related information.
[0008] In a possible implementation, the first handwriting may be the handwriting content before the synthesis by the layer synthesis module is triggered, and the second handwriting may be the handwriting content after the synthesis by the layer synthesis module is triggered; in other words, the first handwriting may be the handwriting content before the layer synthesis module obtains the first frame, and the second handwriting may be the handwriting content after obtaining the first frame; it can also be said that the first handwriting may be the handwriting content before the first frame starts to be written into the frame buffer module, and the second handwriting may be the handwriting content after the first frame starts to be written into the frame buffer module.
[0009] In this technical solution, the first frame synthesized by the handwriting layer and the non-handwriting layer can be identified. If it is an invalid frame, the first frame will be discarded, and the second handwriting will be superimposed on the historical frame. Because the historical frame has been written into the frame cache module, the second handwriting can be written continuously, thereby avoiding the writing of invalid frames to occupy the frame cache module, realizing continuous writing of handwritten content, avoiding stylus jams, improving the hand tracking performance of the stylus, and enhancing the user experience.
[0010] In combination with the first aspect, in certain implementations of the first aspect, the sum of different pixels of the first frame and the historical frame is determined, and the magnitude of the sum of the different pixels and a first threshold value is judged; when the sum of the different pixels is less than or equal to the first threshold value, the first frame is determined to be an invalid frame, wherein the different pixels of the first frame and the historical frame are different pixels at the same position.
[0011] In this technical solution, invalid frames are identified by comparing the sum of different pixels at the same position in the current frame and the historical frame with the size of the preset threshold. The preset threshold value in this method can be set according to user needs, and the screening rules for invalid frames are more flexible.
[0012] In combination with the first aspect, in some implementations of the first aspect, it is determined that the visibility of the second layer is all invisible, and the first frame is determined to be an invalid frame.
[0013] In this technical solution, based on the layer display status (visibility) of the first frame, invalid frames can be identified by judging whether all the layers in the first frame are invisible layers. In this method, the visibility of the layer is an inherent property of the layer, and it is easier to implement to identify invalid frames using this property.
[0014] In combination with the first aspect, in some implementations of the first aspect, the name and visibility of the first layer and the second layer are obtained.
[0015] In combination with the first aspect, in certain implementations of the first aspect, the sum of different pixels of the first frame and the historical frame is determined, and the magnitude of the sum of the different pixels and a first threshold value is judged; when the sum of the different pixels is greater than the first threshold value, the first frame is a valid frame, wherein the different pixels of the first frame and the historical frame are different pixels at the same position.
[0016] In this technical solution, by comparing the sum of different pixels at the same position in the current frame and the historical frame with the size of a preset threshold, the valid frame can be identified, so that the valid frame can be displayed to meet the user's demand for valid information.
[0017] In combination with the first aspect, in some implementations of the first aspect, it is determined that the second layer includes a visible layer, and the first frame is determined to be a valid frame.
[0018] In this technical solution, by determining that the layer of the first frame includes a visible layer, a valid frame is identified, so that the valid frame can be displayed, meeting the user's demand for valid information.
[0019] In combination with the first aspect, in certain implementations of the first aspect, when the stylus pen writes on the electronic device, a start instruction is sent, and the start instruction is used to indicate the start of identifying the first frame as a valid frame or an invalid frame; when the stylus pen stops writing on the electronic device, a termination instruction is sent, and the termination instruction is used to indicate the stop of identifying the first frame as a valid frame or an invalid frame.
[0020] In this technical solution, an instruction on whether to start the filtering algorithm can be sent based on the writing status, so as to avoid the frame filtering module still executing the algorithm instruction when there is no writing, thereby saving the power consumption of the electronic device.
[0021] In a second aspect, a display device is provided, which includes a layer synthesis module, a frame filtering module and a frame cache module, wherein the layer synthesis module is used to synthesize a first frame based on a first layer and a second layer, the first layer is a stylus layer for displaying a first handwriting, the second layer is a non-stylus layer for displaying other application content, and the second layer includes at least one layer; the frame filtering module is used to determine whether the first frame is an invalid frame or a valid frame; when the first frame is an invalid frame, the frame filtering module is also used to discard the first frame, and the frame cache module is used to superimpose and display the second handwriting on a historical frame, the historical frame being a frame previous to the first frame; when the first frame is a valid frame, the frame cache module is used to superimpose and display the second handwriting on the first frame, wherein the second handwriting is generated after the first handwriting.
[0022] In this technical solution, the frame filtering module can identify the first frame synthesized by the layer synthesis module. If it is an invalid frame, the first frame will be discarded. The frame cache module superimposes the second handwriting on the historical frame. Because the historical frame has been written into the frame cache module, the second handwriting can be written continuously, thereby avoiding the writing of invalid frames to occupy the frame cache module, realizing the continuous writing of handwritten content, avoiding the stylus from freezing, improving the hand tracking performance of the stylus, and enhancing the user experience.
[0023] In combination with the second aspect, in certain implementations of the second aspect, the frame filtering module is specifically used to determine the sum of different pixels of the first frame and the historical frame, and to judge the size of the sum of different pixels and a first threshold value; when the sum of different pixels is less than or equal to the first threshold value, the first frame is determined to be an invalid frame, wherein the different pixels of the first frame and the historical frame are different pixels at the same position.
[0024] In the present technical solution, the frame filtering module can specifically identify invalid frames by comparing the sum of different pixels at the same position in the current frame and the historical frame with the size of a preset threshold. The preset threshold value in this method can be set according to user needs, and the screening rules for invalid frames are more flexible.
[0025] In combination with the second aspect, in some implementations of the second aspect, the frame filtering module is specifically used to determine that the visibility of the second layer is all invisible, and determine that the first frame is an invalid frame.
[0026] In the present technical solution, the frame filtering module identifies invalid frames based on the layer display status (visibility) of the first frame by determining whether all the layers of the first frame are invisible layers. In this method, the visibility of the layer is an inherent property of the layer, and it is easier to implement using this property to identify invalid frames.
[0027] In combination with the second aspect, in some implementations of the second aspect, the frame filtering module is further used to obtain the name and visibility of the first layer and the second layer.
[0028] In combination with the second aspect, in certain implementations of the second aspect, the frame filtering module is specifically used to determine the sum of different pixels of the first frame and the historical frame, and to judge the magnitude of the sum of the different pixels and a first threshold value; when the sum of the different pixels is greater than the first threshold value, the first frame is determined to be a valid frame, wherein the different pixels of the first frame and the historical frame are different pixels at the same position.
[0029] In this technical solution, the frame filtering module identifies valid frames by comparing the sum of different pixels at the same position in the current frame and the historical frame with the size of a preset threshold, thereby enabling the display of valid frames to meet the user's demand for valid information.
[0030] In combination with the second aspect, in some implementations of the second aspect, the frame filtering module is specifically used to determine that the second layer includes a visible layer, and determine that the first frame is a valid frame.
[0031] In this technical solution, the frame filtering module identifies the valid frame by determining whether the layer of the first frame includes a visible layer, thereby enabling the display of the valid frame to meet the user's demand for valid information.
[0032] In combination with the second aspect, in certain implementations of the second aspect, the device also includes a frame filtering start and stop module, and when the stylus pen is writing on the electronic device, the frame filtering start and stop module is used to send a start instruction, and the start instruction is used to instruct the frame filtering module to start identifying the first frame as a valid frame or an invalid frame; when the stylus pen stops writing on the electronic device, the frame filtering start and stop module is used to send a termination instruction, and the termination instruction is used to instruct the frame filtering module to stop identifying the first frame as a valid frame or an invalid frame.
[0033] In this technical solution, the frame filtering start-stop module can send an instruction on whether to start the filtering algorithm to the frame filtering module based on the writing status, thereby preventing the frame filtering module from executing algorithm instructions when there is no writing, thereby saving power consumption of the electronic device.
[0034] In a third aspect, an electronic device is provided, comprising one or more processors; one or more memories; one or more memories storing one or more computer programs, the one or more computer programs comprising instructions, which, when executed by the one or more processors, enable the display method as described in the first aspect and any possible implementation thereof to be executed.
[0035] In a fourth aspect, a chip is provided, which includes a processor and a communication interface, the communication interface is used to receive signals and transmit the signals to the processor, and the processor processes the signals so that the display method in the above-mentioned first aspect and any possible implementation method thereof is executed.
[0036] In a fifth aspect, a computer-readable storage medium is provided, in which computer instructions are stored. When the computer instructions are executed on an electronic device, the display method in the first aspect and any possible implementation thereof is executed.
[0037] In a sixth aspect, a computer program product is provided, the computer program product comprising a computer program code, and when the computer program code runs on a computer, the display method in the first aspect and any possible implementation thereof is executed. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 It is a structural diagram of an electronic device 100 provided in an embodiment of the present application.
[0039] Figure 2 It is a schematic diagram of an application scenario provided by an embodiment of the present application.
[0040] Figure 3 It is a schematic diagram of a stylus pen jamming scenario provided in an embodiment of the present application.
[0041] Figure 4It is a structural diagram of an electronic device 400 provided in an embodiment of the present application.
[0042] Figure 5 It is a structural diagram of an electronic device 500 provided in an embodiment of the present application.
[0043] Figure 6 It is a schematic flow chart of a display method provided in an embodiment of the present application.
[0044] Figure 7 It is a flowchart of a method for identifying invalid frames provided in an embodiment of the present application.
[0045] Figure 8 Example graphs of pixels of the first frame and historical frames are shown.
[0046] Fig. 9 This is a flowchart of another method for identifying invalid frames provided in an embodiment of the present application.
[0047] Fig.10 It is a schematic framework diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0048] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0049] In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is merely a way to describe the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0050] In the embodiments of the present application, prefixes such as "first" and "second" are used only to distinguish different description objects, and have no limiting effect on the position, order, priority, quantity or content of the described objects. The use of prefixes such as ordinal numbers to distinguish description objects in the embodiments of the present application does not constitute a limitation on the described objects. For the statement of the described objects, please refer to the description in the context of the claims or embodiments, and no unnecessary limitation should be constituted due to the use of such prefixes. In addition, in the description of the present embodiment, unless otherwise specified, the meaning of "multiple" is two or more.
[0051] The display method in the embodiment of the present application can be applied to electronic devices with display function.
[0052] Electronic devices include terminal devices, which may also be referred to as terminals, user equipment (UE), mobile stations (MS), mobile terminals (MT), etc. Terminal devices may be large-screen display devices such as smart TVs, smart screens, displays, and projectors, and may also be applied to electronic devices such as tablet computers, laptop computers, personal computers, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), and vehicle-mounted devices. The embodiments of the present application do not impose any restrictions on the specific types of electronic devices.
[0053] In order to better understand the embodiments of the present application, the structure of the electronic device according to the embodiments of the present application is introduced below.
[0054] Figure 1 1 is a schematic diagram of the structure of an electronic device 100 provided in an embodiment of the present application. The layered architecture includes several layers, and the layers communicate with each other through software interfaces. In the present application, Figure 1 A layered architecture applicable to an embodiment of the present application is shown in FIG. , which may include an application layer, a system layer, a driver layer, and a hardware layer.
[0055] like Figure 1 As shown, the application layer can include a series of application packages. Figure 1 The stylus application, system UI application, and other applications shown in .
[0056] Each application can create a corresponding control. Figure 1 In the present invention, the stylus application APP can create a stylus control, the system UI application APP can create a status bar control, and other application APPs can also create corresponding controls. In this application, the control is used to implement the functions of the corresponding application.
[0057] The system layer includes the display layer (pencil layer) corresponding to each application. The system layer can be a graphics subsystem, for example, the surfaceflinger in the Android system. Each display layer corresponds one-to-one to the above-mentioned application, or one-to-one to the above-mentioned control. For example, when a stylus application creates a stylus control, it will create a corresponding stylus layer for the stylus control; for another example, when a system UI application creates a status bar control, it will create a corresponding layer one for the status bar control. Other applications will also create corresponding layers two for other corresponding controls. Each display layer is used to display the corresponding input content in the control. For example, when the stylus writes in the control, the handwriting content will be drawn to the stylus layer.
[0058] The system layer also includes a layer synthesis module, which is used to synthesize the display layers to obtain a synthetic frame, thereby synthesizing the display screens into the same display screen. For example, after the stylus layer is synthesized with layer 1, the user can see the display content of system status information such as battery level, network signal or date and time on the screen while performing the stylus task.
[0059] The system layer also includes a frame buffer module (framebuffer), such as Figure 1 As shown in , the frame buffer module can receive the synthesized frame and the stylus layer of the layer synthesis module. After receiving the stylus layer and the synthesized frame, the frame buffer module can overlay the layer content and send it to the display screen of the hardware layer through the driver layer.
[0060] It should be noted that the stylus layer includes two parts of handwriting, the first part of handwriting and the second part of handwriting, and the first part of handwriting is generated or drawn before the second part of handwriting. The layer synthesis module synthesizes the first part of handwriting and other application content to obtain a synthetic frame, and after the synthetic frame is written into the frame buffer module, the second part of handwriting is superimposed on the synthetic frame, and then the superimposed image is sent to the display screen through the driver layer.
[0061] An optional understanding is that the first part of the handwriting may be the handwriting content before the synthesis by the layer synthesis module is triggered, and the second part of the handwriting may be the handwriting content after the synthesis by the layer synthesis module is triggered.
[0062] It should be understood that when the layer synthesis module is synthesizing, the input content of the stylus pen can still be continuously written into the frame cache module so that it can be continuously displayed. Only when the synthesized frame needs to be written into the frame cache module, the input content of the stylus pen needs to wait for the completion of the writing of the synthesized frame before it can be written. In other words, only when the synthesized frame occupies the frame cache module to write the content of the synthesized frame, the input content of the stylus pen needs to wait for the completion of the writing of the synthesized frame before it can continue to be written.
[0063] It should be noted that the time nodes in this application do not impose any limitation on the embodiments of this application. For example, the duration of the synthesis process of the layer synthesis module can be ignored, then the first part of the handwriting and the second part of the handwriting are only related in time sequence, the first part of the handwriting can also be the handwriting content before the layer synthesis module obtains the synthesis frame, and the second part of the handwriting is the handwriting content after the synthesis frame is obtained; in other words, the first part of the handwriting can also be the handwriting content before the synthesis frame starts to be written into the frame buffer module, and the second part of the handwriting is the handwriting content after the synthesis frame starts to be written into the frame buffer module.
[0064] It should be understood that when other application content such as layer one or layer two is updated, the layer synthesis module can be triggered to synthesize the first part of the handwriting with layer one and layer two to obtain a synthesized frame, and write the synthesized frame to the frame cache module. In this case, the second part of the handwriting needs to wait for the writing process to end before the second part of the handwriting can be written into the frame cache module. Only then can the synthesized frame and the second part of the handwriting be sent to the screen for display through the frame cache module. In this process, the time for rewriting the synthesized frame into the frame cache module is relatively long, which hinders the display of the stylus layer, causing the stylus writing to be stuck, affecting the user experience.
[0065] For example, background behaviors such as changes in system time, changes in mobile signal strength, and changes in battery level will all cause invisible UI interface refreshes. In this case, even if the current stylus is in full-screen display, the user cannot directly see the system status information from the current interface, but the system will still update in the background, triggering the layer synthesis module to re-synthesize and display it. At this time, even if the stylus is writing, the writing content will not be displayed on the screen in real time. After the synthesized frame is written, it will be displayed together with the unwritten stylus layer, causing the stylus to freeze.
[0066] In the present application, system status information is used to describe the system status, for example, system time, signal strength, power, and other system-related information, which is not limited in the embodiments of the present application.
[0067] In the present application, the driving layer may be driven by a timing controller (TCON), which is not limited in the embodiments of the present application.
[0068] In the present application, the hardware layer may be an ink screen, which is not limited in the embodiments of the present application.
[0069] The structure of the electronic device 100 shown in the present application may also include other layers. The embodiment of the present application only shows one layered structure, and the embodiment of the present application does not limit this.
[0070] Figure 2 is a schematic diagram of an application scenario provided by an embodiment of the present application. Figure 2 As shown, the electronic device may be a tablet with a handwriting function, and the electronic device is used to perform handwriting tasks with any stylus, wherein when the user is performing a handwriting task, other application content may be displayed on the screen or not. This embodiment of the application is not limited to this.
[0071] It should be understood that the internal software structure of the tablet is as follows Figure 1 An electronic device 100 is shown.
[0072] It should be understood that similar to Figure 2 In an electronic device, when a handwriting task is performed, the stylus frame image needs to be presented continuously. However, when other application contents are updated, for example, system status information, the display of the stylus frame image may be interrupted.
[0073] Figure 3 A schematic diagram of a scenario in which an electronic device freezes during handwriting is shown. This scenario is an example. When the stylus frame image is continuously sent for display, the continuous frame sequence of the stylus frame image is interrupted due to the update of the WIFI signal change frame and the floating window UI change frame. As a result, the handwriting frame image cannot be continuously presented on the screen during display, resulting in handwriting freeze.
[0074] In view of this, the embodiments of the present application provide a display method, a display device and an electronic device. The technical solution avoids interrupting the display process of the stylus pen by identifying and discarding invalid frames, thereby improving the hand tracking performance of the stylus pen and enhancing the user experience.
[0075] Combination of the above Figures 1 to 3 The software architecture and application scenarios of the electronic device provided in the embodiment of the present application are described below. Figures 4 to 8 The display method and electronic device in the embodiments of the present application are introduced.
[0076] First combine Figures 4 to 5 The architecture of the electronic device according to the embodiment of the present application is introduced.
[0077] Figure 4 FIG. 4 is a schematic diagram of an electronic device architecture 400 shown in an embodiment of the present application. Figure 4 As shown, in Figure 1 Based on the architecture, a frame filtering module is added at the system layer. The frame filtering module is used to identify the synthesized frame sent by the layer synthesis module. When it is determined to be an invalid frame, the frame filtering module discards the synthesized frame. When it is determined to be a valid frame, the synthesized frame needs to be written to the frame buffer module so that it can be sent to the screen for display.
[0078] It should be understood that the frame filtering module may determine whether the synthesized frame is an invalid frame based on an algorithm.
[0079] An optional understanding is that the invalid frame can be understood as being used to display the content of the system status information update. When the content of the system status information update is updated less based on a certain threshold value, the updated content is content that the user does not need, and the frame is an invalid frame. When the content of the system status information update is updated more based on a certain threshold value, the updated content is content that the user needs, and the frame is a valid frame.
[0080] Another optional understanding is that the invalid frame can be understood as the content used to display the updated system status information. When the layers synthesized into the frame include invisible layers, that is, unnecessary content is updated, the frame is an invalid frame. When the layers of the synthesized frame include all visible layers, they are all content required by the user, then the frame is a valid frame. Among them, the invisible layer can be understood as the layer that the user has hidden when performing a handwriting task. For example, if the user does not need a network signal, the display layer is hidden. Then, when the network signal display layer is included in the layers of the synthesized frame, the frame can be judged to be an invalid frame.
[0081] Optionally, the architecture may further include a frame filtering start-stop module, which is used to instruct the frame filtering module to start an instruction, the start instruction is used to instruct the frame filtering module to start identifying the synthetic frame; or, to instruct the frame filtering module to terminate an instruction, the termination instruction is used to instruct the frame filtering module to stop identifying the synthetic frame. The frame filtering start-stop module can instruct the frame filtering module to execute an algorithm when it is necessary to identify the synthetic frame, and stop executing the algorithm when it is not necessary to identify the synthetic frame, thereby saving power consumption of the electronic device.
[0082] It should be understood that other modules in the present architecture 400 are similar to those in the architecture 100 and will not be described in detail here.
[0083] Figure 5 FIG. 5 is a schematic diagram of another electronic device architecture 500 shown in an embodiment of the present application. Figure 5 As shown, the frame filter start and stop module is set at the system layer, and the handwriting control is used to control whether to start or stop the frame filter task. Other modules in the architecture 500 are even similar to the architectures 100 and 400, and will not be repeated here.
[0084] The following combination Figure 6 The display method applicable to the electronic device architecture 400 or the electronic device architecture 500 provided in the embodiments of the present application is described.
[0085] Figure 6 is a schematic flow chart of a display method provided in an embodiment of the present application. Figure 6 As shown, the method 600 may be applied to an electronic device. The method 600 may include steps 610 to 620.
[0086] S610: The electronic device synthesizes a first frame based on the first layer and the second layer.
[0087] Among them, the first frame is an example of a synthesized frame.
[0088] The first layer is a stylus layer, which is used to display the first handwriting.
[0089] The content of the handwriting layer is divided into a first handwriting and a second handwriting. The second handwriting is generated after the first handwriting. In other words, the second handwriting is drawn after the first handwriting.
[0090] The second layer is a non-stylus layer, which is used to display other application content.
[0091] Exemplarily, other application content may be system status information, and the system status information may be information related to the system status, for example, system time, signal strength, power, and other system-related information, which is not limited in the embodiments of the present application.
[0092] In the present application, the second layer includes at least one layer.
[0093] Exemplarily, the second layer may include: Figure 1 Layers one and two shown.
[0094] In the present application, the electronic device may be a terminal device, such as a tablet, a smart TV, a display, a projector, a laptop computer, etc., which is not limited in the embodiments of the present application.
[0095] In the present application, the electronic device can synthesize the first layer and the second layer to obtain a first frame, and the first frame includes the first handwriting and other application content.
[0096] In the present application, the first layer and the second layer may be synthesized by a layer synthesis module to obtain a first frame, for example, Figure 4 and Figure 5 The layer compositing module shown in .
[0097] In a possible implementation, when the system state information changes, the layer synthesis module is triggered to synthesize the images of the first layer and the second layer to obtain the first frame.
[0098] S620-1, the electronic device determines that the first frame is an invalid frame and discards the first frame, and displays the second handwriting on the historical frame in an overlay.
[0099] First, a method for determining that the first frame is an invalid frame is introduced.
[0100] In some embodiments, the electronic device determines that the first frame is an invalid frame based on a frame filtering algorithm.
[0101] In the present application, the frame filtering module may execute a frame filtering algorithm to determine that the first frame is an invalid frame, for example, Figure 4 or Figure 5 The frame filtering module shown in FIG.
[0102] In one possible implementation, the sum of different pixels of the first frame and the historical frame is determined, and the size of the sum of different pixels and a first threshold value is judged. When the sum of different pixels is less than or equal to the first threshold value, the first frame is an invalid frame, wherein the historical frame is the previous frame of the first frame, and the different pixels of the first frame and the historical frame are different pixels at the same position.
[0103] Among them, the first threshold value can be predefined, and the first threshold value is N, where N is an integer greater than or equal to 0. For example, N is equal to 5000, that is, the sum of different pixels in the first frame and the historical frame is less than or equal to 5000, then the first frame is an invalid frame, and when the sum of different pixels in the first frame and the historical frame is greater than 5000, then the third frame is a valid frame.
[0104] In another possible implementation manner, it is determined that the visibility of the second layer is all invisible, and the first frame can be determined to be an invalid frame.
[0105] Among them, the frame filtering module can obtain the names and visibilities of all layers, exclude the first layer by the name of the layer, and then determine the visibility of all layers in the second layer. If there is no visible layer in the second layer, the frame filtering module determines that the first frame is an invalid frame; if the second layer includes a visible layer, the frame filtering module determines that the first frame is a valid frame.
[0106] Among them, visibility is a property of the layer, and each layer corresponds to visible or invisible.
[0107] The visibility here can be understood as whether the layer needs to be displayed on the screen based on the user's current task requirements. For example, when the user is writing with a stylus on a note application and the system UI interface is hidden, the visibility of the system UI layer is invisible.
[0108] The above are merely two examples of identifying invalid frames, and the embodiments of the present application are not limited thereto.
[0109] Next, the display method after determining the invalid frame is introduced.
[0110] In this application, the content to be displayed can be sent through the frame buffer module.
[0111] After determining that the first frame is an invalid frame, the first frame is discarded, and the second handwriting is superimposed and displayed on the historical frame.
[0112] An optional understanding is that after discarding the first frame, the second handwriting can be written into the frame cache module, because the first handwriting is included in the historical frame and the historical frame has been written into the frame cache module, so the first handwriting and the second handwriting can be written continuously, thereby ensuring that the stylus will not be stuck.
[0113] S620-2, when the electronic device determines that the first frame is a valid frame, the second handwriting is superimposed and displayed on the first frame.
[0114] First, a method for determining the first frame as a valid frame is introduced.
[0115] In some embodiments, the electronic device determines that the first frame is a valid frame based on a frame filtering algorithm.
[0116] In the present application, the frame filtering module may execute a frame filtering algorithm to determine that the first frame is a valid frame, for example, Figure 4 or Figure 5 The frame filtering module shown in FIG.
[0117] In one possible implementation, the sum of different pixels in the first frame and the historical frame is determined, and the size of the sum of different pixels and a first threshold value is judged. When the sum of different pixels is greater than the first threshold value, the first frame is a valid frame, wherein the historical frame is the previous frame of the first frame, and the different pixels in the first frame and the historical frame are different pixels at the same position.
[0118] In another possible implementation manner, it is determined that the second layer includes a visible layer, and the first frame can be determined to be a valid frame.
[0119] The above are merely two examples of identifying valid frames, and the embodiments of the present application are not limited to this.
[0120] Next, the display method after determining the valid frame is introduced.
[0121] In this application, the content to be displayed can be sent through the frame buffer module.
[0122] After determining that the first frame is a valid frame, the second handwriting is superimposed and displayed on the first frame.
[0123] An optional understanding is that if the first frame is a valid frame, the content of the first frame needs to be written into the frame cache module, and after writing is completed, the second handwriting content is written into the frame cache module, so that the content of the valid frame and the content of the second handwriting can be presented on the display screen.
[0124] Optionally, the electronic device may send a start instruction, where the start instruction is used to instruct to start recognizing the first frame; or send a stop instruction, where the stop instruction is used to instruct to stop recognizing the first frame.
[0125] In the present application, a start instruction or a stop instruction can be sent to the frame filtering module through the frame filtering start and stop module.
[0126] Exemplarily, when the stylus pen writes on the stylus pen control of the electronic device, the frame filtering start-stop module sends an instruction to start the frame filtering algorithm to the frame filtering module; when the stylus pen stops writing on the stylus pen control of the electronic device, the frame filtering start-stop module sends an instruction to terminate the frame filtering algorithm to the frame filtering module.
[0127] The frame filter start-stop module sends an instruction on whether to start the filtering algorithm to the frame filter module based on the writing state, so as to avoid the frame filter module still executing the algorithm instruction when there is no writing, thereby saving the power consumption of the electronic device.
[0128] The following is a detailed description of the identification method of frame filtering, which is a specific example applicable to the above method 600.
[0129] In a possible implementation, the frame filtering module may identify invalid frames through a pixel contrast detection algorithm, and the specific method is as follows: Figure 7 Method 700 is shown.
[0130] Figure 7 This is a flow chart of a method for identifying invalid frames provided by an embodiment of the present application. The specific process is as follows.
[0131] After the execution starts, S710, a first threshold value N is set.
[0132] The first threshold value N is used to determine the degree of similarity between the first frame and the historical frame. In other words, the first threshold value N is used to determine the degree of change of the first frame relative to the historical frame.
[0133] An optional understanding is that the higher the picture similarity, the lower the change degree of the first frame, that is, the smaller the picture update pixel, the less useful information the first frame has for the user, that is, the first frame can be discarded. Conversely, the lower the picture similarity, the higher the change degree of the first frame relative to the historical frame, that is, the larger the picture update pixel, the more useful information the first frame has for the user, that is, the first frame may be a valid frame.
[0134] Exemplarily, N is 5000, which means that when the sum of different pixels in two frames is greater than 5000, the picture similarity is considered to be low, that is, the two pictures are inconsistent.
[0135] S720, calculating the sum M of different pixels at the same position in the first frame and the historical frame.
[0136] The first frame is the current frame image, and the historical frame is the previous frame image of the first frame.
[0137] Specifically, a frame comparison algorithm is used to compare the current frame image with the previous frame image, so as to determine the change of the frame image.
[0138] Exemplarily, by performing a pixel-level comparison between the first frame and the historical frames, the sum M of different pixels at the same position in the first frame and the historical frames can be calculated.
[0139] Figure 8 The pixel example diagram of the first frame and the historical frame is shown. The first frame includes single pixels A1, A2, A3...An, B1, B2, B3...Bn, etc. The historical frame includes single pixels A1', A2', A3'...An', B1', B2', B3'...Bn', etc., wherein each pixel is represented by four bytes: r, g, b, a.
[0140] Take the pixels at the same position in the two pictures, for example, A1(r, g, b, a) and A1'(r, g, b, a), and calculate the difference between A1 and A1'. As long as one of the differences in r, g, b, a between the two pixels is not equal, the pixels are recorded as unequal.
[0141] The sum M of different pixels at the same position is calculated according to the above method, where M is an integer greater than 0.
[0142] S730, determine whether M is greater than N.
[0143] When the sum M of different pixels at the same position in the above two frames is greater than N, it is considered to be a valid frame.
[0144] When the sum M of different pixels at the same position in the above two frames is less than or equal to N, step S740 is executed to determine whether the pixels in the picture have been traversed. If the picture has been traversed, the first frame is determined to be an invalid frame. If the pixels in the picture have not been traversed, step S720 needs to be executed to re-execute the judgment process for the pixels that have not been judged, and then continue to execute the subsequent steps.
[0145] Optionally, when all pixels in the screen have not been traversed, step S750 may be executed to determine whether the stylus is lifted. When the stylus is lifted, it indicates that the user has no handwriting input and there is no handwriting lag, and the first frame is determined to be a valid frame. When the stylus is still writing, that is, the input is not completed, step S720 needs to be re-executed to compare the newly input pixels and execute subsequent steps.
[0146] According to the technical solution, an algorithm for detecting invalid frames based on pixel comparison can identify and discard invalid frames by comparing the sum of different pixels at the same position in the current frame and historical frames with the size of a preset threshold, thereby avoiding invalid frames occupying the frame cache module, achieving continuous writing of handwritten content, avoiding stylus jams, improving the hand-tracking performance of the stylus, and enhancing the user experience.
[0147] In a possible implementation, the frame filtering module can identify invalid frames by judging the layer visibility. The specific method is as follows: Fig. 9 Method 900 is shown.
[0148] Fig. 9 This is a flow chart of a method for identifying invalid frames provided by an embodiment of the present application. The specific process is as follows.
[0149] After the execution starts, at S910 , the system layer obtains the visibility and names of all layers for synthesizing the first frame.
[0150] The layers for synthesizing the first frame include a pen display layer, system status information, and display layers corresponding to other layers.
[0151] In the present application, the properties of each display layer include the layer name and visibility. For example, if the layer visibility is visible, it is represented by visible, and if the layer visibility is invisible, it is represented by invisible.
[0152] S920, select a layer and determine whether it is a stylus display layer.
[0153] Specifically, whether the layer is a stylus display layer is determined based on the layer name.
[0154] When it is determined that the layer is a stylus layer, step S910 is executed again. When the layer is not a stylus display layer, step S930 is executed downward.
[0155] S930, determining whether the layer state is invisible.
[0156] When it is determined that the layer is visible, the first frame is determined to be a valid frame.
[0157] When it is determined that the layer is invisible, the process proceeds to step S940.
[0158] S940, determining whether the layers have been traversed.
[0159] When it is determined that all layers have been traversed, the first frame is determined to be an invalid frame.
[0160] When it is determined that the layers have not been traversed completely, it is necessary to execute step S910 to traverse the remaining layers and execute subsequent steps.
[0161] Optionally, when the layers have not been traversed completely, step S950 may be executed to determine whether the stylus is lifted. When the stylus is lifted, that is, it is confirmed that there is no input or the input is completed, then it is assumed by default that there will be no new layers and there is no lag scene, then the first frame is determined to be a valid frame. When the stylus is still writing, that is, there may be new layer input, then step S910 needs to be re-executed to traverse the newly added layers and execute subsequent steps.
[0162] According to the technical solution, based on the layer display status (visibility) of the first frame, invalid frames can be identified and discarded by judging whether all the layers in the first frame are invisible layers, thereby avoiding the writing waiting of handwriting caused by invalid frames occupying the frame cache module, thereby avoiding the stylus from freezing, improving the tracking performance of the stylus, and improving the user experience.
[0163] In a possible implementation, the application can be forced to modify to ensure that when the application is in the background, it does not respond to all UI refresh processes, and handwriting jams can also be avoided.
[0164] Fig.10 is a schematic framework diagram of an electronic device provided in an embodiment of the present application. Fig.10 As shown, the electronic device 1000 may include one or more processors 1010; one or more memories 1020; the one or more memories 1020 store one or more computer programs, and the one or more computer programs include instructions. When the instructions are executed by one or more processors, the display method described in any possible implementation method described above is executed.
[0165] In some embodiments, the electronic device 1000 may be the electronic device mentioned above, for example, a large-screen device such as a smart TV, a laptop computer, or a smart screen.
[0166] An embodiment of the present application also provides a chip, which includes a processor and a communication interface, wherein the communication interface is used to receive a signal and transmit the signal to the processor, and the processor processes the signal so that the display method described in any possible implementation method described above is executed.
[0167] It is understandable that, in order to realize the above functions, the electronic device includes hardware and / or software modules corresponding to the execution of each function. In combination with the algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to be beyond the scope of the present application.
[0168] In this embodiment, the electronic device can be divided into functional modules according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0169] This embodiment further provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the display method in the above-mentioned embodiment.
[0170] This embodiment further provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the above-mentioned related steps to implement the display method in the above-mentioned embodiment.
[0171] In addition, an embodiment of the present application also provides a device, which may specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer execution instructions, and when the device is running, the processor may execute the computer execution instructions stored in the memory so that the chip executes the display method in the above-mentioned method embodiments.
[0172] Among them, the electronic device, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be repeated here.
[0173] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0174] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0175] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0176] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0177] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0178] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks or optical disks.
[0179] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A display method, characterized in that: Applied to electronic equipment, the method includes: synthesizing a first frame based on a first layer and a second layer, wherein the first layer is a stylus layer for displaying a first handwriting, and the second layer is a non-stylus layer for displaying other application content, wherein the second layer includes at least one layer; If it is determined that the first frame is an invalid frame, the first frame is discarded, and the second handwriting is superimposed and displayed on a history frame, where the history frame is a frame previous to the first frame; If it is determined that the first frame is a valid frame, the second handwriting is superimposed and displayed on the first frame, wherein the second handwriting is generated after the first handwriting.
2. The method according to claim 1, characterized in that The determining that the first frame is an invalid frame includes: Determine a sum of different pixels between the first frame and the historical frame, and determine a difference between the sum of the different pixels and a first threshold value; When the sum of the different pixels is less than or equal to the first threshold value, the first frame is determined to be an invalid frame, wherein the different pixels between the first frame and the historical frame are different pixels at the same position.
3. The method according to claim 1, characterized in that The determining that the first frame is an invalid frame includes: It is determined that all the visibility of the second layers is invisible, and the first frame is determined to be an invalid frame.
4. The method according to claim 3, characterized in that The method further comprises: Get the name and visibility of the first layer and the second layer.
5. The method according to claim 1, wherein The determining that the first frame is a valid frame includes: Determine a sum of different pixels between the first frame and the historical frame, and determine a difference between the sum of the different pixels and a first threshold value; When the sum of the different pixels is greater than the first threshold value, the first frame is a valid frame, wherein the different pixels between the first frame and the historical frame are different pixels at the same position.
6. The method according to claim 1, wherein The determining that the first frame is a valid frame includes: It is determined that the second layer includes a visible layer, and the first frame is determined to be a valid frame.
7. The method according to any one of claims 1 to 6, characterized in that The method further comprises: When the stylus pen writes on the electronic device, a start instruction is sent, where the start instruction is used to instruct to start identifying the first frame as a valid frame or an invalid frame; When the stylus stops writing on the electronic device, a termination instruction is sent, where the termination instruction is used to instruct to stop recognizing the first frame as a valid frame or an invalid frame.
8. A display device, characterized in that: The display device includes a layer synthesis module, a frame filtering module and a frame buffer module, wherein: The layer synthesis module is configured to synthesize a first frame based on a first layer and a second layer, wherein the first layer is a stylus layer for displaying a first handwriting, and the second layer is a non-stylus layer for displaying other application content, and the second layer includes at least one layer; The frame filtering module is configured to determine whether the first frame is an invalid frame or a valid frame; When the first frame is an invalid frame, the frame filtering module is further configured to discard the first frame, and the frame buffer module is configured to superimpose and display the second handwriting on a historical frame, where the historical frame is a frame preceding the first frame; When the first frame is a valid frame, the frame buffer module is used to overlay and display the second handwriting on the first frame, wherein the second handwriting is generated after the first handwriting.
9. The device according to claim 8, characterized in that The frame filtering module is specifically configured to determine the sum of different pixels between the first frame and the historical frame, and determine the difference between the sum of different pixels and a first threshold value; When the sum of the different pixels is less than or equal to the first threshold value, the first frame is determined to be an invalid frame, wherein the different pixels between the first frame and the historical frame are different pixels at the same position.
10. The device according to claim 8, characterized in that The frame filtering module is specifically configured to determine that all visibility of the second layers is invisible, and determine that the first frame is an invalid frame.
11. The device according to claim 10, characterized in that The frame filtering module is further configured to obtain the names and visibilities of the first layer and the second layer.
12. The device according to claim 8, characterized in that The frame filtering module is specifically configured to determine the sum of different pixels between the first frame and the historical frame, and determine the difference between the sum of different pixels and a first threshold value; When the sum of the different pixels is greater than the first threshold value, the first frame is determined to be a valid frame, wherein the different pixels between the first frame and the historical frame are different pixels at the same position.
13. The device according to claim 8, characterized in that The frame filtering module is specifically configured to determine that the second layer includes a visible layer and to determine that the first frame is a valid frame.
14. The device according to any one of claims 8 to 13, characterized in that The device also includes a frame filtering start and stop module, When the stylus is writing on the electronic device, the frame filtering start-stop module is used to send a start instruction, and the start instruction is used to instruct the frame filtering module to start identifying the first frame as a valid frame or an invalid frame; When the stylus stops writing on the electronic device, the frame filtering start-stop module is used to send a termination instruction, and the termination instruction is used to instruct the frame filtering module to stop identifying the first frame as a valid frame or an invalid frame.
15. An electronic device, characterized in that: include: one or more processors; One or more memories; the one or more memories store one or more computer programs, the one or more computer programs including instructions, which, when executed by one or more processors, enable the display method according to any one of claims 1 to 7 to be executed.
16. A chip, characterized in that: The chip includes a processor and a communication interface, wherein the communication interface is used to receive a signal and transmit the signal to the processor, and the processor processes the signal so that the display method according to any one of claims 1 to 7 is executed.
17. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and when the computer instructions are executed on a computer, the display method according to any one of claims 1 to 7 is executed.
18. A computer program product, characterized in that The invention comprises a computer program, which enables the display method according to any one of claims 1 to 7 to be executed when the computer program is executed.
