Method for cloud computing character string display length of Android smart television

By synchronizing terminal display parameters on the cloud platform and using canvas to draw simulated terminal displays, the problem of abnormal terminal display caused by differences in character display width in Android smart TVs was solved, achieving precise matching between the cloud and the terminal, and improving operational efficiency and user experience.

CN121397290APending Publication Date: 2026-01-23SICHUAN CHANGHONG ELECTRIC CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511719013.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-21
Publication Date
2026-01-23

AI Technical Summary

Technical Problem

The existing cloud content configuration for Android smart TVs does not take into account the differences in character display width, resulting in abnormal terminal display. Furthermore, the lack of a cloud-terminal display length synchronization mechanism affects operational efficiency and user experience.

Method used

By synchronizing the maximum length and text display style of the terminal display component on the cloud platform, using canvas to draw and simulate the terminal display, the actual length of the string is calculated in real time, and a prompt and deletion mechanism is automatically triggered when the limit is exceeded to ensure that the content meets the terminal display requirements.

Benefits of technology

It achieves precise matching between cloud-configured content and terminal display, improves operational configuration efficiency, ensures complete display of terminal content, reduces the risk of user complaints, and enhances user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121397290A_ABST
    Figure CN121397290A_ABST
Patent Text Reader

Abstract

The invention relates to a smart television technology, discloses a method for calculating the display length of a character string of an Android smart television at a cloud end, and solves the problems that in the cloud end content configuration of the existing Android smart television, the difference of the character display width is not considered in a traditional character number limiting mode, and the display lengths of the cloud end and a terminal are not synchronous, so that the terminal display is abnormal. According to the scheme, the television terminal determines the maximum display length of a display component and a terminal text display style and synchronizes the maximum display length and the terminal text display style to a cloud; an operator edits to-be-issued character string content at the cloud; the cloud end draws the currently edited character string content through canvas based on a terminal text display style, calculates the actual display length of the character string in a terminal display component, compares the actual display length with the maximum display length, and triggers a length control mechanism if the actual display length exceeds the maximum display length until the actual display length meets the maximum display length requirement; and after the operator confirms the character string content meeting the requirement, submitting the character string content for auditing, and after the character string content passes the auditing, issuing the character string content to the television terminal by the cloud to complete content display.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of smart TV technology, and more specifically to a method for calculating the display length of a string on an Android smart TV in the cloud. Background Technology

[0002] In recent years, with the popularization of smart terminal technology and the upgrading of home entertainment scenarios, Android smart TVs have become the core devices for home audio-visual and interactive experiences. The various applications they carry (such as video on demand, life services, educational courses, etc.) need to dynamically obtain and display text content (such as program names, function descriptions, and promotional activity copy) through cloud interfaces to meet the needs of real-time content updates and personalized operation.

[0003] In the application development and operation practice of Android smart TVs, the length of terminal display components is subject to fixed limitations. Affected by factors such as TV screen size, resolution, and UI layout design, the length of the text display area of ​​a single display component (such as a button or title bar) is preset to a fixed pixel value (e.g., 200px, 300px). Text exceeding this length is prone to truncation, line breaks, or overlap, which can damage the user's visual experience and even prevent key information from being fully conveyed.

[0004] To address the issue of adapting cloud-delivered content to terminal display lengths, existing technologies generally employ a crude approach of character count limits: when operators input text content through a cloud configuration platform, the system only intercepts submissions based on the number of characters (e.g., a limit of 15 Chinese characters or 30 English characters), prohibiting submissions exceeding the preset limit. However, this approach has certain drawbacks: due to differences in the display width of different characters in computer encoding systems—for example, in the default Android font, if the terminal text display length is 200px, configuring all Chinese characters allows for approximately 12 characters, while configuring all English characters allows for 20-30 characters—limiting only by the number of characters leads to two extreme situations: on the one hand, when configuring English characters, the actual display length may not reach the component's limit, resulting in wasted display space and preventing operators from fully utilizing the terminal's display capabilities to convey more effective information; on the other hand, when configuring Chinese characters, the actual display length may exceed the component's limit, even without triggering the character count limit, resulting in terminal display truncation issues, requiring operators to repeatedly preview, modify, and submit, significantly increasing configuration workload and process time.

[0005] Furthermore, existing technologies lack a cloud-terminal display length synchronization mechanism: the cloud configuration platform cannot obtain the actual display length of components on a specific Android smart TV terminal in real time, nor can it simulate the impact of terminal font styles (such as font type, font size, and font weight) on text display width. Simultaneously, operators cannot know the terminal display effect of the current content in real time during the configuration process; they must complete the configuration and submit it for physical terminal preview verification. If display problems occur, the modification and review process must be restarted, which not only reduces operational efficiency but may also affect user experience due to abnormal content display, potentially leading to user complaints.

