Electronic equipment and control method thereof

By obtaining the text to be displayed on low-end machines and adjusting the display method according to the display parameters, and directly using a single or multi-line display method to display text, the problem of lag and frame drops in low-end machines when displaying long text is solved, and the sliding performance and frame rate are improved.

CN119862852APending Publication Date: 2025-04-22HISENSE HOME APPLIANCES GRP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311368618.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-20
Publication Date
2025-04-22

AI Technical Summary

Technical Problem

When displaying long text, low-end machines have problems of lag and frame drops during sliding due to insufficient CPU performance.

Method used

By obtaining the text to be displayed and adjusting the layout according to the display parameters of the display, it is determined that the target display method is a single line or multiple line display method, and directly using these display methods to display the text, avoiding the repeated processing process of the text control.

Benefits of technology

Improves the performance and frame rate of list sliding, avoiding lag and frame drops.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119862852A_ABST
    Figure CN119862852A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses electronic equipment and a control method thereof, relates to the technical field of electronic equipment, and is used for solving the problems of lagging and frame dropping when a low-end machine displays a text. The electronic device includes: a display; the controller is in communication connection with the display; the controller is configured to obtain a to-be-displayed text; performing layout adjustment on the to-be-displayed text according to the display parameters of the display to obtain a text line number of the to-be-displayed text; determining a target display mode according to the text line number of the to-be-displayed text; wherein the display mode comprises a single-line display mode and a multi-line display mode; and controlling the display to display the to-be-displayed text based on the target display mode.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of electronic equipment, and in particular to an electronic equipment and a control method thereof. Background Art

[0002] With the development of computer technology, various real-time interactive applications for mobile devices have emerged, and gradually more and more users are making real-time comments on the applications.

[0003] In the prior art, taking a mobile device equipped with an Android system as an example, a text control (Text View) is usually used to display comments or other text information on a display screen. This method occupies little space and is easy to maintain.

[0004] However, due to the low performance of the central processing unit (CPU) of some low-end machines, the Text View control cannot meet the frame rate required by the user when sliding, resulting in problems such as freezes and loading timeouts when loading long text information on the display. Summary of the invention

[0005] The present application provides an electronic device and a control method thereof, which are used to solve the problem of freeze and frame drop when displaying text on a low-end machine.

[0006] In order to achieve the above objectives, this application adopts the following technical solutions.

[0007] In a first aspect, an embodiment of the present application provides an electronic device, comprising: a display; a controller, the controller being communicatively connected to the display; the controller being configured to: obtain text to be displayed; adjust the layout of the text to be displayed according to display parameters of the display to obtain the number of text lines of the text to be displayed; determine a target display mode according to the number of text lines of the text to be displayed; wherein the display mode includes a single-line display mode and a multi-line display mode; and control the display to display the text to be displayed based on the target display mode.

[0008] The technical solution provided by the embodiment of the present application brings at least the following beneficial effects: the embodiment of the present application does not adopt the conventional method of directly handing over the long text to the text control for processing, but when the text on the list slides, the single-line display mode and the multi-line display mode in the text control are extracted, and the single-line display mode or the multi-line display mode is directly used to display the text, thereby avoiding the process of recalculating when using the text control to display the text. The list repeats this process as it continues to slide back and forth. The process of judging the text type to select different processing methods and repeatedly calculating the interception and adding ellipsis to generate new text is omitted, thereby improving the performance and frame rate of list sliding.

[0009] In some embodiments, the controller, after being configured to adjust the layout of the text to be displayed according to the display parameters of the display and obtain the number of text lines of the text to be displayed, is also configured to: obtain the line display length of the text to be displayed; truncate the text to be displayed according to the line display length to obtain the truncated text to be displayed; cache the truncated text to be displayed to obtain the number of text lines of the cached text to be displayed.

[0010] In some embodiments, the controller is configured to determine the target display mode according to the number of text lines of the text to be displayed, and is specifically configured as follows: when the number of text lines of the text to be displayed is a single line, the target display mode of the text to be displayed is determined to be a single-line display mode; when the number of text lines of the text to be displayed is multiple lines, the target display mode of the text to be displayed is determined to be a multiple-line display mode.

