Watch face display method and electronic device

By obtaining the watch face configuration file and creating display controls using mapping rules, the consistency problem of watch face design drafts for smart wearable devices being displayed on different devices was solved, enabling rapid iteration and efficient adaptation.

CN123137783APending Publication Date: 2026-11-20BEIMI TECHNOLOGY (ZHUHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611352519.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-02
Publication Date
2026-11-20

AI Technical Summary

Technical Problem

The design of smart wearable device watch faces suffers from misunderstandings and code implementation errors during the design and display process, resulting in long iteration cycles and low efficiency in adapting to different devices.

Method used

By obtaining the dial configuration file, display controls are created using the mapping rules pre-stored in the electronic device, automatically binding data sources and resource files, and rendering them on the screen. This eliminates the discrepancy between design intent and code implementation, and supports adaptive display to different screen sizes and resolutions.

Benefits of technology

This allows watch face designs to be displayed directly without code development, shortening the iteration cycle, improving resource reuse and adaptation efficiency, and ensuring that the display effect is consistent with the design intent.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123137783A_ABST
    Figure CN123137783A_ABST
Patent Text Reader

Abstract

The present disclosure relates to the technical field of display, and discloses a watch face display method and an electronic device. The method comprises: obtaining a watch face configuration file exported by an interface design tool according to a watch face design draft, the watch face configuration file comprising component descriptions corresponding to components in the design draft one by one, each component description comprising a component type field, attribute parameters and a data type field; for each component description, determining a control implementation class corresponding to the component type field and creating a display control according to a mapping rule stored in advance by the electronic device, setting values of the attribute parameters as values of corresponding control attributes of the display control, determining a data source corresponding to the data type field and binding the data source to the display control, and loading a corresponding resource file; and rendering each display control. The present disclosure enables the watch face design draft to be directly displayed on the electronic device without code development and compilation, eliminates deviation between design intention and display effect, and improves watch face development and iteration efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of display technology, and particularly to dial display technology. Background Technology

[0002] The descriptions in this section are intended to provide background information for the implementation of this disclosure and should not be construed as an admission or implication that they constitute prior art.

[0003] Smartwatches, smart bracelets, and other wearable devices typically support changing and customizing watch faces, which consist of various display elements such as time, date, steps, and heart rate. Currently, watch faces are usually designed by designers using interface design tools, and then developers write code based on the design to convert the display elements into controls in the device's graphics library, which are then compiled and written into the device firmware. In this process, the design intent needs to be understood by the developer and implemented in code, which can easily lead to misunderstandings. Code modifications may also result in inconsistencies between the actual display and the design intent, making it difficult for designers to quickly verify the design effect on the device. Developers need to convert each design into code, which is time-consuming and error-prone. Each design change requires recoding and recompiling, resulting in a long iteration cycle. In addition, different devices have different screen sizes and resolutions, requiring separate adaptation code to be written for each device and control layouts to be manually adjusted, leading to low adaptation efficiency. Summary of the Invention

[0004] This disclosure provides a dial display method and an electronic device, which can solve the technical problem of how to display dial designs directly and accurately on electronic devices without code development and compilation.

[0005] According to one aspect of this disclosure, a dial display method is provided, applied to an electronic device, the method comprising: Obtain the watch face configuration file, which is a file exported by the interface design tool based on the watch face design draft. The watch face configuration file includes component descriptions that correspond one-to-one with each component in the watch face design draft. Each component description includes a component type field, attribute parameters, and a data type field. The dial configuration file is parsed, and the following processing is performed for each component description: Based on the mapping rules pre-stored in the electronic device, the corresponding control implementation class for the component type field is determined, and a display control is created based on the determined control implementation class; based on the mapping rules, the value of the attribute parameter is set to the value of the corresponding control attribute of the display control; based on the mapping rules, the data source corresponding to the data type field is determined, the determined data source is bound to the display control, and if a resource file corresponding to the data type field exists in the mapping rules, the resource file is loaded into the display control; The created display controls are rendered on the screen of the electronic device, wherein each display control displays data provided by the bound data source.

[0006] In a preferred embodiment, the attribute parameter includes the relative coordinates of the component corresponding to the component description with respect to the screen size; Setting the value of the attribute parameter to the value of the corresponding control attribute of the display control includes: obtaining the screen resolution of the electronic device, converting the relative coordinates into pixel coordinates according to the screen resolution, and setting the pixel coordinates as the value of the position attribute of the display control.

[0007] In a preferred embodiment, each component description further includes a component identifier and a correction boundary, the correction boundary including the correction action allowed to be performed on the display control and the allowed magnitude of the correction action; each data type in the mapping rule is also associated with a data file, the data file including at least one of the following: upper and lower bounds of the data type value, maximum number of bits, format template, and longest string in each language; The step of creating a display control based on the determined control implementation class includes: storing the component identifier in the created display control; Before rendering and displaying the created display controls on the screen of the electronic device, the method further includes: A pre-rehearsal dataset is generated based on the data files associated with the data source data to which each of the display controls is bound; The data in the pre-rehearsal dataset is injected into each of the display controls, and each of the display controls is rendered in the off-screen buffer to obtain a color buffer and an identity map. Each pixel in the identity map records the component identifier of the display control to which the pixel belongs. The display metric for each display control is calculated based on the identity graph, and the display controls with display anomalies are determined based on the display metric. Adjust the control properties of the display control with display abnormality within the correction boundary, and recreate the display control with display abnormality according to the adjusted control properties; The rendering and displaying of the created display controls on the screen of the electronic device includes: rendering and displaying the various display controls, including the recreated display controls.

[0008] In a preferred embodiment, the correction boundary further includes a minimum visible scale; the simulation dataset includes worst-case combination data and control-by-control extreme value data, wherein the worst-case combination data is the longest content in the data archive of all display controls bound to the data source is injected simultaneously, and the control-by-control extreme value data is the extreme value in the data archive of only one display control is injected while the other display controls retain the sample value; The process of obtaining the color buffer and identity map includes: rendering each of the display controls individually to a temporary buffer with an opacity channel in a stacking order; writing the component identifier of the display control into the identity map for pixels in the temporary buffer whose opacity is higher than a preset opacity threshold; overwriting the previously rendered display controls with the later rendered display controls; and recording the pixel count when each display control is rendered individually. The display metrics include at least one of the following: visible ratio, which is the ratio of the number of pixels in the identity image that record the component identifier of the display control to the pixel count when the display control is rendered alone; off-screen ratio, which is the ratio of the number of pixels in the identity image that record the component identifier of the display control and are located outside the pre-generated screen shape mask to the pixel count when the display control is rendered alone; overlapping pixel count, which is the number of pixels in the intersection of the pixels covered by the two display controls when they are rendered alone; and text overflow flag, indicating that the text content size of the display control exceeds the content area of ​​the display control. The step of determining a display control with display anomalies based on the display metric includes: determining a display control with display anomalies that meets at least one of the following conditions corresponding to the items included in the display metric: the visible ratio is lower than the minimum visible ratio; the out-of-screen ratio exceeds a preset out-of-screen threshold; the number of overlapping pixels exceeds a preset overlap threshold; and the text overflow flag is valid.

[0009] In a preferred embodiment, the correction boundary further includes priority, allowable translation amount, minimum font size, and alternative anchor points, and the correction action includes at least one of translation, switching anchor points, switching compact display format, reducing font size, and hiding; The step of adjusting the control properties of the display control with display abnormalities within the correction boundary includes: When the display anomaly is an overlap between two display controls, the display control with the lower priority among the two display controls is selected as the adjustment target; otherwise, the display control with the display anomaly is selected as the adjustment target. The adjustment object is subjected to the following corrective actions in sequence, within the allowable correction boundary, until the display anomaly is eliminated: translating the adjustment object radially towards the center of the screen or tangentially along the edge of the screen within the allowable translation amount; switching to the alternative anchor point; switching to a compact display format; reducing the font size to not be lower than the minimum font size; and hiding the adjustment object. After each correction action is performed, only the affected display controls and the areas intersecting with the affected display controls are re-rendered, and the display metric is recalculated. The number of iterations does not exceed a preset number of iterations. The highest priority display control is not hidden. If the highest priority display control is still obscured or clipped after the preset number of iterations, the control properties before adjustment are restored, or the safe layout declared in the dial configuration file is adopted. The step of recreating the display control with display anomalies according to the adjusted control properties includes: writing the adjusted control properties into the runtime property table without modifying the dial configuration file, and creating a new control tree according to the runtime property table; The rendering display includes each of the display controls, including the recreated display controls, which includes replacing the old display control tree with the new control tree once at the frame boundary of the screen refresh; The method further includes: caching the runtime attribute table using the hash value of the dial configuration file, the current language, screen parameters, and font hash value as keys; re-executing the steps from generating the pre-dash dataset to adjusting the control attributes when installing a dial, switching dials, changing the language, or changing the font; otherwise, directly creating a control tree based on the cached runtime attribute table.

[0010] In a preferred embodiment, the method further includes: A rendering report is generated, which records the device pixel coordinates before and after correction, the display metric, the display anomaly type, the pre-rendering data value that triggered the display anomaly, the correction actions performed, and the display anomalies that could not be eliminated for each display control, using the component identifier as the key. The rendering report is sent to the interface design tool through the communication link between the electronic device and the interface design tool. The rendering report is used by the interface design tool to convert the device pixel coordinates in the report into the canvas coordinates of the dial design draft, and to mark the corresponding components of the dial design draft according to the component identifiers.

[0011] In a preferred embodiment, the component is described as a semantic node, which includes a semantic identifier, a priority, and at least one candidate implementation arranged in descending order of quality score. The semantic identifier serves as a data type field of the semantic node. Each candidate implementation includes a set of component type fields, attribute parameters, and cost metadata, including estimated memory usage, estimated rendering time, quality score, and power consumption level. Some of the semantic nodes are marked as mandatory nodes, and the semantic nodes marked as mandatory nodes also include a minimum acceptable level, which is the upper limit of the sequence number of the candidate implementations allowed to be selected by the mandatory node in the descending order of quality score. The method further includes: When the semantic node includes only one candidate implementation, at least one candidate implementation with decreasing quality score is derived from the electronic device according to the preset derivation ladder corresponding to the component type field of the candidate implementation and added to the semantic node. The preset derivation ladder includes at least one of the following: replacing the animated image with the first static frame of the animated image, and then replacing it with a hidden image; disabling anti-aliasing of the arc control and reducing the line width; decoding the image at half resolution; reducing the font size of the text by one level; replacing the shadow or gradient with a solid color. Before creating the display control, the capability vector of the electronic device is acquired, and the capability vector includes at least available memory, processor frequency, and current power consumption mode; Based on the capability vector, the memory budget, frame budget, and power consumption allowance level are determined. With the goal of maximizing the sum of the quality scores of the selected candidate implementations for each semantic node, and under the constraints that the sum of the expected memory usage of the selected candidate implementations does not exceed the memory budget, the sum of the expected rendering time does not exceed the frame budget, the power consumption level does not exceed the power consumption allowance level, and the number of the candidate implementation selected by the forced node in the descending order of quality scores does not exceed the lowest acceptable level of the forced node, a candidate implementation is selected for each semantic node to obtain a mapping plan. The creation of the display control based on the determined control implementation class and the setting of the value of the attribute parameter to the value of the corresponding control attribute of the display control are performed according to the component type field and attribute parameter included in the candidate implementation of the semantic node selected in the mapping plan; During the rendering and display process, the peak memory usage, drawing time, and frame time of each display control are measured. When the measured values ​​exceed the memory budget or the frame budget, in order of priority from low to high and contribution to the excess from large to small, only some of the semantic nodes are switched to the candidate implementation with the second lowest quality score, and only the display controls corresponding to the switched semantic nodes are recreated.

[0012] In a preferred embodiment, each data type in the mapping rule is also associated with an update rhythm, which is static, event-triggered, or periodic; the method further includes: The update rhythm of each display control is marked according to the update rhythm associated with the data type of the data source to which each display control is bound; Collect consecutive display controls with static update rhythms as static segments in stacking order. When two display controls with static update rhythms are separated by display controls with non-static update rhythms in stacking order and the bounding rectangle of the non-static display controls intersects with the two display controls, the two display controls are not merged into the same static segment. For each static segment, when the memory required to pre-render the static segment as a bitmap is less than the sum of the memory released after each display control in the static segment is replaced and the discounted value of the redraw overhead of the static segment per frame, the static segment is rendered as a bitmap consistent with the screen pixel format, and each display control in the static segment is replaced with a single image control that displays the bitmap; the obtained mapping plan includes: pre-determining the static segment according to the update rhythm associated with the data type field of each semantic node, and solving the memory budget constraint by incorporating the estimated value of the memory required to pre-render the static segment as a bitmap and the estimated value of the memory released after replacement; Display controls with non-static update rhythms are grouped and mounted to their respective parent containers according to their update rhythms, and a timer is set for each parent container to trigger a refresh according to the corresponding update rhythm.

[0013] In a preferred embodiment, the method further includes: The ratio of the measured peak memory usage to the sum of the expected memory usage of each selected candidate implementation is used as the memory correction coefficient. The ratio of the measured drawing time of each display control to the expected drawing time of the selected candidate implementation corresponding to that display control is used as the drawing time correction coefficient. The cost metadata is written back to correct the expected memory usage and the expected drawing time when the mapping plan is obtained next time. After switching some of the semantic nodes to candidate implementations with lower quality scores, the measured values ​​are compared with the memory budget and the frame budget again at least one frame interval; only when the margin of the measured values ​​relative to the memory budget and the frame budget is higher than a preset margin threshold within a consecutive preset number of frames, the switched semantic nodes are restored to candidate implementations with higher quality scores. The mapping plan is cached using the device model, firmware version, hash value of the dial configuration file, and current power mode as keys. When the dial configuration file is reloaded, if a mapping plan corresponding to the current key exists in the cache, the step of obtaining the mapping plan is skipped, and the display control is created directly according to the cached mapping plan. When the current power mode is switched, the mapping plan is switched to the key cached for the switched power mode, and the display control corresponding to the selected candidate implementation of the changed semantic node is recreated according to the switched mapping plan.

[0014] According to another aspect of this disclosure, an electronic device is provided, including a screen, a processor, and a memory, the memory storing a computer program that, when executed by the processor, implements the dial display method as described above.

[0015] In the embodiments of this disclosure, a dial configuration file, including component descriptions corresponding one-to-one with each component, is obtained from the dial design draft exported by the interface design tool. Based on the mapping rules pre-stored in the electronic device, a display control is created for each component description, its properties are set, its data source is bound, and its resource file is loaded. Then, each display control is rendered and displayed. This allows each component in the design draft to be directly mapped to a display control on the electronic device. The dial design draft does not need to be converted to code or compiled before it can be displayed on the electronic device. This eliminates misunderstandings arising from code implementation of design intent and inconsistencies between the display effect and design intent caused by code modifications. Designers can directly view the display effect after modifying the design draft, while developers only need to maintain the mapping rules without writing separate code for each design, shortening the development and iteration cycle of the dial. Simultaneously, the data source and resource file are automatically matched to the display control according to data type, improving resource reuse and reducing collaboration barriers between design and development.

[0016] Furthermore, by including relative coordinates relative to the screen size in the attribute parameters, and converting the relative coordinates to pixel coordinates according to the screen resolution of the electronic device, the position attribute of the display control can be set. This allows the same dial configuration file to adapt to electronic devices with different screen sizes and resolutions, eliminating the need to write adaptation code separately for each device or manually adjust the layout, thus reducing the cost of multi-device adaptation.

[0017] Furthermore, by including component identifiers and correction boundaries in the component descriptions and associating data files with data types, a pre-rendering dataset is generated based on the data files and injected into each display control before rendering. The color buffer and the identity map of the display control to which each pixel belongs are obtained by rendering in the off-screen buffer. Based on this, display metrics are calculated and display controls with display anomalies are identified. Their control properties are adjusted within the correction boundaries and they are recreated before rendering. This allows for the detection of pixel-level occlusion, clipping, and overflow issues that only occur under specific data values ​​or specific languages, and which are configured correctly but display incorrectly, before the dial is displayed. Abnormal pixels are accurately attributed to specific display controls, and display anomalies are automatically eliminated within the scope of not violating the design intent, so that users will not see dials with display anomalies.

[0018] Furthermore, by using a pre-rendering dataset that includes worst-case combination data and extreme value data for each control, each control is rendered sequentially to a temporary buffer with an opacity channel and written to an identity map according to an opacity threshold. Pixel counts during individual rendering are recorded, and display anomalies are determined by visible ratio, off-screen ratio, number of overlapping pixels, and text overflow flags. This approach can detect both the overlap between display controls and the location of the responsible control, accurately detect the actual occlusion relationship of transparent images, the clipping of non-rectangular screen edges such as circles, and text overflow, avoiding missed and false detections caused by comparing only the bounding rectangles of controls.

[0019] Furthermore, by setting priorities, allowed translation amounts, minimum font sizes, and alternative anchor points in the correction boundary, lower-priority display controls are selected as adjustment targets when overlapping occurs. Correction actions are attempted sequentially in the order of translation, switching anchor points, switching to compact display format, reducing font size, and hiding. Only the affected area is re-rendered each time, and the number of iterations is limited. The highest-priority display controls are not hidden, and their original attributes are restored or a safe layout is adopted when the anomaly cannot be eliminated. The adjusted attributes are written to the runtime attribute table, and the control tree is replaced once at the frame boundary. The runtime attribute table is cached according to the configuration file hash value, language, screen parameters, and font hash value. This ensures that the display of important display controls is prioritized with minimal adjustment cost, that critical information such as time and alarms is not hidden or clipped, reduces the computational overhead of the correction process, prevents users from seeing the intermediate state of correction, does not modify the original dial configuration file, and avoids repeated rehearsals when the configuration, language, screen, and font have not changed.

[0020] Furthermore, by generating a rendering report that records device pixel coordinates, display metrics, display anomaly types, pre-rendered data values ​​that triggered the anomaly, executed corrective actions, and anomalies that could not be eliminated, using component identifiers as keys, and sending this report to the interface design tool via a communication link to convert it into canvas coordinates and mark it on the corresponding component in the design draft, designers can directly see the actual display of each component on the real device and the automatic corrections performed by the electronic device within the design tool, without relying on a design-end simulator that differs from the real device, thus achieving closed-loop verification between design and display.

[0021] Furthermore, by representing component descriptions as semantic nodes that include priority and candidate implementations arranged in descending order of quality score, each candidate implementation carries cost metadata. When there is only one candidate implementation, the electronic device automatically derives a lower-end candidate implementation according to a preset derivation ladder. The capability vector of the electronic device is collected, and the memory budget, frame budget, and power consumption allowance level are determined. Under budget constraints and forced node constraints, the candidate implementation for each semantic node is selected with the goal of maximizing the sum of quality scores to obtain a mapping plan and create display controls accordingly. When the budget is exceeded during operation, only some semantic nodes are switched to the candidate implementation with the second lowest quality score, and only the corresponding display controls are recreated. This allows the same dial configuration file to select the implementation method element by element according to the capabilities of each electronic device, avoiding insufficient memory, lag, or loading failures on low-end devices, and avoiding unnecessary sacrifice of all elements when switching to a low-quality version. Designers do not need to provide multiple versions for each device, and can correct budget overruns with minimal local degradation during operation.

[0022] Furthermore, by associating update rhythms with data types, collecting consecutive static display controls as static segments in cascading order and not merging them when separated by intersecting non-static display controls, pre-rendering static segments as bitmaps and replacing them with individual image controls only when the memory required for pre-rendering bitmaps is less than the sum of the freed memory and the cost of redrawing per frame, and incorporating the relevant memory into the mapping plan solution, and by grouping non-static display controls according to update rhythms and mounting them to the parent container and setting corresponding timers, the data type information in the design intent can be used to automatically identify display content that never changes, reduce the number of control objects and the redraw area per frame, avoid repeated redrawing of static content, pre-render only when there is a definite benefit, and make display controls with different update frequencies refresh according to their respective rhythms, reducing processor usage and power consumption.

[0023] Furthermore, by writing the ratio of the measured value to the predicted value back to the cost metadata as a correction coefficient, re-evaluating after switching candidate implementations at least one frame interval, and restoring the high-end candidate implementation only when the margin is higher than the threshold within a consecutive preset number of frames, and caching the mapping plan according to device model, firmware version, configuration file hash value and power mode, and switching to the corresponding mapping plan when the power mode changes, and only recreating the changed display controls, the subsequent mapping plan prediction can be more accurate, avoiding display jitter caused by frequent ups and downs, so that the mapping plan does not need to be resolved when the dial is reloaded, and the display scheme can be quickly switched when the power mode changes.

[0024] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Various aspects and embodiments of this disclosure can be combined in different ways. This part of the disclosure is not intended to identify key or essential features of the claimed subject matter, nor is it intended to aid in determining the scope of the claimed subject matter. Attached Figure Description

[0025] Figure 1 This is a schematic flowchart of a dial display method according to an embodiment of the present disclosure; Figure 2 This is a schematic diagram of a process for correcting display anomalies based on identity graph pre-visualization according to an embodiment of the present disclosure; Figure 3 This is a schematic flowchart illustrating the generation of a device-specific mapping scheme according to an embodiment of the present disclosure. Detailed Implementation

[0026] To make the objectives, technical solutions, and advantages of this disclosure clearer, the disclosure will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0027] Example 1 This embodiment provides a dial display method applied to electronic devices. The electronic device can be a smartwatch, smart bracelet, or other wearable device equipped with a display screen; this embodiment uses a smartwatch as an example. The mapping model based on this method can be understood as having four layers: intent layer, description layer, semantic parsing layer, and instance layer. In the intent layer, the interface designer selects component types, sets attribute parameters, and specifies data types. These design intents are recorded in the dial configuration file of the description layer in the form of component descriptions. The mapping rules in the electronic device parse the component descriptions in the semantic parsing layer and create corresponding display controls, set corresponding control properties, and bind corresponding data in the instance layer. The overall flow of this method is as follows: Figure 1As shown, the process mainly includes five steps: obtaining the dial configuration file, creating display controls according to type correspondence, setting control properties according to attribute correspondence, binding the data source and resource file according to data correspondence, and rendering and displaying. Each step is explained in detail below.