[0006] In summary, there is an urgent need for a technical solution in the current cloud content configuration of Android smart TVs that can accurately calculate the display width of strings based on the actual display length of the terminal. This would solve the adaptation deviation problem caused by the traditional character count limitation, achieve accurate matching between cloud-configured content and terminal display capabilities, reduce operating configuration costs, and ensure the content display experience for end users. Summary of the Invention

[0007] The technical problem to be solved by this invention is to provide a method for calculating the display length of strings on Android smart TVs in the cloud, thereby solving the problem of abnormal terminal display caused by the traditional method of limiting the number of characters in the cloud content configuration of Android smart TVs, which does not take into account the difference in character display width and the asynchrony between the display length of the cloud and the terminal.

[0008] The technical solution adopted by the present invention to solve the above-mentioned technical problems is as follows: A method for calculating the display length of a string on an Android smart TV via the cloud includes the following steps: S1. The Android smart TV terminal determines the maximum display length of the display component and the terminal text display style, and synchronizes the maximum display length and text display style to the cloud platform; S2. The operator edits the string content to be sent to the Android smart TV terminal on the cloud platform, and the cloud platform monitors the editing behavior in real time; S3. The cloud platform uses a canvas to draw the currently edited string content based on the synchronized terminal text display style, and calculates the actual display length of the string in the terminal display component. S4. The cloud platform compares the actual display length with the synchronized maximum display length. If the actual display length exceeds the maximum display length, the length control mechanism is triggered until the actual display length meets the maximum display length requirement. S5. After the operations staff confirms that the string content meets the requirements, they submit it for review. Once the review is approved, the cloud platform sends the string content to the Android smart TV terminal, and the terminal completes the content display.

[0009] Furthermore, in step S1, the Android smart TV terminal determines the text display style by configuring a font file. The font file is compatible with both the terminal and the cloud platform, and the Android smart TV terminal is a standard-size device that supports HTTP network access.

[0010] Furthermore, in step S1, the terminal text display style includes font type and font size; the maximum display length is obtained by calculating the limit of the text content that the terminal application can accommodate in pixels.

[0011] Furthermore, in step S2, the operator accesses the cloud platform through a computer with the Chrome browser installed, and edits the string content to be sent to the Android smart TV terminal on the cloud platform.

[0012] Furthermore, in step S3, after each character editing operation is completed by the operator, the cloud platform immediately performs hidden drawing through the canvas, and the drawing process follows the synchronous terminal text display style.

[0013] Furthermore, in step S4, the length control mechanism includes: the cloud platform pops up a prompt box to inform the operators that too much content has been entered, and at the same time, it cyclically deletes characters starting from the end of the string. After each character is deleted, it redraws the canvas in real time and calculates the actual display length until the actual display length meets the maximum display length requirement.

[0014] Furthermore, in step S5, the operations personnel confirm the string content that meets the requirements, including: if the string content processed by the cloud platform meets the distribution requirements, it is submitted for review directly; if it does not meet the requirements, steps S2 to S4 are repeated to adjust and optimize the string content.

[0015] Furthermore, in step S5, after the Android smart TV terminal receives the sent string content, it verifies whether the content display length meets the maximum display length requirement, and ensures that the content is not truncated or overlapped before presenting it completely in the display component.

[0016] The beneficial effects of this invention are: (1) Accurately adapts to terminal display, solving the problem of traditional adaptation deviation: This invention synchronizes the maximum display length of components and text display style of Android smart TV terminals in the cloud, and calculates the actual display length of strings by combining canvas drawing. This avoids wasting display space when configuring English characters and prevents the terminal display from being truncated when configuring Chinese characters. It achieves accurate matching between cloud-configured content and terminal display capabilities, ensuring that the text content is complete and displayed without abnormalities.

[0017] (2) Improve operational efficiency and reduce the cost of repetitive work: The cloud platform monitors input in real time and calculates the display length synchronously. When the content exceeds the limit, it automatically triggers a prompt and deletion mechanism. Operators do not need to submit configurations and preview and verify them through physical terminals. They can directly confirm the content based on the cloud calculation results, avoiding redundant operations such as repeated modifications and re-going through the review process due to display issues, and greatly shortening the configuration cycle.

[0018] (3) Ensure end-user experience and reduce operational risks: Through precise cloud-based management and terminal verification, the system ensures that the string content sent to Android smart TVs is always within the component display range, without truncation or overlap. This avoids situations where users are unable to obtain information or experience poor visual quality due to abnormal content display, reducing the risk of user complaints and improving product satisfaction. Attached Figure Description

[0019] Figure 1 This is a flowchart of the platform processing input data logic in the cloud-based method for calculating the string display length of an Android smart TV in an embodiment of the present invention.