[0011] In some embodiments, the controller is configured to control the display to display the text to be displayed based on a target display mode, and is specifically configured to: in response to a user's request to load the text to be displayed, when the target display mode of the text to be displayed is a single-line display mode, take out the single-line text from the cached text to be displayed; layout the single-line text based on a layout method of the single-line display mode, and display the laid out single-line text.

[0012] In some embodiments, the controller is configured to layout the text to be displayed based on a layout method for a target display mode, and display the laid out text to be displayed, and is also configured to: in response to a user's request to load the text to be displayed, when the target display mode of the text to be displayed is a multi-line display mode, take out multiple lines of text from the cached text to be displayed; layout the multiple lines of text based on a layout method for a multi-line display mode, and display the laid out multiple lines of text.

[0013] In a second aspect, an embodiment of the present application provides a control method for an electronic device, the method comprising: obtaining text to be displayed; adjusting the layout of the text to be displayed according to display parameters of the display to obtain the number of text lines of the text to be displayed; determining a target display mode according to the number of text lines of the text to be displayed; wherein the display mode includes a single-line display mode and a multi-line display mode; and controlling the display to display the text to be displayed based on the target display mode.

[0014] In a third aspect, an embodiment of the present application provides a controller comprising: one or more processors; one or more memories; wherein the one or more memories are used to store computer program codes, the computer program codes include computer instructions, and when the one or more processors execute the computer instructions, the controller executes any one of the control methods of the electronic device provided in the second aspect.

[0015] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on a computer, the computer executes the method provided in the second aspect and possible implementation methods.

[0016] In a fifth aspect, an embodiment of the present invention provides a computer program product, which can be directly loaded into a memory and contains software code. After being loaded and executed by a computer, the computer program product can implement the method provided in the second aspect and possible implementation methods.

[0017] It should be noted that the above computer instructions may be stored in whole or in part on a computer-readable storage medium, wherein the computer-readable storage medium may be packaged together with the processor of the controller, or may be packaged separately from the processor of the controller, which is not limited in this application.

[0018] The beneficial effects described in the second to fifth aspects of the present application can be referred to the beneficial effect analysis of the first aspect and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The accompanying drawings are used to provide a further understanding of the technical solution of the present invention and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present invention and do not constitute a limitation on the technical solution of the present invention.

[0020] Figure 1 A flowchart of a text display method provided in an embodiment of the present application;

[0021] Figure 2 A hardware structure diagram of an electronic device provided in an embodiment of the present application;

[0022] Figure 3 A hardware configuration block diagram of an electronic device provided in an embodiment of the present application;

[0023] Figure 4 A schematic diagram of a control method for an electronic device provided in an embodiment of the present application;

[0024] Figure 5 A front-end interface diagram of a low-end machine provided in an embodiment of the present application;

[0025] Figure 6 A flowchart of another text display method provided in an embodiment of the present application;

[0026] Figure 7 A schematic flow chart of another control method of an electronic device provided in an embodiment of the present application;

[0027] Figure 8A schematic flow chart of another control method of an electronic device provided in an embodiment of the present application;

[0028] Fig. 9 A schematic flow chart of another control method of an electronic device provided in an embodiment of the present application;

[0029] Fig.10 A front-end interface diagram of another low-end machine provided in an embodiment of the present application;

[0030] Fig.11 A schematic flow chart of another control method of an electronic device provided in an embodiment of the present application;

[0031] Fig.12 A front-end interface diagram of another low-end machine provided in an embodiment of the present application;

[0032] Fig.13 A schematic flow chart of another control method of an electronic device provided in an embodiment of the present application;

[0033] Fig.14 A schematic flow chart of another control method of an electronic device provided in an embodiment of the present application;

[0034] Fig.15 A structural schematic diagram of a text display device provided in an embodiment of the present application;

[0035] Fig.16 A schematic diagram of the structure of another text display device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0036] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0037] It should be noted that all directional indications in the embodiments of the present invention (such as up, down, left, right, front, back, etc.) are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.

[0038] The terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, unless otherwise specified, "plurality" means two or more.

[0039] In the description of this application, it should be noted that, unless otherwise clearly specified and limited, the terms "connected" and "connection" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances. In addition, when describing a pipeline, the "connected" and "connection" used in this application have the meaning of conduction. The specific meaning needs to be understood in conjunction with the context.