[0028] Step 101: Obtain the watch face configuration file. The watch face configuration file is a file exported by the interface design tool from the watch face design draft. The interface design tool can be any vector interface design software that can organize interface elements in layers or nodes. The interface designer draws the watch face design draft in this software. The watch face design draft consists of several components, such as time text displaying hours and minutes, numerical text displaying steps, an arc displaying heart rate, a background image, a progress bar representing battery level, and various decorative icons. The interface design tool has an export plugin installed. This plugin iterates through each component in the watch face design draft, generates a component description for each component, and writes it to the watch face configuration file, ensuring a one-to-one correspondence between the component descriptions in the watch face configuration file and the components in the watch face design draft. Each component description includes at least three categories of content. The first category is the component type field, indicating what type of component the component belongs to, such as text, image, arc, progress bar, pointer, or container. In the configuration file, this can be represented as the `comp_type` field. The second category is attribute parameters, describing the component's appearance and position, such as horizontal and vertical coordinates, width, height, color, font size, alignment, and transparency. In the configuration file, these can be represented as fields like `x`, `y`, `w`, `h`, `color`, and `font_size`. The third category is data type fields, indicating what data the component will display. For example, `calorie_intake` represents calorie intake, `step_count` represents steps, `heart_rate` represents heart rate, `hour` and `minute` represent time, and `battery` represents battery power. In the configuration file, this can be represented as the `type` field. The watch face configuration file can use a structured text format, such as JSON or XML. This example uses JSON format. A component description for step count text can be written in the following format: "comp_type" is "text", "x" is 120, "y" is 200, "font_size" is 28, "color" is "#FFFFFF", and "type" is "step_count". The watch face configuration file, along with resource files such as images and fonts referenced by the watch face, is packaged into a watch face installation package. This package is transferred to the electronic device via Bluetooth through the companion app on the mobile phone, or directly written to the electronic device's memory via USB. When the electronic device installs or switches watch faces, it reads the watch face configuration file from its memory, thus completing the acquisition of the watch face configuration file. As you can see, the watch face configuration file is directly exported from the interface design tool, without any intermediate code writing or compilation.