[0020] Figure 2 This is a flowchart illustrating how operators use the platform in the cloud-based method for calculating the display length of a string on an Android smart TV, as described in this embodiment of the invention. Detailed Implementation

[0021] This invention aims to provide a method for calculating the display length of strings on Android smart TVs in the cloud, solving the problem of abnormal terminal display caused by the traditional method of limiting the number of characters in the cloud content configuration of Android smart TVs, which does not consider the difference in character display width and the asynchrony between the cloud and terminal display lengths. Its core idea is to establish a display parameter synchronization mechanism between the Android smart TV terminal and the cloud platform, using the actual pixel length of the terminal display components as a benchmark, instead of the traditional coarse character number limit. Using canvas technology, the actual display length of the string is calculated in real time in the cloud, simulating the terminal text display effect. Through a closed-loop process of real-time monitoring, dynamic calculation, and over-limit control, precise matching between the cloud-configured content and the terminal display capabilities is achieved, ultimately improving operational configuration efficiency and ensuring the complete display of terminal content.

[0022] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0023] Example: This embodiment provides a method for calculating the display length of a string on an Android smart TV in the cloud. The following basic conditions must be met before implementation. Terminal device: Select a standard-size smart TV based on the Android system. The device must support HTTP network access. The standard size ensures the universality of display component length calculation, and the HTTP network is a necessary channel for synchronizing data between the terminal and the cloud.

[0024] Font and style consistency: Android smart TV terminal applications are pre-configured with specific font files, which need to be deployed to the cloud platform at the same time to ensure that the font simulated in the cloud is consistent with the font actually displayed on the terminal. The difference in character width of different fonts will directly affect the display length. Therefore, a unified font is a prerequisite for the accuracy of calculation results.

[0025] Cloud environment conditions: Operations personnel access the cloud platform using computers with the latest version of the Chrome browser installed, and the computers are located on an enterprise intranet with no exit restrictions. The Chrome browser has the best compatibility with canvas drawing, which can avoid drawing deviations caused by differences in browser kernels. The network with no exit restrictions ensures the efficiency of data synchronization between the cloud and the terminal.

[0026] Combination Figure 1 and Figure 2 The method for calculating the display length of a string on an Android smart TV using cloud computing in this embodiment includes the following steps: 1. Operations personnel access the cloud platform and edit content: In this step, the operator opens the Chrome browser, enters the URL of the cloud configuration platform and logs in to the system; then, in the content configuration module, they edit the string content that needs to be sent to the smart TV, and the edited content is displayed visually in sync.

[0027] 2. The cloud platform monitors editing events in real time to obtain the edited content: In this step, the cloud platform can listen to the editing behavior of the operators through the input event of JavaScript. The listener is triggered every time the operators enter / delete a character, thereby obtaining the edited content.

[0028] 3. The cloud platform uses canvas to hide and draw the acquired editing content and calculate the display length: In this step, after each trigger, the cloud platform calls the canvas API to create a hidden canvas and draws the complete string being edited on the canvas according to CSS styles pre-synchronized with the terminal device. This drawing accurately simulates the text display effect on the terminal, and by calling the `canvas.measureText()` method, the actual pixel length of the drawn string can be calculated, facilitating subsequent comparison of the character length (in pixels) of the currently edited content. The reason for using a hidden canvas is to achieve real-time background calculation without interfering with the operators' editing operations; that is, operators cannot see the drawing process, only the final length indication, balancing calculation accuracy and user experience.

[0029] 4. Content length comparison and limit control: In this step, the cloud platform compares the character length of the currently edited content calculated in step 3 with the maximum display length of the display component pre-synchronized with the Android smart TV terminal (obtained by calculating the maximum pixel length of text content that the display component can accommodate through the terminal application). If the character length of the currently edited content exceeds the maximum display length of the TV terminal's display component, a control action is triggered. For example, a red prompt box "Current content exceeds terminal display length" pops up, informing the operator of the over-limit situation. Simultaneously, the cloud platform automatically deletes characters from the end of the string in a loop (deleting one character at a time). After deletion, the canvas drawing and length calculation in step 3 are immediately re-executed until the maximum display length requirement is met, at which point deletion stops. It is understandable that if no character length over-limit situation occurs during the operator's editing process, the platform will not provide any prompts, and the operator can continue editing.

[0030] This embodiment uses a mechanism of end-loop deletion + real-time recalculation instead of directly truncating to a fixed length in order to preserve the core semantics of the string to the greatest extent and avoid semantic loss due to truncating key prefixes.

[0031] The pop-up notification is designed to inform operations staff of the fact that the limits have been exceeded, preventing them from misjudging the completeness of the content due to automatic deletion, and reflecting the need for intelligent and transparent operations.