[0040] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0041] To facilitate understanding, some basic concepts of terms or technologies involved in the embodiments of the present invention are first briefly introduced and explained.

[0042] Text View: A text editor is a control used to display text in the Android system. It can set parameters such as width, height, color, font size, and bold for text information.

[0043] Boring Layout: A layout method in Text View, suitable for simple layouts with a single line of text and a text direction from left to right.

[0044] Static Layout: Another layout method in Text View, suitable for multi-line text.

[0045] Figure 1 In the prior art, the text display method used by electronic devices is as follows: Figure 1 As shown, after the user opens the application on the electronic device, the CPU will load the text to be displayed. If the user slides the text list, the text control (ie, Text View) in the electronic device starts processing the text and displays the processed text on the display of the electronic device.

[0046] Furthermore, if the user continues to slide the list at this time, the controller controls the Text View to repeatedly process the text. If the user does not continue to slide the list, the text processing operation is terminated.

[0047] As mentioned above, when long text of an application on a low-end machine slides in a list, the conventional approach is to directly use the native Text View text control in the system to display the text. However, due to CPU performance limitations on low-end machines, the method of directly using this native control Text View to display long text can no longer meet the requirement of a sliding frame rate of 60 frames, and there will be obvious lag.

[0048] Based on this, an embodiment of the present application provides an electronic device, including: a display; a controller, the controller and the display are communicatively connected; the controller is configured to: obtain text to be displayed; adjust the layout of the text to be displayed according to the display parameters of the display to obtain the number of text lines of the text to be displayed; determine the target display mode according to the number of text lines of the text to be displayed; wherein the display mode includes a single-line display mode and a multi-line display mode; control the display to display the text to be displayed based on the target display mode.

[0049] In this way, the two display modes inside the text control are extracted, and the display methods of the two display modes are directly called to display the processed text, avoiding the process of recalculating the text when using the text control to display the text, thereby improving the list sliding performance and frame rate.

[0050] The embodiments provided in this application are described in detail below in conjunction with the accompanying drawings.

[0051] Figure 2 A hardware structure diagram of an electronic device provided in an embodiment of the present application, such as Figure 2 As shown, the electronic device 10 includes a display 11 and a controller 1000 ( Figure 2 not shown).

[0052] The display 11 is communicatively connected with the controller 1000 .

[0053] In some embodiments, the display 11 is used to display text.

[0054] Optional, Figure 2The electronic device 10 shown is only an example of a terminal device. The electronic device 10 in the present application can be a remote control, a mobile phone, a tablet computer, a personal computer (PC), a personal digital assistant (PDA), a smart watch, a netbook, a wearable electronic device, an augmented reality (AR) device, a virtual reality (VR) device, a robot, etc. The present application does not impose any special restrictions on the specific form of the terminal device.

[0055] In the embodiments shown in the present application, the electronic device 10 is taken as a low-end device for illustration. In a specific implementation, the electronic device 10 may be any form of device, and the present application does not limit this.

[0056] In the embodiment shown in the present application, the controller 1000 refers to a device that can generate an operation control signal according to the instruction operation code and the timing signal to instruct the electronic device 10 to execute the control instruction. Exemplarily, the controller 1000 can be a central processing unit (CPU), a general-purpose processor network processor (NP), a digital signal processor (DSP), a microprocessor, a microcontroller, a programmable logic device (PLD) or any combination thereof. The controller 1000 can also be other devices with processing functions, such as circuits, devices or software modules, and the embodiments of the present application do not impose any restrictions on this.

[0057] In addition, the controller 1000 can be used to control various components inside the electronic device 10 so that each component operates to implement various predetermined functions of the electronic device 10 .

[0058] In some embodiments, the controller 1000 is configured to: obtain text to be displayed; adjust the layout of the text to be displayed according to the display parameters of the display to obtain the number of text lines of the text to be displayed; determine the target display mode according to the number of text lines of the text to be displayed; wherein the display mode includes a single-line display mode and a multi-line display mode; and control the display to display the text to be displayed based on the target display mode.

[0059] In some embodiments, the controller 1000 is further configured to: determine the line display length of the text to be displayed; truncate the text to be displayed according to the line display length to obtain the truncated text to be displayed; cache the truncated text to be displayed to obtain the number of text lines of the cached text to be displayed.