[0029] Step 102: Parse the dial configuration file. Based on the mapping rules pre-stored in the electronic device, determine the control implementation class corresponding to the component type field of each component description, and create the display control based on the determined control implementation class. The firmware of the electronic device has a built-in configuration parser and mapping rules. The configuration parser reads the component descriptions line by line according to the format of the dial configuration file. The mapping rules are pre-stored in the firmware in the form of three correspondence tables: a type correspondence table, an attribute correspondence table, and a data correspondence table. This step uses the type correspondence table. Each entry in the type correspondence table records the correspondence between a component type and a control implementation class. The control implementation class is an object type in the embedded graphics library used by the electronic device that can be instantiated and drawn on the screen, such as label objects, image objects, arc objects, progress bar objects, line objects, and container objects in a lightweight embedded graphics library. For example, the component type "text" corresponds to the implementation class of a label object, "image" corresponds to the implementation class of an image object, "arc" corresponds to the implementation class of an arc object, "bar" corresponds to the implementation class of a progress bar object, and "hand" corresponds to the implementation class of an image object used to draw a pointer, with rotation capability. After the configuration parser reads the component type field from the component description, it looks up the corresponding control implementation class in the type mapping table. Then, it calls the creation interface of that control implementation class to create an instance of the display control under the root container of the dial. Each component description creates one display control, and the displays are created in the order in which the component descriptions appear in the dial configuration file, ensuring their stacking order matches the layer order in the dial design. If the component type field of a component description has no entry in the type mapping table, the configuration parser skips that component description and records an alert to ensure that the remaining components can still be displayed correctly.

[0030] Step 103: Based on the correspondence between attribute parameters and control attributes in the mapping rules, set the values ​​of the attribute parameters in the component description to the corresponding control attributes of the display control. Each entry in the attribute mapping table records the correspondence between an attribute parameter and a control attribute. Control attributes are settable items exposed by the control implementation class, such as position, size, text color, background color, font, alignment, transparency, arc start and end angles, and line width. For example, attribute parameters x and y correspond to the position attribute of the display control, w and h correspond to the size attribute, color corresponds to the text color or foreground color attribute, font_size corresponds to the font attribute, align corresponds to the alignment attribute, and start_angle and end_angle correspond to the arc start and end angle attributes. The configuration parser reads the attribute parameters in the component description one by one, looks up the corresponding control attribute in the attribute mapping table for each attribute parameter, and calls the setting interface of that control attribute to write the value of the attribute parameter into the display control created in step 102. For attribute parameters not given in the component description, the display control retains the default value of the control implementation class. After this step, the appearance and position of the display control have been completed according to the settings made by the interface designer in the dial design draft.