[0032] 5. Operations personnel confirmation and content submission: In this step, the operations staff reviews the automatically deleted content to determine if it meets the requirements for distribution. If it meets the requirements (e.g., core information is not lost), they click the "Submit for Review" button, and the platform generates a configuration record and transfers it to the review stage. If it does not meet the requirements (e.g., the ending semantics are incomplete), the operations staff can manually modify the content. During the modification process, the platform repeats steps 3 and 4 to ensure that the length of the new content meets the maximum display length requirement.

[0033] Before submitting, operators do not need to preview the content on a physical terminal. Instead, they can simply refer to the character length comparison results displayed on the cloud platform to confirm the display effect of the content to be distributed on the Android smart TV terminal, thereby shortening the configuration cycle.

[0034] 6. Verification upon approval and terminal display: In this step, the reviewer logs into the cloud platform, views the content and length calculation log submitted by the operations personnel, and clicks "Send to Terminal" after approval. The cloud platform sends the string content to the target Android smart TV terminal via the HTTP protocol. After receiving the content, the terminal verifies the actual display length of the content again (using the Paint.measureText() method, consistent with the cloud canvas calculation logic). After confirming that the length does not exceed the maximum display length requirement, the content is fully displayed in the target display component.

[0035] The design of terminal secondary verification is to form a closed loop of cloud computing and terminal verification. Although the cloud has calculated accurately, the terminal may cause display deviation due to temporary anomalies (such as font file corruption, component size being modified unexpectedly, etc.). Secondary verification can further ensure the display effect.

[0036] Although embodiments of the present invention have been described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the present invention, and all such changes and alterations shall not depart from the protection scope of the present invention.

Claims

1. A method for displaying length of string of cloud computing Android smart TV, characterized in that, Includes the following steps: S1. The Android smart TV terminal determines the maximum display length of the display component and the terminal text display style, and synchronizes the maximum display length and text display style to the cloud platform; S2. The operator edits the string content to be sent to the Android smart TV terminal on the cloud platform, and the cloud platform monitors the editing behavior in real time; S3. The cloud platform uses a canvas to draw the currently edited string content based on the synchronized terminal text display style, and calculates the actual display length of the string in the terminal display component. S4. The cloud platform compares the actual display length with the synchronized maximum display length. If the actual display length exceeds the maximum display length, the length control mechanism is triggered until the actual display length meets the maximum display length requirement. S5. After the operations staff confirms that the string content meets the requirements, they submit it for review. Once the review is approved, the cloud platform sends the string content to the Android smart TV terminal, and the terminal completes the content display.

2. The method for calculating the display length of a string on an Android smart TV in the cloud as described in claim 1, characterized in that, In step S1, the Android smart TV terminal determines the text display style by configuring a font file. The font file is compatible with both the terminal and the cloud platform, and the Android smart TV terminal is a standard-size device that supports HTTP network access.

3. The method for calculating the display length of a string on an Android smart TV in the cloud as described in claim 1, characterized in that, In step S1, the terminal text display style includes font type and font size; the maximum display length is obtained by the terminal application calculating the limit of the text content that the display component can accommodate.

4. The method for calculating the display length of a string on an Android smart TV in the cloud as described in claim 1, characterized in that, In step S2, the operator accesses the cloud platform through a computer with the Chrome browser installed, and edits the string content to be sent to the Android smart TV terminal on the cloud platform.

5. The method for calculating the display length of a string on an Android smart TV in the cloud as described in claim 1, characterized in that, In step S3, after each character editing operation is completed by the operator, the cloud platform immediately performs hidden drawing through the canvas, and the drawing process follows the synchronous terminal text display style.

6. A method of displaying length of string in cloud computing Android smart TV as claimed in claim 5, wherein, In step S4, the length control mechanism includes: the cloud platform pops up a prompt box to inform the operators that too much content has been entered, and at the same time, it deletes characters in a loop starting from the end of the string. After each character is deleted, it redraws the canvas in real time and calculates the actual display length until the actual display length meets the maximum display length requirement.

7. The method for calculating the display length of a string on an Android smart TV in the cloud as described in claim 1, characterized in that, In step S5, the operations staff confirms the string content that meets the requirements, including: if the string content processed by the cloud platform meets the distribution requirements, it is submitted for review directly; if it does not meet the requirements, steps S2 to S4 are repeated to adjust and optimize the string content.

8. A method for calculating the display length of a string on an Android smart TV in the cloud, as described in any one of claims 1-7, characterized in that, In step S5, after receiving the sent string content, the Android smart TV terminal verifies whether the content display length meets the maximum display length requirement, and ensures that the content is not truncated or overlapped before displaying it completely in the display component.