[0060] In some embodiments, the controller 1000 is further configured to: when the number of text lines of the text to be displayed is a single line, determine the target display mode of the text to be displayed to be a single-line display mode; when the number of text lines of the text to be displayed is multiple lines, determine the target display mode of the text to be displayed to be a multiple-line display mode.

[0061] In some embodiments, the controller 1000 is further configured to: in response to a user's request to load text to be displayed, when the target display mode of the text to be displayed is a single-line display mode, take out the single-line text from the cached text to be displayed; layout the single-line text based on the layout method of the single-line display mode, and display the laid out single-line text.

[0062] In some embodiments, the controller 1000 is further configured to: in response to a user's request to load text to be displayed, when the target display mode of the text to be displayed is a multi-line display mode, take out multiple lines of text from the cached text to be displayed; layout the multiple lines of text based on a layout method of the multi-line display mode, and display the laid out multiple lines of text.

[0063] Figure 3 1 is a hardware configuration block diagram of an electronic device provided by the present application according to an exemplary embodiment. Figure 3 As shown, the electronic device 10 may further include a processor 101 and a memory 102 .

[0064] Among them, the processor 101 is the core component of the electronic device 10, and the processor 101 is used to run the operating system of the electronic device 10 and the applications on the electronic device 10 (including system applications and third-party applications) to implement the electronic device 10 to execute the control method.

[0065] In some embodiments, the processor 101 may be a central processing unit (CPU).

[0066] processing unit, CPU), microprocessor, digital signal processor (digital signal processor)

[0067] A processor may be a computer programmable logic device (CPU), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a transistor logic device, a hardware component or any combination thereof, which can implement or execute the various exemplary logic blocks, modules and circuits described in conjunction with the contents disclosed in the embodiments of the present invention; a processor may also be a combination that implements a computing function, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0068] In some embodiments, the processor 101 of the electronic device 10 includes one or more CPUs, which are single-core CPUs (single-CPU) or multi-core CPUs (multi-CPU).

[0069] In some embodiments, the memory 102 includes but is not limited to random access memory (RAM), read only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, or optical storage.

[0070] In some embodiments, the memory 102 stores operating system codes. When the processor 101 reads the code stored in the memory and executes the control method of the electronic device provided by the embodiment of the present invention, the memory stores instructions for implementing the control method of the electronic device provided by the embodiment of the present invention.

[0071] Optionally, the processor 101 implements the control method of the electronic device in the embodiment of the present invention by reading instructions stored in the memory 102, or the processor 101 implements the control method of the electronic device provided by the embodiment of the present invention through internally stored instructions.

[0072] In some embodiments, the electronic device 10 may further include a network interface 103 .

[0073] In some embodiments, the network interface 103 is a wired interface, such as a fiber distributed data interface (FDDI) or a gigabit Ethernet (GE) interface. Alternatively, the network interface 103 is a wireless interface. The network interface 103 is used for the electronic device 10 to communicate with other devices.

[0074] In some embodiments, the memory 102 is used to store at least one text message. At least one processor 101 further executes the method described in the embodiment of the present invention according to the at least one text message stored in the memory 102. For more details on how the processor 101 implements the above functions, please refer to the description of each method embodiment below.

[0075] Optionally, the electronic device 10 further includes a bus, and the processor 101 and the memory 102 are interconnected via the bus 104, or are interconnected in other ways.

[0076] Optionally, the electronic device 10 further includes an input / output interface 105, which is used to connect to an input device and receive control instructions input by a user through the input device. The input device includes but is not limited to a keyboard, a touch screen, a microphone, etc. The input / output interface 105 is also used to connect to an output device and output the processing result of the processor 101. The output device includes but is not limited to a display, a printer, etc.

[0077] Those skilled in the art will understand that Figure 3 The hardware structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0078] Figure 4 A schematic flow chart of a control method for an electronic device provided in an embodiment of the present application is shown in FIG. Figure 4 As shown, taking the electronic device as a low-end device as an example, the method includes the following steps:

[0079] S101: The controller obtains text to be displayed.

[0080] The text to be displayed is the text that the user needs to display on the display screen of the low-end machine.