[0031] Step 104: Based on the correspondence between data types, data sources, and resource files in the mapping rules, determine the data source corresponding to the data type field described in the component description, bind the determined data source to the display control, and load the resource file corresponding to the data type field in the mapping rules to the display control. Each entry in the data mapping table records the correspondence between a data type, a data source, and zero or more resource files. A data source is a software interface or service in an electronic device that can provide data of that data type. For example, data types hour and minute correspond to the system clock service, step_count corresponds to the step counting service, heart_rate corresponds to the heart rate sensor service, calorie_intake corresponds to the calorie item in the health data interface, battery corresponds to the battery level item in the power management service, and weather corresponds to the weather data cache obtained through mobile phone synchronization. Resource files are the images, icons, fonts, or animation files needed to display the data type. For example, the data type heart_rate corresponds to a heart-shaped icon file, battery corresponds to a battery icon file, and numeric text corresponds to a set of numeric font files. After the parser reads the data type field from the component description, it looks up the corresponding data source and resource file in the data mapping table. On one hand, it registers the display control as a subscriber to the data source, essentially registering an update callback targeting the display control with the data source. This allows the data source to call the callback and write the new data to the display control when the data changes. On the other hand, according to the resource file path recorded in the data mapping table, it searches for and loads the corresponding resource file in the resource directory of the watch face installation package or the firmware's public resource library, and sets it to the display control. For example, it loads the heart icon as the image source for the image control next to the heart rate arc, or loads the numeric font as the font for the step count text. Because the resource file is automatically matched by data type, the interface designer does not need to specify the resource path one by one in the component description, and the same resource file can be shared by multiple components with the same data type.

[0032] Step 105: Render and display the created display controls on the screen of the electronic device. Each display control displays data provided by its bound data source. After all component descriptions in the dial configuration file have completed the above processing, the display controls under the dial root container form a complete control tree. The configuration resolver loads the dial root container as the currently active screen, and the embedded graphics library's refresh task draws each display control to the display buffer and outputs it to the screen in cascading order. During the display process, each data source writes new data to the corresponding display control through the update callback registered in step 104 when its data changes. For example, the system clock service writes new hour and minute values ​​to the time text every minute, and the step count service writes new step counts to the step count text when the step count changes. After the data is written, the display control is marked as needing to be redrawn, and the refresh task only redraws the area covered by the marked display control.

[0033] Steps 101 to 105 above constitute a complete technical solution. Those skilled in the art can directly restore the dial configuration file exported from the interface design tool to the dial display on the electronic device screen by following these steps. Its working principle lies in the fact that the mapping rules establish a triple one-to-one correspondence between the configuration file and the display controls. The correspondence between the component type field and the control implementation class determines what the control is; the correspondence between the attribute parameters and the control attributes determines what the control looks like; and the correspondence between the data type field and the data source and resource file determines what the control displays. With these three elements combined, the interface designer's design intent does not need to be translated into code by the developer and can be automatically parsed and instantiated by the electronic device. Thus, the compilation gap between dial design and device display is eliminated. Designers can modify the dial design draft and re-export the dial configuration file to view the actual effect on the electronic device. Developers only need to maintain the mapping rules and do not need to write code for each dial, significantly shortening the iteration cycle of design changes. According to the applicant's statistics in a practical application scenario, the dial development cycle can be shortened by more than 80% using the method of this embodiment, and the automatic matching of data types to resource files also significantly improves resource reuse. Several optional improvements to this embodiment are described below.

[0034] In some optional implementations, the attribute parameters in the component description can use relative coordinates of the component with respect to the screen size, instead of absolute pixel coordinates. Specifically, during export, the export plugin divides the component's position on the dial design canvas by the canvas's width and height to obtain relative horizontal and vertical coordinates between 0 and 1. The component's width and height can also be converted to relative width and height according to the canvas size. When setting control properties in step 103, the configuration parser first reads the electronic device's screen resolution from the display driver, then multiplies the relative coordinates by the screen's pixel width and pixel height to convert them into pixel coordinates, and sets the pixel coordinates as the values ​​of the display control's position attribute. The relative width and relative height are also converted to pixel dimensions in the same way. Let the relative horizontal coordinate be... The relative vertical axis is The screen's pixel width is The pixel height is The converted pixel x-coordinate with pixel ordinate They are respectively and ,in and It is a dimensionless number. , , and All units are pixels, and the conversion results are rounded down. Using relative coordinates, the same watch face configuration file can be used on various electronic devices with different screen sizes and resolutions. The control positions are automatically calculated by the electronic device based on its own screen, eliminating the need to adjust the layout individually for each device. It should be noted that relative coordinates are not a necessary condition for implementing this method. When relative coordinates are not used, the absolute pixel coordinates for the target device can be directly provided in the component description, and separate watch face configuration files can be exported for devices with different resolutions; this method will still work correctly.

[0035] Example 2 This embodiment, based on Embodiment 1, adds a mechanism for pre-visualizing, assigning responsibility, and correcting errors locally on the electronic device before the watch face is displayed, and then feeding the results back to the interface design tool. The fact that the watch face configuration file in Embodiment 1 is syntactically valid does not necessarily mean that the display effect matches the design intent. Figure 1For example, when a font falls back to an alternative font on an electronic device, the baseline shifts; the edge of a circular screen crops a portion of the control; the actual occlusion relationship between an image with a transparent area and other controls differs from that represented by the bounding rectangle; the glyphs of long text overflow their bounding rectangle; and the visible portion of a control is insufficient when it is occluded by an upper-level control. These problems often only occur under specific data values ​​or specific languages. Sample data used in the design phase is difficult to expose, and the simulator on the design side differs from the firmware, font engine, and screen shape of the actual device. The process of this embodiment is as follows: Figure 2 As shown, after step 104 in Embodiment 1, the pre-rendering and correction process of steps 201 to 204 is performed. Step 205 replaces step 105 in Embodiment 1 for rendering and display. After step 205, step 206 is performed. The following is a step-by-step description.

[0036] To support previewing and correction, this embodiment extends the dial configuration file and mapping rules in two ways. First, each component description includes a component identifier and correction boundaries. The component identifier is a stable identifier generated by the export plugin for each component. It can be the hash value of the identifier of the corresponding node in the interface design tool, and the same component remains unchanged across multiple exports. The correction boundaries declare which correction actions the interface designer allows the electronic device to perform on the display control corresponding to the component, and the allowed range of each correction action. The correction boundaries can be recorded as the tolerance field in the component description, and its content includes a list of allowed correction actions, allowed translation amount, minimum font size, minimum visibility ratio, priority, and a list of alternative anchor points. The allowed translation amount can be represented in pixels or as a ratio relative to the screen size; the priority can be an integer from 1 to 5, with smaller values ​​indicating higher priority and greater importance of the component. In this disclosure, "lower priority" or "higher priority" refers to low or high importance; the list of alternative anchor points provides the anchor point positions that can be used when the default anchor point is not feasible. The export plugin provides default values ​​for boundary correction based on the layer type to which the component belongs. For example, decorative components are allowed to be hidden by default, while time components are not allowed to be panned beyond 2% of the screen size and are not allowed to be hidden by default. Interface designers can modify these default values ​​in the interface design tool. Secondly, each data type in the mapping rules is also associated with a data file. The data file records the upper and lower bounds of the data type's value, the maximum number of digits, the format template, and the longest string in each language. For example, the upper bound of the step count is five digits, and the longest string of the week name in each supported language is obtained from the firmware's multi-language resources. In step 102, when creating a display control based on the control implementation class, the component identifier is also stored in the created display control, for example, written to the user data field of the graphics library object, so that any subsequent display control can look up its corresponding component description.

[0037] Step 201: Generate a pre-simulation dataset based on the data files associated with the data sources bound to each display control. The pre-simulation dataset is a set of data values ​​injected into the display controls to cover extreme scenarios that may occur during actual use. In this embodiment, the pre-simulation dataset consists of two parts. The first part is worst-case combination data, which involves simultaneously injecting the longest content from each data file into all display controls bound to data sources. For example, the step count is taken as a five-digit upper limit, the day of the week is taken as the longest string in each language, and the temperature is taken as a three-digit number with a negative sign. This is used to detect overlap when multiple controls expand simultaneously. The second part is control-by-control extreme value data, where only one display control is injected with its extreme value from its data file at a time, while the other display controls retain sample values. This is used to pinpoint the anomaly to the specific responsible control. The format templates in the data files are used to render the values ​​as final text, such as formatting the step count by thousands place.

[0038] Step 202: Inject the data from the pre-render dataset into each display control, and render each display control in the off-screen buffer to obtain a color buffer and an identity map. The pre-render is performed on a hidden off-screen object; that is, the configuration resolver creates a control tree in an off-screen container that is not mounted to the active screen, so the user cannot see any intermediate states during the pre-render. Considering the limited memory of the microcontroller, rendering is done in stripes, for example, rendering 32 rows of pixels at a time, accumulating strip by strip to obtain the complete result. Rendering simultaneously produces two images: one is the color buffer, whose content is the same as the screenshot during normal display; the other is the identity map, where each pixel records not the color, but the component identifier of the display control to which that pixel belongs. The identity map is generated by rendering each display control individually to a temporary buffer with an alpha channel in a stacking order. Graphics libraries typically provide snapshot interfaces for individual objects to complete this rendering. Pixels in the temporary buffer with opacity higher than a preset opacity threshold are written to the identity map with the component identifier of that display control. The opacity threshold can be 32 when the full scale is 255, meaning pixels with opacity lower than this value are considered transparent and not recorded. Because the data is written sequentially in a stacking order, later rendered display controls overwrite earlier rendered ones. Ultimately, each pixel in the identity map records the component identifier of the topmost visible control. It also records the count of pixels with opacity higher than the threshold when each display control is rendered individually. To save memory, each pixel in the identity map can store only the component identifier's sequence number within the current dial, rather than the component identifier itself. One byte is sufficient to represent 255 display controls; when the number of display controls exceeds 255, it becomes two bytes. The shape of the screen and the fixed areas that are obscured on the electronic device are pre-generated as a screen shape mask. For circular or rounded rectangular screens, the mask marks pixels outside the screen as invisible.

[0039] Step 203: Calculate the display metric for each display control based on the identity graph, and identify display controls with display anomalies based on the display metric. Calculate the following display metrics for each display control: Visibility Ratio according to Calculation, where The identity graph records the number of pixels representing the component identifier of the display control. This refers to the pixel count when the display control is rendered individually; both are dimensionless pixel counts. The value ranges from 0 to 1. A visible ratio lower than the minimum visible ratio within the correction boundary indicates that the display control is obscured by the upper-layer control. Out-of-screen ratio. according to Calculation, where This refers to the number of pixels in the identity image that record the component identifier of the display control and are located outside the screen shape mask. If the out-of-screen ratio exceeds a preset out-of-screen threshold, it means the display control is clipped by the screen edge. The out-of-screen threshold can be 0, meaning that any pixel falling outside the screen is considered clipped, or it can be relaxed according to design needs. (Number of overlapping pixels) The number of overlapping pixels is the intersection of the pixels covered by two display controls when rendered individually. This is obtained by taking the intersection of the pixel masks of the two display controls when rendered individually and counting the pixels. If the number of overlapping pixels exceeds a preset overlap threshold, it indicates that the two controls are overlapping. The text overflow flag is obtained by comparing the size of the text content calculated according to the current font with the content area of ​​the display control. The flag is valid when the text size exceeds the content area. In addition, it can also record the deviation in position and size between the actual bounding rectangle of the display control and the design frame in the dial design draft, as well as whether the font has fallen back. The configuration parser identifies display controls with display anomalies if the visible ratio is lower than the minimum visible ratio, the out-of-screen ratio exceeds the out-of-screen threshold, the number of overlapping pixels exceeds the overlap threshold, or the text overflow flag is valid, and records the pre-rendering data value that triggers the anomaly. Since the identity map records ownership in pixels, occlusion and clipping can be accurate to the pixel level, rather than just being roughly judged by the bounding rectangle.

[0040] Step 204: Adjust the control properties of the display control with the display anomaly within the correction boundary, and recreate the display control according to the adjusted control properties. When the display anomaly is an overlap between two display controls, select the display control with lower priority as the adjustment object; for other types of display anomalies, the display control with the display anomaly itself is used as the adjustment object. Try the correction actions allowed by the correction boundary on the adjustment object in sequence. In this embodiment, the following order is used until the display anomaly is eliminated. First, try translation. Within the allowed translation amount, translate in the radial direction from the anchor point of the adjustment object towards the center of the screen. For circular screens, this direction can quickly get away from the edge clipping, or translate in the tangential direction of the screen edge to avoid adjacent controls; if translation cannot eliminate the anomaly, switch to the anchor point in the alternative anchor point list; if it still cannot eliminate the anomaly, switch to a compact display format, for example, display the step number 12345 as 12.3k, or use the abbreviation agreed in the data file; if it still cannot eliminate the anomaly, reduce the font size, but not below the minimum font size; finally, hide the adjustment object, and only decorative controls that are allowed to be hidden by the correction boundary will be hidden. After each correction action, only the affected display controls and their intersecting areas are re-rendered, and the display metrics for these areas are recalculated; the entire dial does not need to be re-rendered. The number of iterations does not exceed a preset number of iterations, which can be 5. As a hard constraint, the highest priority display controls, such as time and alarm controls, are not hidden. If, after the preset number of iterations, the highest priority display controls still exhibit display anomalies such as being obscured or clipped, the correction is abandoned, and the control properties before adjustment are restored, or a safe layout declared in the dial configuration file is adopted. The safe layout is a simplified layout prepared by the interface designer for extreme cases. The adjusted control properties are written to the runtime property table without modifying the dial configuration file. The runtime property table records the corrected position, anchor point, format, font size, and visibility of each display control using the component identifier as the key. The configuration parser creates a new control tree based on the runtime property table, that is, it overwrites the property parameters of the component description with the values ​​in the runtime property table before executing steps 102 to 104 of Example 1.

[0041] Step 205: Render and display the recreated display controls on the screen. To avoid users seeing intermediate states during the correction process, the new control tree replaces the old control tree at the frame boundary of the screen refresh. That is, after the refresh task completes drawing one frame and before the next frame begins, the active screen is switched from the old control tree to the new control tree, and the old control tree is released. The switch is completed within a single refresh cycle. For newly installed watch faces, there is no old control tree; in this case, the new control tree is directly loaded as the active screen. To avoid repeating the pre-rendering every time the screen is turned on, a key cache composed of the hash value of the watch face configuration file, the current language, screen parameters, and font hash value is used as the runtime attribute table for the pre-rendering result. Steps 201 to 204 are only re-executed when installing a watch face, switching watch faces, changing the language, or changing the font. In other cases, the control tree is directly created based on the cached runtime attribute table.

[0042] Step 206: Generate a rendering report and send it to the interface design tool. The rendering report records the device pixel coordinates, display metrics, display anomaly type, pre-rendered data value that triggered the display anomaly, executed correction actions, and display anomalies that could not be eliminated for each display control before and after correction, using the component identifier as the key. Optionally, it also includes the color buffer obtained in step 202 as a screenshot of the actual device. The electronic device sends the rendering report to the interface design tool through a communication link. The communication link can be a Bluetooth Low Energy Universal Attribute Protocol channel relayed by the mobile phone, or a USB serial channel. After receiving the rendering report, the plugin in the interface design tool uses the inverse operation of relative coordinate conversion in Example 1 to convert the device pixel coordinates in the report back to the canvas coordinates of the dial design draft. It finds the corresponding component in the dial design draft according to the component identifier, draws the actual device frame, the position comparison before and after correction, and red markings of items that could not be corrected on it. The interface designer can then see in the interface design tool which component the problem occurred in, under what data, and what modifications the electronic device made to it. The designer can also choose to write the corrections taken by the electronic device back to the dial design draft with one click.

[0043] The working principle of this embodiment is as follows: the data archive-driven pre-drill dataset allows the pre-drill to cover possible future data values ​​and languages; the identity graph accurately assigns pixel-level display errors to specific components in the dial configuration file; correction boundaries ensure that automatic correction does not exceed the scope defined by the interface designer; frame boundary switching ensures that the user cannot see intermediate states; and the rendering report with component identifiers as keys allows the interface designer to complete verification within the interface design tool without a real device. It should be noted that the identity graph in this embodiment is used for responsibility attribution and limitation correction during the pre-display pre-drill; the annotation targets are design nodes in the interface design tool, and each node is compared and annotated. This differs from the purpose of interactive picking or showing a view tree to developers.

[0044] In some alternative implementations, the pre-simulation dataset in step 201 can also use only worst-case combination data or only control-by-control extreme value data. The former saves pre-simulation time, while the latter provides more accurate positioning. Those skilled in the art can choose according to the processing capabilities of the electronic device. When detection is performed using only the bounding rectangle of the display control without using an identity map, some obvious overlap and off-screen issues can be found, but the actual occlusion relationship and pixel-level clipping caused by transparent areas cannot be identified.

[0045] As a preferred but not mandatory improvement, the corrective actions attempted sequentially in step 204 can be tailored according to the component type. For example, no font size reduction action can be set for image controls, and only anchor point switching is allowed for pointer controls. Corrective actions not listed in the correction boundaries are skipped in this order. When not attempting sequentially, a single translation can be performed within the allowed translation range. If the anomaly cannot be eliminated, a fallback to a safe layout is implemented. This method is simpler to implement, but the success rate of correction is lower.

[0046] Optionally, upon initial startup or after font and display driver updates, the electronic device can first perform an off-screen rendering using the firmware's built-in probe configuration. This probe configuration includes standard rectangles, arcs, and multilingual characters. By comparing the rendering results with the expected results, systematic deviation parameters such as font baseline compensation and line height compensation are obtained and saved as a device display profile. The configuration parser applies the device display profile before creating display controls, thereby reducing the number of iterations in step 204. It should be noted that the device display profile is not a necessary condition for implementing this embodiment; steps 201 to 206 can still be executed normally without setting a device display profile.

[0047] Example 3 This embodiment, based on Embodiment 1, adds a mechanism that allows the electronic device to select an implementation method for each component based on its own capabilities and budget, and to generate a device-specific mapping plan. In Embodiment 1, the component descriptions specify in a fixed manner which controls to place and which resources to use. A watch face that runs normally on a smartwatch with strong processing power may experience insufficient memory, lag, or even loading failure on a smart bracelet with limited memory. Switching the entire watch face to a lower-spec version would unnecessarily sacrifice the performance of all components, and interface designers cannot create multiple versions for each device. The process of this embodiment is as follows: Figure 3 As shown, the steps below are explained.