[0081] In some embodiments, when a user opens an application on a low-end machine and operates a text list in the application to slide, the controller usually directly uses a native text control (ie, Text View) to display the text.

[0082] Figure 5 A front-end interface diagram of a low-end machine provided in an embodiment of the present application, such as Figure 5 As shown, due to the limitation of CPU performance of low-end machines, the method of directly using Text View to display long text can no longer meet the requirement of 60 frames of sliding frame rate, resulting in slow loading and interruption when users slide the text list in the application.

[0083] Furthermore, after obtaining the text to be displayed of the application, the display mode inside the Text View is disassembled and extracted for layout and display of the text to be displayed.

[0084] Figure 6 A flowchart of another text display method provided in an embodiment of the present application. Figure 6 As shown, after obtaining the text to be displayed of the application, the Text View is controlled to determine the number of text lines to be displayed.

[0085] Optionally, if the number of lines of text to be displayed is one line, the single-line display mode Boring Layout in the Text View is extracted, and the text to be displayed is directly displayed using the display mode of Boring Layout.

[0086] Alternatively, if the text to be displayed has multiple lines, the multi-line display mode StaticLayout in the Text View is extracted, the text to be displayed is truncated according to the text length of the text to be displayed, and an ellipsis is added to the truncated text to generate new text, which is displayed using the Static Layout display mode.

[0087] Alternatively, if the text to be displayed is rich text, the rich text display mode DynamicLayout in the Text View is extracted, the rich text is converted, and then displayed through the display mode of Dynamic Layout.

[0088] It should be noted that rich text, also known as multi-text, is a cross-platform text format. Most word processing software can read and save rich text documents. Rich text is a text that is easy to view on different devices and systems.

[0089] 102. The controller adjusts the layout of the text to be displayed according to the display parameters of the display to obtain the number of text lines of the text to be displayed.

[0090] Among them, the display parameter of the display is the display length of the text.

[0091] Figure 7 A schematic flow chart of another control method of an electronic device provided in an embodiment of the present application, for determining the number of text lines to be displayed. Figure 7 As shown, the method comprises the following steps:

[0092] S201. The controller obtains the line display length of the text to be displayed.

[0093] In some embodiments, when a user performs a sliding operation on text in an application program of a low-end machine, the controller obtains the line display length of the text to be displayed.

[0094] Optionally, the row display length can be a.

[0095] S202: The controller truncates the text to be displayed according to the line display length to obtain the truncated text to be displayed.

[0096] In some embodiments, after the controller obtains the line display length of the text to be displayed, the controller truncates the text to be displayed according to the line display length of the text to be displayed, and adds an ellipsis to the truncated text to be displayed.

[0097] S203: The controller caches the truncated text to be displayed, and obtains the number of text lines of the cached text to be displayed.

[0098] In some implementations, after the text to be displayed is truncated and ellipsis is added, the processed text to be displayed is cached, and the text length and number of text lines of the cached text to be displayed including the ellipsis are calculated.

[0099] The number of text lines to be displayed includes a single line or multiple lines.

[0100] S103: The controller determines a target display mode according to the number of text lines of the text to be displayed.

[0101] The display mode includes a single-line display mode and a multi-line display mode.

[0102] Figure 8 A schematic flow chart of another control method of an electronic device provided in an embodiment of the present application, for determining a target display mode. Figure 8 As shown, the method comprises the following steps:

[0103] S301: When the number of text lines of the text to be displayed is a single line, the controller determines that the target display mode of the text to be displayed is a single-line display mode.

[0104] Specifically, when the number of text lines of the text to be displayed is a single line, the controller determines that the target display mode of the text to be displayed is a single-line display mode Boring Layout.

[0105] S302: When the number of text lines of the text to be displayed is multiple lines, the controller determines that the target display mode of the text to be displayed is a multiple-line display mode.

[0106] Specifically, when the number of text lines of the text to be displayed is multiple lines, the controller determines that the target display mode of the text to be displayed is the multiple-line display mode Static Layout.

[0107] S104: The controller controls the display to display the text to be displayed based on the target display mode.

[0108] In some embodiments, after the target display mode of the text to be displayed is determined, the controller may layout the text to be displayed according to the target display mode, and display the laid-out text to be displayed on the display of the low-end machine.