[0048] This embodiment extends the component description of the dial configuration file as follows: the component description is represented as a semantic node, which includes a semantic identifier, priority, and at least one candidate implementation arranged in descending order of quality score. The semantic identifier indicates what the component is meant to express; for example, heart_rate represents heart rate. The semantic identifier also serves as the data type field of the semantic node, used to determine the data source and resource file in step 104. The priority indicates the importance of the component; time and alarm semantic nodes are marked as mandatory nodes and include a minimum acceptable level. Each candidate implementation is a general control description identical to that in Embodiment 1, including a set of component type fields and attribute parameters. For example, the heart rate semantic node can provide four candidate implementations: animated waveform, static curve, number plus icon, and pure number, with quality scores decreasing sequentially. Each candidate implementation also carries cost metadata, including estimated memory usage, estimated drawing time, quality score, and power consumption level. The estimated memory usage is calculated by the export plugin during export. For bitmaps, it is estimated by multiplying the bitmap width by the height and then by the number of bytes per pixel. For fonts, it is estimated by multiplying the required number of glyphs by the average number of bytes per glyph. The estimated rendering time is estimated by multiplying the number of pixels covered by the candidate implementation by an empirical coefficient for that component type. In addition, peak decoding memory can also be recorded. Semantic nodes can be denoted as the `node` field in the configuration file, which contains three subfields: `semantic`, `priority`, and `impls`.

[0049] When a semantic node includes only one candidate implementation, meaning the interface designer provides only one implementation, the electronic device automatically derives at least one candidate implementation with progressively decreasing quality scores based on the preset derivation ladder corresponding to the component type field of that candidate implementation, and adds it to the semantic node. This ensures that each semantic node has multiple implementations to choose from. The preset derivation ladder is predefined in the mapping rules according to component type. For example, animated images are first replaced with the first static frame of the animation, and then hidden; anti-aliasing is turned off and line width is reduced for arc controls; images are decoded at half resolution; the font size of text is reduced by one level; shadows or gradients are replaced with solid colors. The cost metadata of the derived candidate implementations is calculated by the electronic device using the above estimation method.

[0050] Step 301: Before creating the display controls, acquire the capability vector of the electronic device. The capability vector includes at least available memory, processor frequency, and current power consumption mode. It may also include screen shape and color depth, maximum contiguous memory block size, whether external pseudo-static random access memory is present, image decoder type, font engine, and graphics library version. Available memory and maximum contiguous memory block size can be read through the memory monitoring interface provided by the graphics library. The current power consumption mode is provided by the power management service, and its values ​​include normal mode, power saving mode, and always-on mode. The capability vector is acquired once when the electronic device starts up and updated when the power consumption mode changes.

[0051] Step 302: Determine the memory budget, frame budget, and power tolerance level based on the capability vector, and solve for the mapping plan. The memory budget is the available memory minus the reserved safety margin; the frame budget is the single frame time corresponding to the target frame rate under the current power mode; and the power tolerance level is determined by the current power mode. The objective is to maximize the sum of the quality scores of the selected candidate implementations for each semantic node. The constraints are: the sum of the expected memory usage of the selected candidate implementations does not exceed the memory budget; the sum of the expected rendering time does not exceed the frame budget; the power tolerance level of each candidate implementation does not exceed the power tolerance level; and the selected candidate implementations for each node are forced to be no lower than their lowest acceptable level. Let the total number of semantic nodes be... , No. The semantic node of the first The quality of each candidate implementation is divided into The estimated memory usage is The estimated drawing time is Power consumption level is , for the first The sequence number of the candidate implementation selected by the semantic nodes is Memory budget is The frame budget is The power consumption allowable level is Then the problem can be expressed as in , For each All And forced nodes Under the condition that it does not exceed its lowest acceptable grade number, Take the maximum value, where This is the sequence number of the semantic node. This represents the sequence number of the candidate implementation in descending order of quality score. For dimensionless mass fractions, and The unit is bytes. and The unit is milliseconds. and This represents a dimensionless power consumption level. The number of semantic nodes in a single dial is typically within a few dozen. This embodiment uses a greedy approach to solve the problem. First, each semantic node is placed in the candidate implementation with the highest quality score. When any constraint is not satisfied, the ratio of the quality score loss to the resource saving resulting from downgrading each semantic node by one level is calculated. The semantic node with the smallest ratio is selected and downgraded by one level. This process is repeated until all constraints are satisfied. When the number of semantic nodes is small, dynamic programming can also be used to obtain an exact solution. The solution outputs a mapping plan, which records the sequence number of the selected candidate implementation for each semantic node. It can also record the static segment list, layering, and timer configurations described later.

[0052] Step 303: Create display controls according to the mapping plan. The configuration resolver executes step 102 of Example 1 (creating display controls) and step 103 (setting control properties) according to the component type fields and attribute parameters included in the selected candidate implementations of each semantic node in the mapping plan. Then, it executes step 104 (binding data sources and resource files) according to the data type fields of the semantic nodes, followed by step 105 (rendering and displaying). Thus, the same dial configuration file is instantiated on different electronic devices as a collection of controls of the highest possible quality within their respective capabilities, rather than switching entirely to a single version.

[0053] Step 304: During the rendering and display process, the resource consumption is measured and local downgrading is performed. Downgrading refers to switching semantic nodes to candidate implementations with the second-lowest quality score. The electronic device records the peak memory usage and obtains the drawing time of each display control by recording timestamps at the drawing start and end events of the graphics library, and also records the frame time. When the measured value exceeds the memory budget or frame budget, the semantic nodes are sorted in order of priority from low to high and their contribution to the excess from large to small. Only the semantic nodes at the top of the list are switched to candidate implementations with the second-lowest quality score, and only the display controls corresponding to the switched semantic nodes are recreated. The remaining display controls remain unchanged, and there is no need to reload the entire dial.

[0054] The aforementioned extensions and steps 301 to 304 constitute the core process of this embodiment. Its working principle is that each element in the configuration file only declares what it wants to express and includes multiple implementations with decreasing effects but unchanged meaning. The electronic device selects the appropriate version for each element based on its own capability vector, rather than switching versions entirely. The combination of predictions in the planning phase and actual measurements in the operational phase ensures both foresight and corrective action, and downgrading only affects low-priority, high-contribution elements. According to the applicant's statistics in a real-world application scenario, combined with the optional static content bitmap implementation described below, the memory usage of the watch face during operation can be reduced by 30%, and the processor usage by 40%, which helps extend battery life. Several optional improvements to this embodiment are described below.

[0055] In some optional implementations, each data type in the mapping rules is also associated with an update rhythm. The update rhythm indicates how often the data of that data type changes, and its value can be static, event-triggered, or periodically updated. Periodically updated can be further divided into cycles of every second, every minute, and every thirty minutes. For example, background images and decorative icons are static, alarm icons are event-triggered, the second hand is every second, steps are every minute, and weather is every thirty minutes. The configuration parser marks the update rhythm of each display control based on the update rhythm associated with the data type of the data source to which each display control is bound. Then, it collects consecutive display controls with static update rhythms as static segments in cascading order. When two display controls with static update rhythms are separated in cascading order by display controls with non-static update rhythms, and the outer rectangle of the non-static display control intersects with these two display controls, these two display controls are not merged into the same static segment to avoid disrupting the correct cascading relationship after bitmap conversion. For each static segment, determine whether it is worthwhile to pre-render it as a bitmap (hereinafter referred to as bitmap conversion). The rule is that bitmap conversion is only performed when the memory required to pre-render the static segment as a bitmap is less than the sum of the memory released after each display control in the static segment is replaced and the discounted value of the redraw overhead of the static segment per frame; otherwise, it is retained as an object. Let the memory required for bitmap conversion be... The memory freed by the replaced display control is The discounted value of the redraw cost per frame for static segments is The condition for bitmap conversion is: ,in and The unit is bytes. The rendering time is obtained by multiplying the number of pixels covered by the static segment by an empirical coefficient for the component type, and then converted to bytes according to the equivalent number of bytes per millisecond rendering time preset in the firmware. During bitmap rendering, the static segment is rendered into a bitmap consistent with the screen pixel format using the snapshot interface of the graphics library, and each display control in the static segment is replaced with a single image control that displays the bitmap. In step 302, when solving the mapping plan, the static segment is pre-determined according to the update rhythm associated with the data type field of each semantic node. The estimated value of the memory required for bitmap rendering of the static segment and the estimated value of the memory released after replacement are included in the memory budget constraint, so that the bitmap rendering decision and the selection decision are weighed under the same budget. Display controls with non-static update rhythms are grouped and mounted to their respective parent containers according to their update rhythms. Each parent container is set with a timer that triggers a refresh according to the corresponding update rhythm. For example, the parent container for the per-second layer is driven by a timer with a period of one second, and the parent container for the per-minute layer is driven by a timer with a period of one minute. The invalidation area of ​​pointer-type display controls is defined by a sector bounding box corresponding to the old and new angles to reduce the area to be redrawn each time. It should be noted that update rhythms and bitmaps are not necessary conditions for implementing this embodiment. Without bitmaps, all display controls are retained as objects and driven by a unified refresh task, and the file selection and partial downscaling in this embodiment can still work normally.