[0109] Fig. 9 A flow chart of another control method of an electronic device provided in an embodiment of the present application is shown as follows: Fig. 9 As shown, the method comprises the following steps:

[0110] S401 : In response to a user's request to load text to be displayed, a controller retrieves a single line of text to be displayed from cached text to be displayed when a target display mode of the text to be displayed is a single line display mode.

[0111] In some embodiments, if the target display mode of the text to be displayed is a single-line display mode, when the user initiates a request to load the text to be displayed on the application of the low-end machine, the controller responds to the user's request to load the text to be displayed and takes out the single-line text to be displayed from the cache.

[0112] S402: The controller layouts a single line of text based on a layout method for a single line display mode, and displays the layout single line of text.

[0113] In some embodiments, after taking out a single line of text from the text to be displayed in the cache, the controller layouts the single line of text based on a layout method of a single line display mode, and displays the layout single line of text.

[0114] Specifically, the controller extracts the single-line display mode Boring Layout in the Text View, and directly displays the text to be displayed using the display mode of Boring Layout. Fig.10 Another front-end interface of a low-end machine provided in an embodiment of the present application, the text in the front-end interface is displayed in a single-line manner.

[0115] Fig.11 A flow chart of another control method of an electronic device provided in an embodiment of the present application is shown as follows: Fig.11 As shown, the method comprises the following steps:

[0116] S501: In response to a user's request to load text to be displayed, a controller retrieves multiple lines of text to be displayed from cached text to be displayed when a target display mode of the text to be displayed is a multiple-line display mode.

[0117] In some embodiments, if the target display mode of the text to be displayed is a multi-line display mode, when the user initiates a request to load the text to be displayed on the application of the low-end machine, the controller responds to the user's request to load the text to be displayed and takes out multiple lines of text from the cached text to be displayed.

[0118] S502: The controller layouts multiple lines of text based on a layout method for a multiple-line display mode, and displays the layout multiple lines of text.

[0119] In some embodiments, after taking out multiple lines of text from the text to be displayed in the cache, the controller layouts the multiple lines of text based on a layout method of a multiple-line display mode, and displays the laid-out multiple lines of text.

[0120] Specifically, the controller extracts the multi-line display mode Static Layout in the Text View, and directly displays the text to be displayed using the display mode of Static Layout. Fig.12 Another front-end interface diagram of a low-end machine provided in an embodiment of the present application, the text in the front-end interface is displayed in a multi-line display mode.

[0121] The technical solution provided by the embodiment of the present application brings at least the following beneficial effects: the embodiment of the present application does not adopt the conventional method of directly handing over the long text to the text control for processing, but when the text on the list slides, the single-line display mode and the multi-line display mode in the text control are extracted, and the single-line display mode or the multi-line display mode is directly used to display the text, thereby avoiding the process of recalculating when using the text control to display the text. The list repeats this process as it continues to slide back and forth. The process of judging the text type to select different processing methods and repeatedly calculating the interception and adding ellipsis to generate new text is omitted, thereby improving the performance and frame rate of list sliding.

[0122] In some embodiments, the above method can also be performed as follows Fig.13 The process shown is implemented. Fig.13 A schematic flow chart of another control method of an electronic device provided in an embodiment of the present application, which is used to display a single line of text, such as Fig.13 As shown, the method comprises the following steps:

[0123] S11. Application development.

[0124] S12. Obtain the text to be displayed.

[0125] Specifically, the text to be displayed that needs to be loaded on the application is obtained.

[0126] S13, processing the text to be displayed.

[0127] Specifically, the method for calculating single-line truncated text in the text control Text View is extracted, and the length of the text displayed in a line of the text control is calculated in combination with the line display length of the text on the display. The text is truncated and an ellipsis is added to generate new text.

[0128] S14, caching the processed text to be displayed.

[0129] S15, list sliding rendering.

[0130] S16. Take out a single line of text from the cache.

[0131] S17, withdraw from the single-line display mode.

[0132] S18. Display text using a single-line display mode.

[0133] S19. If the user continues to slide the list, execute the above step S16; if the user does not continue to slide the list, end the display of the text.

[0134] Fig.14 A flow chart of another control method of an electronic device provided in an embodiment of the present application, which is used to display multiple lines of text, such as Fig.14 As shown, the method comprises the following steps:

[0135] S21. Application development.

[0136] S22. Obtain the text to be displayed.

[0137] S23, processing the text to be displayed.

[0138] S24, caching the processed text to be displayed.

[0139] S25, list sliding rendering.

[0140] S26. Retrieve multiple lines of text from the cache.

[0141] S27, extract the multi-line display mode.

[0142] S28. Display text using a multi-line display mode.

[0143] S29. If the user continues to slide the list, execute the above step S26; if the user does not continue to slide the list, end the display of the text.

[0144] The embodiment of the present invention can divide the functional modules of the electronic device etc. 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 or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present invention is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0145] In the case of dividing each functional module into corresponding functional modules, Fig.15 A possible structural diagram of the text display device involved in the above embodiment is shown. Fig.15 As shown, the text display device 40 is arranged in an electronic device, and the text display device 40 may include: an acquisition module 401 , a processing module 402 and a determination module 403 .

[0146] In some embodiments, the acquisition module 401 is used to acquire text to be displayed.

[0147] In some embodiments, the processing module 402 is used to adjust the layout of the text to be displayed according to the display parameters of the display to obtain the number of text lines of the text to be displayed.

[0148] In some embodiments, the determination module 403 is used to determine the target display mode according to the number of text lines of the text to be displayed.

[0149] In some embodiments, the processing module 402 is used to control the display to display the text to be displayed based on the target display mode.

[0150] In some embodiments, the acquisition module 401 is further used to acquire the line display length of the text to be displayed.

[0151] In some embodiments, the processing module 402 is further used to truncate the text to be displayed according to the line display length to obtain the truncated text to be displayed.

[0152] In some embodiments, the processing module 402 is further used to cache the truncated text to be displayed, and obtain the number of text lines of the cached text to be displayed.

[0153] In some embodiments, the determination module 403 is further configured to determine that the target display mode of the text to be displayed is a single-line display mode when the number of text lines of the text to be displayed is a single-line display mode.

[0154] In some embodiments, the determination module 403 is further configured to determine that the target display mode of the text to be displayed is a multi-line display mode when the number of text lines of the text to be displayed is multiple lines.

[0155] In some embodiments, the processing module 402 is further configured to, in response to a user's request to load the text to be displayed, retrieve the single-line text from the cached text to be displayed when the target display mode of the text to be displayed is a single-line display mode.

[0156] In some embodiments, the processing module 402 is further configured to layout a single line of text based on a layout method of a single line display mode, and display the layout single line of text.

[0157] In some embodiments, the processing module 402 is further configured to respond to a user's request to load the text to be displayed, and when the target display mode of the text to be displayed is a multi-line display mode, retrieve multiple lines of text from the cached text to be displayed.

[0158] In some embodiments, the processing module 402 is further configured to layout multiple lines of text based on a layout method of a multiple-line display mode, and display the laid-out multiple lines of text.

[0159] In the case of an integrated unit, Fig.16 FIG. 2 shows a possible structural diagram of the text display device involved in the above embodiment. Fig.16 As shown, the text display device 40 may include: a communication module 501 .

[0160] In some embodiments, the communication module 501 may be used to support the communication between the text display device 40 and other entities. Fig.16 As shown, the text display device 40 may further include a storage module 502 for storing program codes and data of the text display device 40 .

[0161] An embodiment of the present invention further provides a computer-readable storage medium, which includes computer-executable instructions. When the computer-executable instructions are executed on a computer, the computer executes the method provided in the above embodiment.

[0162] An embodiment of the present invention further provides a computer program product, which can be directly loaded into a memory and contains software code. After being loaded and executed by a computer, the computer program product can implement the method provided in the above embodiment.

[0163] Those skilled in the art will appreciate that in one or more of the above examples, the functions described in the present invention may be implemented in hardware, software, firmware, or any combination thereof. When implemented using software, the functions may be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any media that facilitates the transmission of a computer program from one place to another. The storage medium may be any available medium that a general or special-purpose computer can access.

[0164] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned 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.

[0165] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely exemplary, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the coupling or direct coupling or communication connection between each other 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. The unit described as a separate component may or may not be physically separated, and the component displayed as a unit may be a physical unit or multiple physical units, that is, it may be located in one place, or it may be distributed in multiple different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the scheme of this embodiment.