[0056] As a preferred but not mandatory improvement, the electronic device can use the ratio of the measured peak memory usage to the sum of the expected memory usage of each selected candidate implementation as a memory correction factor, and the ratio of the measured rendering time of each display control to the expected rendering time of its corresponding candidate implementation as a rendering time correction factor. This is written back to the cost metadata. In the next mapping plan solution, the expected memory usage and expected rendering time are multiplied by the memory correction factor and rendering time correction factor respectively, so that the predicted value gradually approximates the actual consumption of the real device. After downgrading some semantic nodes in step 304, the measured values ​​are compared with the memory budget and frame budget again at least one frame interval to avoid excessive degradation caused by continuous downgrading within the same frame. A hysteresis strategy is used for recovery. Only when the margin of the measured value relative to the memory budget and frame budget is higher than a preset margin threshold within a consecutive preset number of frames is the downgraded semantic node restored to the candidate implementation with the next higher quality score. The preset number of frames and margin threshold can be set according to the jitter of the electronic device, for example, taking a certain percentage of several frames and the budget. When no correction factor and hysteresis are used, the estimated value at the time of export is used for each solution, and it does not automatically recover after downgrading, which is simpler to implement, but the accuracy of the plan and the display quality are slightly lower.

[0057] Building upon the above scheme, the device model, firmware version, hash value of the dial configuration file, and current power consumption mode of the electronic device can be further cached as keys for the mapping plan, and the bitmap obtained from bitmap generation is also cached. When the dial configuration file is loaded again, if a mapping plan corresponding to the current key exists in the cache, the solution and bitmap generation in step 302 are skipped, and the display control is created directly according to the cached mapping plan, so that the second loading does not incur additional overhead. When the current power consumption mode changes, such as entering the constant display mode or power saving mode, the electronic device switches to the mapping plan cached for the key corresponding to the switched power consumption mode, and recreates the display control corresponding to the selected candidate implementation of the changed semantic node according to the switched mapping plan; when the update rhythm layer is adopted, the timer of the high rhythm layer can also be directly disabled and its parent container hidden on the existing mapping plan. When no cache is set, steps 301 to 303 are re-executed for each load, and this embodiment can also be implemented.

[0058] Optionally, the data types in the mapping rules can also be associated with the maximum allowable stale time and the minimum change threshold (which can be recorded in the data archive when implemented in combination with Embodiment 2). The scheduler of the electronic device merges data with close expiration times, relying on the same sensor, or overlapping drawing areas into the same wake-up window for reading and refreshing. When the amount of data change is lower than the minimum change threshold, only the cache is updated without triggering a redraw, so as to further reduce the number of wake-ups and the redraw area.

[0059] Optionally, the mapping plan and downgrading events occurring during operation can be written into a rendering report with component identifiers as keys. The format of this rendering report is consistent with that in Embodiment 2, and it is sent to the interface design tool via a communication link. The interface designer can then see that a certain semantic node is downgraded from an animated waveform to a static curve on a certain model of electronic device, and the reason is memory budget, thus allowing for adjustments during the design phase. Embodiment 2 and this embodiment can be implemented individually or in combination. In a combined implementation, the mapping plan is first generated and the display controls are created according to this embodiment, and then the creation results are previewed and corrected according to Embodiment 2.

[0060] Example 4 This embodiment provides an electronic device for executing the watch face display method of any one of the embodiments one to three described above. The electronic device includes a screen, a processor, and a memory. The screen is connected to the processor via a display driver, and the memory is connected to the processor via a bus. The electronic device can be a smartwatch or a smart bracelet. The screen can be a circular, rounded rectangular, or other shaped display screen. The processor can be a microcontroller or an application processor. The memory includes non-volatile memory for storing firmware and a watch face installation package, and random access memory for runtime allocation. The random access memory can be on-chip static random access memory or extended external pseudo-static random access memory. The electronic device may also include a low-power Bluetooth module or a USB interface for receiving the watch face installation package and sending rendering reports to an interface design tool. It may also include sensors such as pedometers and heart rate sensors as the hardware basis for the data source. The memory stores computer programs, mapping rules, and an embedded graphics library. When the computer program is executed by the processor, it reads the watch face configuration file, parses the component descriptions according to the mapping rules, creates and sets display controls, binds the data source and resource files, and renders the display controls onto the screen through the embedded graphics library, thereby implementing the watch face display method of the aforementioned embodiments. The memory can also store the runtime attribute table cache of Embodiment 2 and the mapping plan cache of Embodiment 3.

[0061] Accordingly, one embodiment of this disclosure also provides a computer-readable storage medium storing computer-executable instructions (or computer programs) that, when executed by a processor, implement the steps in the above-described method embodiments. The computer-readable storage medium may include any type of volatile or non-volatile memory, or any combination thereof, storing computer program code. Specifically, the computer-readable storage medium may include, but is not limited to: magnetic storage devices (e.g., magnetic tape, hard disk, floppy disk), optical storage devices (e.g., optical disc (CD), digital versatile optical disc (DVD)), magneto-optical storage devices (e.g., magneto-optical disc), semiconductor memory (e.g., read-only memory (ROM), random access memory (RAM), electrically erasable programmable read-only memory (EEPROM), flash memory, etc.) or other storage technologies. The computer-readable storage medium in this disclosure refers to a non-transitory readable storage medium, excluding the transient propagation signal itself (e.g., modulated data signals, carrier waves, etc.).

[0062] Furthermore, one embodiment of this disclosure provides a computer program product including a computer program or computer-executable instructions carried on a non-transitory computer-readable medium, wherein the computer program or computer-executable instructions, when executed by a processor, cause the processor to perform the steps in the above-described method embodiments.

[0063] It should be noted that the terms "first," "second," etc., used in this specification are only used to distinguish similar objects, and the elements defined by them do not necessarily require or imply any actual relationship or order between these elements, nor are they used to describe a specific order or sequence.

[0064] The terms “comprising,” “including,” or any other variations thereof, as used herein, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase “comprising one…” does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0065] The phrase "execute according to a certain element" as used in this specification means at least according to that element, including both "execute only according to that element" and "execute according to that element and other elements".

[0066] Those skilled in the art will understand that variations of the method steps described above can be obtained based on the embodiments of this disclosure without any inventive effort. For example, the sequence numbers of the steps described in the method embodiments of this specification do not themselves constitute a limitation on the execution order of these steps. Unless there is an explicit specific limitation in the context, the steps may be executed in a different order than that shown in the embodiments (e.g., executing the steps with larger sequence numbers first, then the steps with smaller sequence numbers), or they may be executed in parallel. Furthermore, other steps may be inserted between multiple steps with consecutively numbered sequence numbers.

[0067] Furthermore, it should be understood that after reading the contents of this disclosure, those skilled in the art can make various alterations or modifications to this disclosure, and these equivalent forms also fall within the scope of protection claimed by this disclosure.

Claims

1. A dial display method, characterized in that, Applied to electronic devices, the method includes: Obtain the watch face configuration file, which is a file exported by the interface design tool based on the watch face design draft. The watch face configuration file includes component descriptions that correspond one-to-one with each component in the watch face design draft. Each component description includes a component type field, attribute parameters, and a data type field. The dial configuration file is parsed, and the following processing is performed for each component description: Based on the mapping rules pre-stored in the electronic device, the corresponding control implementation class for the component type field is determined, and a display control is created based on the determined control implementation class; based on the mapping rules, the value of the attribute parameter is set to the value of the corresponding control attribute of the display control; based on the mapping rules, the data source corresponding to the data type field is determined, the determined data source is bound to the display control, and if a resource file corresponding to the data type field exists in the mapping rules, the resource file is loaded into the display control; The created display controls are rendered on the screen of the electronic device, wherein each display control displays data provided by the bound data source.

2. The method according to claim 1, characterized in that, The attribute parameters include the relative coordinates of the component corresponding to the component description with respect to the screen size; Setting the value of the attribute parameter to the value of the corresponding control attribute of the display control includes: obtaining the screen resolution of the electronic device, converting the relative coordinates into pixel coordinates according to the screen resolution, and setting the pixel coordinates as the value of the position attribute of the display control.

3. The method according to claim 1, characterized in that, Each component description also includes a component identifier and a correction boundary, the correction boundary including the correction actions allowed to be performed on the display control and the allowed magnitude of the correction actions; each data type in the mapping rule is also associated with a data file, the data file including at least one of the following: upper and lower bounds of the data type value, maximum number of bits, format template, and longest string in each language; The step of creating a display control based on the determined control implementation class includes: storing the component identifier in the created display control; Before rendering and displaying the created display controls on the screen of the electronic device, the method further includes: A pre-rehearsal dataset is generated based on the data files associated with the data source data to which each of the display controls is bound; The data in the pre-rehearsal dataset is injected into each of the display controls, and each of the display controls is rendered in the off-screen buffer to obtain a color buffer and an identity map. Each pixel in the identity map records the component identifier of the display control to which the pixel belongs. The display metric for each display control is calculated based on the identity graph, and the display controls with display anomalies are determined based on the display metric. Adjust the control properties of the display control with display abnormality within the correction boundary, and recreate the display control with display abnormality according to the adjusted control properties; The rendering and displaying of the created display controls on the screen of the electronic device includes: rendering and displaying the various display controls, including the recreated display controls.