[0166] In addition, each functional unit in each embodiment of the present invention can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit. If the integrated unit is implemented in the form of 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 solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a ROM, a RAM, a disk, or an optical disk.

[0167] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application 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. An electronic device, characterized in that: The electronic device comprises: monitor; A controller, the controller being communicatively connected to the display; The controller is configured to: Get the text to be displayed; According to the display parameters of the display, the layout of the text to be displayed is adjusted to obtain the number of text lines of the text to be displayed; Determine a target display mode according to the number of text lines of the text to be displayed; wherein the display mode includes a single-line display mode and a multi-line display mode; The display is controlled to display the text to be displayed based on the target display mode.

2. The electronic device according to claim 1, characterized in that: The controller, after being configured to adjust the layout of the text to be displayed according to the display parameters of the display to obtain the number of text lines of the text to be displayed, is further configured to: Obtaining the line display length of the text to be displayed; According to the line display length, the text to be displayed is truncated to obtain the truncated text to be displayed; The truncated text to be displayed is cached to obtain the number of text lines of the cached text to be displayed.

3. The electronic device according to claim 2, characterized in that: The controller is configured to determine the target display mode according to the number of text lines of the text to be displayed, and is specifically configured as follows: When the number of text lines of the text to be displayed is a single line, determining the target display mode of the text to be displayed to be the single-line display mode; When the number of text lines of the text to be displayed is multiple lines, the target display mode of the text to be displayed is determined to be the multiple-line display mode.

4. The electronic device according to claim 3, characterized in that: The controller is configured to control the display to display the text to be displayed based on the target display mode, and is specifically configured to: In response to the user's request to load the text to be displayed, when the target display mode of the text to be displayed is the single-line display mode, taking out the single-line text from the cached text to be displayed; The single-line text is laid out based on the layout method of the single-line display mode, and the laid-out single-line text is displayed.

5. The electronic device according to claim 4, characterized in that: The controller is configured to layout the text to be displayed using the layout method based on the target display mode and display the layout text to be displayed, and is also configured to: In response to the user's request to load the text to be displayed, when the target display mode of the text to be displayed is the multi-line display mode, taking out multiple lines of text from the cached text to be displayed; The multiple lines of text are laid out based on the layout method of the multiple lines display mode, and the laid out multiple lines of text are displayed.

6. A method for controlling an electronic device, characterized in that: The method comprises: Get the text to be displayed; According to the display parameters of the display, the layout of the text to be displayed is adjusted to obtain the number of text lines of the text to be displayed; Determine a target display mode according to the number of text lines of the text to be displayed; wherein the display mode includes a single-line display mode and a multi-line display mode; The display is controlled to display the text to be displayed based on the target display mode.

7. The method according to claim 6, characterized in that After adjusting the layout of the text to be displayed according to the display parameters of the display to obtain the number of text lines of the text to be displayed, the method further includes: Obtaining the line display length of the text to be displayed; According to the line display length, the text to be displayed is truncated to obtain the truncated text to be displayed; The truncated text to be displayed is cached to obtain the number of text lines of the cached text to be displayed.

8. The method according to claim 7, characterized in that The step of determining a target display mode according to the number of text lines of the text to be displayed includes: When the number of text lines of the text to be displayed is a single line, determining the target display mode of the text to be displayed to be the single-line display mode; When the number of text lines of the text to be displayed is multiple lines, the target display mode of the text to be displayed is determined to be the multiple-line display mode.

9. The method according to claim 8, characterized in that The controlling the display to display the text to be displayed based on the target display mode includes: In response to the user's request to load the text to be displayed, when the target display mode of the text to be displayed is the single-line display mode, taking out the single-line text from the cached text to be displayed; The single-line text is laid out based on the layout method of the single-line display mode, and the laid-out single-line text is displayed.

10. The method according to claim 9, characterized in that The controlling the display to display the text to be displayed based on the target display mode also includes: In response to the user's request to load the text to be displayed, when the target display mode of the text to be displayed is the multi-line display mode, taking out multiple lines of text from the cached text to be displayed; The multiple lines of text are laid out based on the layout method of the multiple lines display mode, and the laid out multiple lines of text are displayed.