4. The method according to claim 3, characterized in that, The correction boundary also includes the minimum visible ratio; the pre-simulation dataset includes worst-case combination data and control-by-control extreme value data. The worst-case combination data is the longest content in the data file of all display controls that are bound to the data source, and the control-by-control extreme value data is the extreme value in the data file of only one display control while the other display controls keep the sample value. The process of obtaining the color buffer and identity map includes: rendering each of the display controls individually to a temporary buffer with an opacity channel in a stacking order; writing the component identifier of the display control into the identity map for pixels in the temporary buffer whose opacity is higher than a preset opacity threshold; overwriting the previously rendered display controls with the later rendered display controls; and recording the pixel count when each display control is rendered individually. The display metrics include at least one of the following: visible ratio, which is the ratio of the number of pixels in the identity image that record the component identifier of the display control to the pixel count when the display control is rendered alone; off-screen ratio, which is the ratio of the number of pixels in the identity image that record the component identifier of the display control and are located outside the pre-generated screen shape mask to the pixel count when the display control is rendered alone; overlapping pixel count, which is the number of pixels in the intersection of the pixels covered by the two display controls when they are rendered alone; and text overflow flag, indicating that the text content size of the display control exceeds the content area of ​​the display control. The step of determining a display control with display anomalies based on the display metric includes: determining a display control with display anomalies that meets at least one of the following conditions corresponding to the items included in the display metric: the visible ratio is lower than the minimum visible ratio; the out-of-screen ratio exceeds a preset out-of-screen threshold; the number of overlapping pixels exceeds a preset overlap threshold; and the text overflow flag is valid.

5. The method according to claim 3, characterized in that, The correction boundary also includes priority, allowed translation amount, minimum font size and alternative anchor points, and the correction action includes at least one of translation, switching anchor points, switching compact display format, reducing font size and hiding; The step of adjusting the control properties of the display control with display abnormalities within the correction boundary includes: When the display anomaly is an overlap between two display controls, the display control with the lower priority among the two display controls is selected as the adjustment target; otherwise, the display control with the display anomaly is selected as the adjustment target. The adjustment object is subjected to the following corrective actions in sequence, within the allowable correction boundary, until the display anomaly is eliminated: translating the adjustment object radially towards the center of the screen or tangentially along the edge of the screen within the allowable translation amount; switching to the alternative anchor point; switching to a compact display format; reducing the font size to not be lower than the minimum font size; and hiding the adjustment object. After each correction action is performed, only the affected display controls and the areas intersecting with the affected display controls are re-rendered, and the display metric is recalculated. The number of iterations does not exceed a preset number of iterations. The highest priority display control is not hidden. If the highest priority display control is still obscured or clipped after the preset number of iterations, the control properties before adjustment are restored, or the safe layout declared in the dial configuration file is adopted. The step of recreating the display control with display anomalies according to the adjusted control properties includes: writing the adjusted control properties into the runtime property table without modifying the dial configuration file, and creating a new control tree according to the runtime property table; The rendering display includes each of the display controls, including the recreated display controls, which includes replacing the old display control tree with the new control tree once at the frame boundary of the screen refresh; The method further includes: caching the runtime attribute table using the hash value of the dial configuration file, the current language, screen parameters, and font hash value as keys; re-executing the steps from generating the pre-dash dataset to adjusting the control attributes when installing a dial, switching dials, changing the language, or changing the font; otherwise, directly creating a control tree based on the cached runtime attribute table.

6. The method according to claim 3, characterized in that, The method further includes: A rendering report is generated, which records the device pixel coordinates before and after correction, the display metric, the display anomaly type, the pre-rendering data value that triggered the display anomaly, the correction actions performed, and the display anomalies that could not be eliminated for each display control, using the component identifier as the key. The rendering report is sent to the interface design tool through the communication link between the electronic device and the interface design tool. The rendering report is used by the interface design tool to convert the device pixel coordinates in the report into the canvas coordinates of the dial design draft, and to mark the corresponding components of the dial design draft according to the component identifiers.

7. The method according to claim 1, characterized in that, The component is described as a semantic node, which includes a semantic identifier, a priority, and at least one candidate implementation arranged in descending order of quality score. The semantic identifier serves as a data type field of the semantic node. Each candidate implementation includes a set of component type fields, attribute parameters, and cost metadata, which includes estimated memory usage, estimated rendering time, quality score, and power consumption level. Some of the semantic nodes are marked as mandatory nodes. The semantic nodes marked as mandatory nodes also include the lowest acceptable level, which is the upper limit of the sequence number of the candidate implementations that the mandatory node is allowed to select in the descending order of quality score. The method further includes: When the semantic node includes only one candidate implementation, at least one candidate implementation with decreasing quality score is derived from the electronic device according to the preset derivation ladder corresponding to the component type field of the candidate implementation and added to the semantic node. The preset derivation ladder includes at least one of the following: replacing the animated image with the first static frame of the animated image, and then replacing it with a hidden image; disabling anti-aliasing of the arc control and reducing the line width; decoding the image at half resolution; reducing the font size of the text by one level; replacing the shadow or gradient with a solid color. Before creating the display control, the capability vector of the electronic device is acquired, and the capability vector includes at least available memory, processor frequency, and current power consumption mode; Based on the capability vector, the memory budget, frame budget, and power consumption allowance level are determined. With the goal of maximizing the sum of the quality scores of the selected candidate implementations for each semantic node, and under the constraints that the sum of the expected memory usage of the selected candidate implementations does not exceed the memory budget, the sum of the expected rendering time does not exceed the frame budget, the power consumption level does not exceed the power consumption allowance level, and the number of the candidate implementation selected by the forced node in the descending order of quality scores does not exceed the lowest acceptable level of the forced node, a candidate implementation is selected for each semantic node to obtain a mapping plan. The creation of the display control based on the determined control implementation class and the setting of the value of the attribute parameter to the value of the corresponding control attribute of the display control are performed according to the component type field and attribute parameter included in the candidate implementation of the semantic node selected in the mapping plan; During the rendering and display process, the peak memory usage, drawing time, and frame time of each display control are measured. When the measured values ​​exceed the memory budget or the frame budget, in order of priority from low to high and contribution to the excess from large to small, only some of the semantic nodes are switched to the candidate implementation with the second lowest quality score, and only the display controls corresponding to the switched semantic nodes are recreated.

8. The method according to claim 7, characterized in that, Each data type in the mapping rule is also associated with an update rhythm, which can be static, event-triggered, or periodically updated; the method further includes: The update rhythm of each display control is marked according to the update rhythm associated with the data type of the data source to which each display control is bound; Collect consecutive display controls with static update rhythms as static segments in stacking order. When two display controls with static update rhythms are separated by display controls with non-static update rhythms in stacking order and the bounding rectangle of the non-static display controls intersects with the two display controls, the two display controls are not merged into the same static segment. For each static segment, when the memory required to pre-render the static segment as a bitmap is less than the sum of the memory released after each display control in the static segment is replaced and the discounted value of the redraw overhead of the static segment per frame, the static segment is rendered as a bitmap consistent with the screen pixel format, and each display control in the static segment is replaced with a single image control that displays the bitmap; the obtained mapping plan includes: pre-determining the static segment according to the update rhythm associated with the data type field of each semantic node, and solving the memory budget constraint by incorporating the estimated value of the memory required to pre-render the static segment as a bitmap and the estimated value of the memory released after replacement; Display controls with non-static update rhythms are grouped and mounted to their respective parent containers according to their update rhythms, and a timer is set for each parent container to trigger a refresh according to the corresponding update rhythm.

9. The method according to claim 7, characterized in that, The method further includes: The ratio of the measured peak memory usage to the sum of the expected memory usage of each selected candidate implementation is used as the memory correction coefficient. The ratio of the measured drawing time of each display control to the expected drawing time of the selected candidate implementation corresponding to that display control is used as the drawing time correction coefficient. The cost metadata is written back to correct the expected memory usage and the expected drawing time when the mapping plan is obtained next time. After switching some of the semantic nodes to candidate implementations with lower quality scores, the measured values ​​are compared with the memory budget and the frame budget again at least one frame interval; only when the margin of the measured values ​​relative to the memory budget and the frame budget is higher than a preset margin threshold within a consecutive preset number of frames, the switched semantic nodes are restored to candidate implementations with higher quality scores. The mapping plan is cached using the device model, firmware version, hash value of the dial configuration file, and current power mode as keys. When the dial configuration file is reloaded, if a mapping plan corresponding to the current key exists in the cache, the step of obtaining the mapping plan is skipped, and the display control is created directly according to the cached mapping plan. When the current power mode is switched, the mapping plan is switched to the key cached for the switched power mode, and the display control corresponding to the selected candidate implementation of the changed semantic node is recreated according to the switched mapping plan.

10. An electronic device, characterized in that, It includes a screen, a processor, and a memory, the memory storing a computer program that, when executed by the processor, implements the dial display method as described in any one of claims 1 to 9.