A method and apparatus for generating a user interface resource, an electronic device, and a storage medium

CN122593779APending Publication Date: 2026-08-18BEIJING CHANGYOU CHUANGXIANG SOFTWARE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611058712.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-16
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0003]有鉴于此,本申请提供一种用户界面资源的生成方法、装置、电子设备和存储介质,用于在异构环境间生成用户界面资源时避免映射关系断裂,从而解决因映射关系断裂导致的布局错位与参数丢失的问题

Benefits of technology

[0045]As can be seen from the above technical solution, this application discloses a method, apparatus, electronic device, and storage medium for generating user interface resources. This method and apparatus are applied to electronic devices, specifically involving: acquiring a layered design file from a source design environment and corresponding structured layout data; parsing the layered design file and structured layout data in a target rendering environment; generating basic interface nodes based on the layered design file and attaching corresponding layer unique identifiers to the basic interface nodes; injecting layout parameters from the structured layout data into the corresponding basic interface nodes using the layer unique identifiers as indexes; and performing differentiated layout corrections on the injected layout parameters according to the node type of the basic interface nodes to generate the target user interface resource. This application decouples unstable visual transmission from precise parameter transmission through a dual-track architecture, constructs interference-resistant cross-environment mapping anchors using unique identifiers, and bridges the semantic gap between heterogeneous environments through a differentiated correction mechanism. This avoids mapping relationship breakage when generating user interface resources between heterogeneous environments, thereby solving the problems of layout misalignment and parameter loss caused by broken mapping relationships.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122593779A_ABST
    Figure CN122593779A_ABST
Patent Text Reader

Abstract

The application discloses a user interface resource generation method and device, electronic equipment and a storage medium. The generation method and device are applied to the electronic equipment, specifically, a layered design file from a source design environment and structured layout data corresponding to the layered design file are acquired; the layered design file and the structured layout data are respectively parsed in a target rendering environment, a basic interface node is generated based on the layered design file, and a corresponding layer unique identifier is mounted on the basic interface node; layout parameters in the structured layout data are injected into the corresponding basic interface node with the layer unique identifier as an index; and differential layout correction is performed on the injected layout parameters according to the node type of the basic interface node to generate a target user interface resource. The application decouples unstable visual transmission and accurate parameter transmission through a double-track architecture, constructs an anti-interference cross-environment mapping anchor point by using a unique identifier, and bridges the semantic gap between heterogeneous environments through a differential correction mechanism, thereby avoiding mapping relationship rupture when generating a user interface resource between heterogeneous environments, and solving the problems of layout misplacement and parameter loss caused by mapping relationship rupture.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer graphical interface technology, and more specifically, to a method, apparatus, electronic device, and storage medium for generating user interface resources. Background Technology

[0002] In game and interactive application development, the production of user interface resources typically involves two heterogeneous platforms: the source design environment and the target rendering environment. Current technologies often rely on manual setup or simple automated scripts to convert design drafts into engine-usable resources. However, due to fundamental differences in the data structures, coordinate system definitions, and text rendering mechanisms of the two environments, relying solely on layer names or layer order for matching can easily lead to broken mapping relationships due to design adjustments, resulting in layout misalignment and parameter loss. Summary of the Invention

[0003] In view of this, this application provides a method, apparatus, electronic device and storage medium for generating user interface resources, which avoids the breakage of mapping relationship when generating user interface resources in heterogeneous environments, thereby solving the problems of layout misalignment and parameter loss caused by the breakage of mapping relationship.

[0004] To achieve the above objectives, the following solution is proposed:

[0005] A method for generating user interface resources, applied to an electronic device, the method comprising the steps of:

[0006] Obtain the layered design file from the source design environment, and the structured layout data corresponding to the layered design file. The structured layout data includes the unique layer identifier and corresponding layout parameters of each layer in the layered design file.

[0007] In the target rendering environment, the layered design file and the structured layout data are parsed respectively, basic interface nodes are generated based on the layered design file, and the corresponding unique identifier of the layer is attached to the basic interface nodes.

[0008] Using the unique identifier of the layer as an index, the layout parameters in the structured layout data are injected into the corresponding basic interface node;

[0009] Based on the node type of the basic interface node, perform differentiated layout correction on the injected layout parameters to generate the target user interface resource.

[0010] Optionally, the step of parsing the layered design file and the structured layout data in the target rendering environment, generating basic interface nodes based on the layered design file, and attaching the corresponding layer unique identifier to the basic interface nodes includes the following steps:

[0011] The layered design file is read through the first parsing channel to extract layer structure information and image content;

[0012] The structured layout data is read through the second parsing channel to extract the unique identifier of the layer and the layout parameters;

[0013] The basic interface node is generated based on the layer structure information, and a layer information component is created for the basic interface node. The corresponding unique identifier of the layer is written into the basic interface node through the layer information component.

[0014] Optionally, the step of injecting the layout parameters in the structured layout data into the corresponding basic interface node using the unique identifier of the layer as an index includes the following steps:

[0015] If the basic interface node is a text node, then the corresponding character spacing parameter, line spacing parameter, and automatic line spacing ratio parameter are extracted from the structured layout data.

[0016] Based on the baseline measurement mechanism of the text rendering component of the target rendering environment, the line spacing parameter and the automatic line spacing ratio parameter are calculated by inverse solution to obtain the target line spacing.

[0017] The character spacing parameter and the target line spacing are injected into the text node to correct the text layout effect.

[0018] Optionally, the step of performing differentiated layout correction on the injected layout parameters according to the node type of the basic interface node includes the following steps:

[0019] If the basic interface node is a fixed-size node, then the position coordinates and size data in the layout parameters are written into the anchor point attribute of the basic interface node;

[0020] If the base interface node is a stretchable node, the margin offset data in the layout parameters is written into the boundary offset attribute of the base interface node to maintain the layout semantics of the base interface node when it stretches with the parent node.

[0021] Optionally, the step of performing differentiated layout correction on the injected layout parameters according to the node type of the basic interface node further includes the step of:

[0022] If the basic interface node meets the preset reusable component identification conditions and is identified as a reusable component node, then the parent node corresponding to the reusable component node is obtained.

[0023] Based on the layout parameters, the scaling ratio and translation vector are calculated. The reusable component node is positioned in a compatible manner by adjusting the scaling and position attributes of the parent node, while keeping the internal structure of the child nodes of the reusable component node unchanged.

[0024] Optional, the following steps may also be included:

[0025] Obtain the image resources associated with the basic interface node, extract the naming identifier of the image resources, classify the image resources into the corresponding target storage directory based on the naming identifier, perform transparent boundary compensation and nine-grid boundary correction on the classified image resources, and update the reference path of the basic interface node to the image resources.

[0026] And / or,

[0027] When the layout parameters include control construction parameters, at least one of the slider construction mode, scroll container layout mode, scroll spacing and scroll item size is written into the corresponding basic interface node, and a slider control or scroll control in the target rendering environment is generated according to the control construction parameters during the component binding stage.

[0028] And / or,

[0029] In the process of generating the target user interface resources, at least one of the interface identifier to be executed, the generation strategy, and the process state is recorded to the editor's persistent storage or session storage; when a domain reload event is detected in the target rendering environment, the corresponding generator is found based on the recorded information and the process is restored to continue running the subsequent resource generation steps.

[0030] A user interface resource generation apparatus, applied to an electronic device, the apparatus comprising:

[0031] The data acquisition module is configured to acquire a layered design file from the source design environment, and structured layout data corresponding to the layered design file. The structured layout data includes the unique layer identifier of each layer in the layered design file and the corresponding layout parameters.

[0032] The node generation module is configured to parse the layered design file and the structured layout data in the target rendering environment, generate basic interface nodes based on the layered design file, and attach the corresponding unique identifier of the layer to the basic interface nodes.

[0033] The parameter injection module is configured to inject the layout parameters in the structured layout data into the corresponding basic interface node using the unique identifier of the layer as an index.

[0034] The layout correction module is configured to perform differential layout correction on the injected layout parameters based on the node type of the base interface node, and generate the target user interface resource.

[0035] Optional, also includes:

[0036] The boundary compensation correction module is configured to obtain the image resources associated with the basic interface node, extract the naming identifier of the image resources, classify the image resources into the corresponding target storage directory based on the naming identifier, perform transparent boundary compensation and nine-grid boundary correction on the classified image resources, and update the reference path of the basic interface node to the image resources.

[0037] And / or,

[0038] The control construction parameter application module is configured to write at least one of the slider construction mode, scroll container layout mode, scroll spacing and scroll item size into the corresponding basic interface node when the layout parameters include control construction parameters, and generate a slider control or scroll control in the target rendering environment according to the control construction parameters during the component binding stage.

[0039] And / or,

[0040] The process recovery and continuation module is configured to record at least one of the following in the process of generating the target user interface resources: the interface identifier to be continued, the generation strategy, and the process status, to the editor's persistent storage or session storage; when a domain reload event is detected in the target rendering environment, the corresponding generator is found based on the recorded information and the process is restored to continue the subsequent resource generation steps.

[0041] An electronic device includes at least one processor and a memory connected to the processor, wherein:

[0042] The memory is used to store computer programs or instructions;

[0043] The processor is used to execute the computer program or instructions to enable the electronic device to implement the generation method described above.

[0044] A computer-readable storage medium is applied to an electronic device, the storage medium carrying one or more computer programs that can be executed by the processor, thereby enabling the electronic device to perform the generation method as described above.

[0045] As can be seen from the above technical solution, this application discloses a method, apparatus, electronic device, and storage medium for generating user interface resources. This method and apparatus are applied to electronic devices, specifically involving: acquiring a layered design file from a source design environment and corresponding structured layout data; parsing the layered design file and structured layout data in a target rendering environment; generating basic interface nodes based on the layered design file and attaching corresponding layer unique identifiers to the basic interface nodes; injecting layout parameters from the structured layout data into the corresponding basic interface nodes using the layer unique identifiers as indexes; and performing differentiated layout corrections on the injected layout parameters according to the node type of the basic interface nodes to generate the target user interface resource. This application decouples unstable visual transmission from precise parameter transmission through a dual-track architecture, constructs interference-resistant cross-environment mapping anchors using unique identifiers, and bridges the semantic gap between heterogeneous environments through a differentiated correction mechanism. This avoids mapping relationship breakage when generating user interface resources between heterogeneous environments, thereby solving the problems of layout misalignment and parameter loss caused by broken mapping relationships. Attached Figure Description

[0046] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0047] Figure 1 This is a flowchart illustrating a method for generating user interface resources according to an embodiment of this application;

[0048] Figure 2 This is a flowchart illustrating another method for generating user interface resources according to an embodiment of this application;

[0049] Figure 3 This is a block diagram of a user interface resource generation apparatus according to an embodiment of this application;

[0050] Figure 4 A block diagram of an apparatus for generating user interface resources according to another embodiment of this application;

[0051] Figure 5 This is a block diagram of an electronic device according to an embodiment of this application. Detailed Implementation

[0052] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0053] Figure 1 This is a flowchart illustrating a method for generating user interface resources according to an embodiment of this application.

[0054] like Figure 1 As shown, the generation method provided in this embodiment is applied to electronic devices to generate user interfaces in heterogeneous environments. This method achieves high-precision resource conversion from the source design environment to the target rendering environment by constructing a dual-track decoupled data processing architecture. The electronic device can be understood as a computer, server, or cloud platform with data computing and information processing capabilities. The generation method specifically includes the following steps:

[0055] S1. Obtain the layered design file from the source design environment, as well as the structured layout data corresponding to the layered design file.

[0056] In one implementation, the source design environment is Photoshop, the layered design file is a PSD file or a PSB file; the structured layout data is a JSON file exported from a script in the source design environment, and the target rendering environment is a Unity UGUI environment. The basic interface nodes include at least one of RectTransform nodes, image nodes, text nodes, slider nodes, and scroll container nodes.

[0057] The layered design files and structured layout data in this application constitute two independent yet logically related data tracks. The structured layout data contains the unique layer identifiers and corresponding layout parameters of each layer in the layered design files. The layered design files mainly carry the visual representation information of the interface, such as the pixel content of images, vector paths, layer blending modes, and basic hierarchical nesting relationships. In essence, they are graphic descriptions oriented towards human visual perception. The structured layout data, on the other hand, is a set of parametric descriptions extracted or exported from the source design environment and oriented towards machine parsing. It does not contain any pixel-level image content, but rather precisely records the geometric attributes (such as coordinates, width and height), typographic attributes (such as character spacing and line height), and most importantly, the unique layer identifiers of each layer on the design canvas in the form of key-value pairs or object arrays.

[0058] The dual-track acquisition mechanism of this application is designed to decouple visual content from layout parameters. In actual cross-environment production processes, the export of visual resources often involves image slicing, format conversion, or engine import. If layout parameters are embedded inside the visual file, they are prone to loss or decrease in accuracy due to format compatibility issues. At the same time, the independent layout data stream allows the layout parameters to be updated separately without re-exporting large visual resources, thereby significantly improving iteration efficiency.

[0059] S2. In the target rendering environment, parse the layered design file and structured layout data respectively, generate basic interface nodes based on the layered design file, and attach the corresponding layer unique identifier to the basic interface node.

[0060] Specifically, after receiving the dual-track data, the target rendering environment starts two independent parsing channels: the first parsing channel and the second parsing channel. The first parsing channel is responsible for reading the layered design file and converting its layer structure into a basic interface node tree that the target environment can recognize. At this point, these nodes only have basic rendering capabilities and hierarchical relationships, and lack precise layout and positioning information. At the same time, the second parsing channel synchronously reads the structured layout data and constructs a memory lookup table with the unique identifier of each layer as the key.

[0061] When generating each basic interface node, the system immediately creates a dedicated layer information component and writes the unique layer identifier corresponding to that node in the source design environment into this component. The use of a unique layer identifier instead of the traditional layer name as the anchor point is based on lessons learned from real-world engineering: in collaborative design, designers often modify layer names to characters or text that are easy for them to understand or remember for readability. Different designers will not have completely identical naming habits for the same function, making name-matching-based automation solutions extremely fragile. A unique layer identifier, typically generated automatically by the source design software when creating the layer and remaining unchanged throughout the file's lifecycle (e.g., GUID or auto-incrementing ID), possesses inherent resistance to interference and stability. By physically attaching a component containing this identifier to the node, it's equivalent to implanting a stable mapping identifier into each runtime object, laying a solid foundation for accurate parameter injection later.

[0062] Specifically, the first and second parsing channels are physically isolated and independent in terms of data processing logic. The first parsing channel focuses on processing visual resources in binary or vector formats. Its core task is to reconstruct the hierarchical tree structure of layers and extract pixel or geometric content. This process typically involves complex graphics decoding operations and is prone to anomalies due to differences in file format versions. The second parsing channel, on the other hand, focuses on processing parameterized data in text markup language or key-value pair formats. Its task is lightweight and highly deterministic, and it is only responsible for building a memory index table with the unique identifier of the layer as the key. The advantage of this physical isolation design is that even if the first parsing channel fails partially due to corruption or format incompatibility of the layered design file, the second parsing channel can still obtain the layout parameters completely. The system can then retain the layout index and output clear anomaly location information, thereby reducing the risk of interruption of the entire conversion process.

[0063] Furthermore, when generating basic interface nodes, this application does not simply pass the layer's unique identifier as a temporary variable, but explicitly creates a layer information component and persistently mounts it to the node entity. This layer information component acts as a runtime carrier for cross-environment mapping relationships, allowing any subsequent processing to directly access this component to obtain a stable traceability index without repeatedly querying external data sources or relying on volatile node names, greatly improving the robustness and decoupling of data flow within the system.

[0064] S3. Using the unique identifier of the layer as an index, inject the layout parameters in the structured layout data into the corresponding basic interface node.

[0065] This operation represents the logical convergence point of the dual-track data flow within the target rendering environment. It iterates through all base interface nodes with mounted layer information components, reads their stored unique layer identifiers, and uses these identifiers as index keys to retrieve data from the constructed in-memory lookup table. Once a match is found, the corresponding layout parameters, such as position coordinates, size constraints, and text styles, are batch-written into the node's attribute fields. Because a unique identifier is used as the index, this injection process does not depend on the node's current name, hierarchical path, or sibling node order. Even if the target environment reorders or automatically renames nodes during parsing, the parameters can still accurately find their corresponding objects.

[0066] In one implementation, the structured layout data further includes control construction parameters, which include at least one of a slider construction mode, a scroll container layout mode, scroll spacing, and scroll item size. After completing the matching using the unique layer identifier, the system writes the control construction parameters into the layer information component or intermediate generation component of the corresponding node, and generates a slider control or scroll control in the target rendering environment based on the control construction parameters during the component binding stage.

[0067] If the base interface node is a text node, the corresponding character spacing parameters, line spacing parameters, and automatic line spacing ratio parameters are extracted from the structured layout data; based on the baseline measurement mechanism of the text rendering component of the target rendering environment, the line spacing parameters and the automatic line spacing ratio parameters are calculated inversely to obtain the target line spacing; the character spacing parameters and the target line spacing are injected into the text node to correct the text layout effect.

[0068] Specifically, parameter injection here is not a simple numerical copy, but a sophisticated calculation process involving metric conversion. In the source design environment, text layout parameters are usually defined based on ideal units of measurement during font design, with line spacing and character spacing describing the theoretical spatial relationship between character outlines. In the target rendering environment, however, text rendering components often perform rasterization based on screen pixel grids, texture atlas sampling, or specific baseline offset models, maintaining an independent metric system internally, such as BaseLine, Ascender, and Descender metrics. If the line spacing values ​​from the source end are directly assigned to the target end node, the different definitions of line height (e.g., the source end might refer to the distance between two line baselines, while the target end might refer to the gap from the bottom of the previous line to the top of the next line plus extra padding) will inevitably result in visually overcrowded or overly loose text, severely undermining the design intent.

[0069] To address this heterogeneous metric discrepancy, this application introduces an inverse computation mechanism based on the characteristics of the target rendering environment. This mechanism utilizes the baseline measurements of the target rendering environment itself to deduce equivalent target parameters that match the source-end line spacing.

[0070] Furthermore, the handling of kerning parameters also follows the adaptation principle. The kerning parameters extracted by the system from the structured layout data may be in the form of tracking values ​​or word spacing, etc. During injection, the system will normalize them according to the adjustment granularity supported by the target rendering component. If the target component only supports global kerning adjustment and not word-by-word fine-tuning, the extracted kerning parameters will be converted into an equivalent global scaling factor or an additional horizontal offset to approximate the original typographic rhythm as closely as possible.

[0071] S4. Based on the node type of the basic interface node, perform differentiated layout correction on the injected layout parameters to generate the target user interface resource.

[0072] Because the source design environment and the target rendering environment often differ fundamentally in coordinate system definition, origin position, unit conversion, and layout semantics, directly assigning injected parameters to nodes usually fails to produce the correct visual effect. Therefore, this application introduces a differentiated layout correction mechanism, specifically: First, it identifies the node type of each basic interface node, such as determining whether it is a fixed-size node or a stretchable adaptive node; for fixed-size nodes, the injected absolute coordinates are converted into anchor point coordinates relative to the parent container, and the width and height values ​​are directly applied; while for stretchable nodes, the system does not write fixed width and height, but instead converts the injected margin information into boundary offsets (Offset) to ensure that the node can automatically scale according to the design intent when the size of the parent container changes.

[0073] The above operations demonstrate the deep adaptability of this application to the semantics of layout in heterogeneous environments. Specifically, fixed-size nodes typically correspond to visual elements such as icons and button backgrounds that should maintain a constant physical or pixel size across different screen resolutions. For such nodes, the system directly assigns the absolute coordinates and width / height values ​​recorded in the structured layout data to the node's anchor point attribute after coordinate system transformation, giving it a definite positioning point and size relative to the parent container, preventing deformation as the size of the parent container changes.

[0074] Stretchable nodes typically correspond to elements such as dialog box backgrounds, full-screen panels, and input box backgrounds that need to adapt to the size of their parent container or the screen. If fixed width and height values ​​are still used for these nodes, they will fail to automatically fill or align when the size of the parent container changes in the target rendering environment, leading to layout breakage. Therefore, this application no longer focuses on the absolute size of stretchable nodes. Instead, it calculates the offsets relative to the four sides of the parent container based on the left, right, top, and bottom margin information recorded in the structured layout data, and writes these offsets into the node's boundary offset attribute. In this way, the size of the node in the target rendering environment is dynamically determined by subtracting the preset margin offset from the real-time size of the parent container, thus better maintaining the responsive layout intent defined in the source design environment.

[0075] Furthermore, for special types such as text nodes and reusable component nodes, specialized layout decomposition or container transformation operations are performed. Through this type-based differentiated processing, this application not only completes data transfer but also achieves cross-environment translation of layout semantics, thereby ensuring that the generated target user interface resources maintain consistent visual performance and interactive behavior with the design draft across various resolutions and adaptation scenarios.

[0076] It also includes: if a basic interface node meets the preset reusable component identification conditions and is identified as a reusable component node, then obtain the parent node corresponding to the reusable component node; calculate the scaling ratio and translation vector based on the layout parameters, and perform compatible positioning of the reusable component node by adjusting the scaling attribute and position attribute of the parent node, so as to keep the internal structure of the child node of the reusable component node unchanged.

[0077] Specifically, the aforementioned preset reusable component identification conditions are the key criteria for distinguishing ordinary independent nodes from reusable component instances. In practical engineering, these identification conditions can take various forms: for example, the node name contains specific prefixes or suffixes, such as control prefixes like btn_, Tog_, Tgg_, Sli_, Pro_, etc.; or, in structured layout data, the node's metadata field explicitly carries boolean values ​​or reference identifiers such as isReusable or templateRef; or, the system automatically determines its reusability based on the node's layer type in the source design environment. Regardless of the specific form used, the core purpose is to enable the system to accurately identify component entities that should not be treated as ordinary graphic elements but should be considered as having independent internal logical structures.

[0078] When the system identifies a basic interface node as a reusable component node, it doesn't directly modify the node's transformation properties as it would with ordinary nodes. Instead, it retrieves and manipulates its parent node. This step employs a reverse positioning strategy, contrary to conventional intuition. The underlying technical mechanism is that reusable components are typically encapsulated as independent prefabs or template resources in the target rendering environment. Their child nodes often rely on a local coordinate system relative to the component's root node for layout, and may even be bound to specific adaptive layout scripts or animation state machines. If the absolute size or non-uniform scaling ratio of the reusable component's root node is forcibly modified to adapt to the current interface's layout requirements, it can easily disrupt its carefully designed relative structure, leading to misaligned child elements, abnormal stretching of the nine-grid borders, or triggering the engine's internal style reset protection mechanism. Ultimately, this results in a significant deviation between the generated interface and the design draft.

[0079] Conversely, by introducing or reusing the parent node as a transformation proxy container on top of the reusable component node, all translation, rotation, and overall scaling transformations are applied to the parent node, effectively providing an external adaptation layer for the reusable component. In this architecture, the internal structure of the reusable component remains frozen and intact, achieving its correct placement in the current interface only through spatial transformations of the parent container, thus balancing layout accuracy and component encapsulation integrity.

[0080] As can be seen from the above technical solution, this embodiment provides a method for generating user interface resources. This method is applied to electronic devices, specifically involving obtaining a layered design file from the source design environment and the structured layout data corresponding to the layered design file; parsing the layered design file and the structured layout data in the target rendering environment, generating basic interface nodes based on the layered design file, and attaching corresponding layer unique identifiers to the basic interface nodes; injecting layout parameters from the structured layout data into the corresponding basic interface nodes using the layer unique identifiers as indexes; and performing differentiated layout corrections on the injected layout parameters according to the node type of the basic interface nodes to generate the target user interface resource. This application decouples unstable visual transmission from precise parameter transmission through a dual-track architecture, constructs interference-resistant cross-environment mapping anchors using unique identifiers, and bridges the semantic gap between heterogeneous environments through a differentiated correction mechanism. This avoids the breakage of mapping relationships when generating user interface resources between heterogeneous environments, thereby solving the problems of layout misalignment and parameter loss caused by broken mapping relationships.

[0081] In addition, in one specific embodiment of this application, the generation method of this application further includes any one or more of the following steps: Figure 2 One of the optional processes is shown.

[0082] S5. Obtain the image resources associated with the basic interface nodes, classify the image resources, and perform transparent boundary compensation and nine-grid boundary correction based on this.

[0083] After generating and correcting the layout of the basic interface nodes, this application introduces an automatic resource classification and post-processing correction mechanism to ensure that the generated user interface resources are not only accurately positioned but also meet the resource management specifications and rendering performance requirements of the target rendering environment. Specifically, this involves obtaining the image resources associated with the basic interface nodes and extracting their naming identifiers; classifying the image resources into their corresponding target storage directories based on the naming identifiers; performing transparent boundary compensation and nine-grid boundary correction on the classified image resources; and finally updating the reference paths of the basic interface nodes to the image resources.

[0084] Specifically, the above operations constitute the post-processing closed loop of the generation scheme in this application. During the cross-environment conversion process, the original image resources exported from the source design environment are often in an intermediate state awaiting organization. Their file names may contain specific semantic tags, but their physical storage locations are usually scattered or temporary. The system first traverses all generated basic interface nodes, identifies the image resource objects they reference, and parses the file name or metadata field of the resource to extract the naming identifier. This naming identifier is the bridge connecting the design intent and the engine resource management strategy. For example, the naming identifier can be represented by a specific prefix, suffix, or key field in the file name. In a specific application scenario, if the naming identifier contains static resource tags such as Static or US, the system moves or copies the image resource to a directory in the target rendering environment specifically for storing general static icons; if the naming identifier contains dynamic resource tags such as Dynamic or UD, it is categorized into a directory for storing sequence frames or dynamic textures; if it contains background tags such as Background or BigBg, it is categorized into a dedicated directory for large-size background resources.

[0085] It should be understood that the specific prefix rules mentioned above are merely illustrative. In actual implementation, the naming identifier can be any string pattern that can characterize resource attributes, uses, or loading priorities, or even a mapping relationship stored in a separate configuration file, as long as it enables automated routing based on the identifier. This semantic identifier-based automatic classification mechanism not only avoids the tedious work of manually organizing hundreds of image slices, but more importantly, it ensures that the physical organization and logical classification of resources in the target project remain consistent, providing a standardized directory structure foundation for subsequent resource batch loading, memory management, and hot update strategies.

[0086] After resource classification, the system performs two key post-processing correction operations on image resources: transparent boundary compensation and grid boundary correction. These two operations directly determine the final rendering quality and adaptability of the interface. Regarding transparent boundary compensation, the technical mechanism is as follows: when multiple small-sized UI images are merged into the same texture atlas for rendering to reduce draw calls, if the edges of the original images lack sufficient transparent pixel buffers, the edge colors of adjacent tiles may bleed during texture sampling filtering by the GPU, resulting in unexpected noise halos or black edges around interface elements. This application automatically detects the visible content boundaries of image resources through an algorithm, obtaining the left, top, right, and bottom transparent margins, and uses these transparent margins for node position compensation or slice boundary correction, thereby reducing edge rendering artifacts generated when packing atlases or replacing textures. This processing is crucial for ensuring the visual purity of the UI on devices with different resolutions.

[0087] Regarding the nine-grid boundary correction, it targets background or panel images that need to stretch with changes in the size of their parent container. In the source design environment, designers typically define fixed border areas for images visually, but this information is often not automatically converted into nine-grid slice parameters that the target rendering engine can recognize. If the original image is directly applied to stretchable nodes, when the node size is enlarged, the four corners and border lines of the image will undergo non-uniform deformation, resulting in severe visual distortions such as blurred rounded corners and inconsistent border thickness. This application automatically calculates and sets the nine-grid boundary values ​​of image resources by analyzing the geometric features of the image content or reading predefined slice parameters from structured layout data, explicitly specifying which areas should maintain a fixed size and which areas are allowed to stretch and fill. After this correction, the image resources maintain sharp corners and uniform borders regardless of the size they are scaled to in the target rendering environment, thus restoring the adaptive layout intent of the design draft.

[0088] Finally, because the resources have undergone physical location migration and attribute modification, the system must synchronously update the reference path of the basic interface nodes to that image resource. This operation ensures that the nodes can correctly load the final resource after classification and correction at runtime, rather than pointing to an expired temporary file or the original exported file. Through the above-mentioned automatic resource classification and post-processing correction process, this application expands the originally isolated graphics conversion into a complete production pipeline covering resource governance and rendering optimization. This results in the generated target user interface resources that are not only accurately aligned in layout but also meet the standard of direct deployment in terms of engineering quality, significantly reducing the workload of subsequent manual inspection and repair.

[0089] It may also include, when the layout parameters include control construction parameters, writing at least one of the slider construction mode, scroll container layout mode, scroll spacing and scroll item size into the corresponding basic interface node, and generating a slider control or scroll control in the target rendering environment according to the control construction parameters during the component binding stage;

[0090] S6. Record resume information during the process of generating target user interface resources. When a domain reload event occurs in the host runtime environment, resume the process based on the resume information.

[0091] To address the common issue of domain overload causing automated process interruptions in dynamic editor environments, this application records at least one of the following in the process of generating target user interface resources: the interface identifier to be executed, the generation strategy, and the process state, to the editor's persistent storage or session storage. When a domain overload event is detected in the target rendering environment, the corresponding generator is located based on the recorded information, the process is restored, and subsequent resource generation steps are continued.

[0092] Specifically, in the target rendering environment, when operations such as script code compilation, resource asset re-import, plugin hot updates, or assembly refreshes occur, the host process typically triggers a domain reload. This process forcibly releases and resets all static variables, instance objects, and runtime contexts in managed memory. For traditional linear automated scripts, this means that all previously accumulated parsing results, intermediate mapping tables, and processing progress will be lost instantly, forcing the task to start executing from scratch. This causes significant time waste and efficiency bottlenecks when processing large, layered design files containing hundreds of layers. This application fundamentally changes this problem by introducing state persistence and breakpoint resume mechanisms.

[0093] During the resource generation process, the system records continuation information at checkpoints that may trigger domain reload, such as the interface identifier to be continued, whether a compatibility generation strategy is enabled, and the current status of completed folders or prefab creations. This information can be written to the editor's persistent storage or session storage to locate the same generation task after domain reload and avoid repeated pop-ups or re-execution of completed preparation steps.

[0094] Regarding the detection of domain reload events, the system reads the recorded pending task identifiers after script compilation or domain reload is completed, through editor lifecycle callbacks or delayed callbacks provided by the target rendering environment. If a generator matching the task identifier is found, the subsequent generation process is automatically invoked; if no matching generator is found, a prompt is output and the pending task marker is cleared. Through the above recovery logic, the generation process can continue to execute after a domain reload caused by script generation, resource import, or assembly refresh, reducing the cost of repeated configuration and triggering of the generation process for users.

[0095] To more clearly illustrate this technical feature of this application, a specific production scenario is used as an example: In this scenario, when a user first triggers the user interface resource generation process, after the system completes the creation of the target directory, basic prefabs, and logic scripts, a domain reload is triggered due to script refresh. Before triggering the domain reload, the system has recorded the interface identifier and generation strategy to be executed; after the domain reload is completed, the initialization callback reads the identifier, finds the corresponding generator in the scene, and continues to execute subsequent steps such as layered design file parsing, basic interface node generation, layout parameter injection, resource replacement, and component binding. Through the above operations, this application transforms the automated script process that relies on transient memory states into a recoverable generation process, improving generation stability and production efficiency in a dynamic development environment.

[0096] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0097] Although the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in sequential order. In certain environments, multitasking and parallel processing may be advantageous.

[0098] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.

[0099] Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including but not limited to object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer.

[0100] Figure 3 This is a block diagram of a user interface resource generation apparatus according to an embodiment of this application.

[0101] like Figure 3As shown, the generation device provided in this embodiment is applied to electronic devices for generating user interfaces in heterogeneous environments. The electronic device can be understood as a computer, server, or cloud platform with data computing and information processing capabilities. Specifically, the generation device includes a data acquisition module 10, a node generation module 20, a parameter injection module 30, and a layout correction module 40.

[0102] The data acquisition module is used to acquire the layered design files from the source design environment, as well as the structured layout data corresponding to the layered design files.

[0103] The layered design files and structured layout data in this application constitute two independent yet logically related data tracks. The structured layout data contains the unique layer identifiers and corresponding layout parameters of each layer in the layered design files. The layered design files mainly carry the visual representation information of the interface, such as the pixel content of images, vector paths, layer blending modes, and basic hierarchical nesting relationships. In essence, they are graphic descriptions oriented towards human visual perception. The structured layout data, on the other hand, is a set of parametric descriptions extracted or exported from the source design environment and oriented towards machine parsing. It does not contain any pixel-level image content, but rather precisely records the geometric attributes (such as coordinates, width and height), typographic attributes (such as character spacing and line height), and most importantly, the unique layer identifiers of each layer on the design canvas in the form of key-value pairs or object arrays.

[0104] The dual-track acquisition mechanism of this application is designed to decouple visual content from layout parameters. In actual cross-environment production processes, the export of visual resources often involves image slicing, format conversion, or engine import. If layout parameters are embedded inside the visual file, they are prone to loss or decrease in accuracy due to format compatibility issues. At the same time, the independent layout data stream allows the layout parameters to be updated separately without re-exporting large visual resources, thereby significantly improving iteration efficiency.

[0105] The node generation module is used to parse the layered design file and structured layout data in the target rendering environment, generate basic interface nodes based on the layered design file, and attach the corresponding layer unique identifier to the basic interface node.

[0106] Specifically, after receiving the dual-track data, the target rendering environment initiates two independent parsing channels: the first parsing channel and the second parsing channel. The first parsing channel reads the layered design file, converting its layer structure into a basic interface node tree recognizable by the target environment. These nodes at this stage only possess basic rendering capabilities and hierarchical relationships, lacking precise layout and positioning information. Simultaneously, the second parsing channel reads the structured layout data and constructs a memory lookup table using the unique identifier of each layer as the key. The specific process has been detailed above and will not be repeated here.

[0107] The parameter injection module is used to inject layout parameters from the structured layout data into the corresponding basic interface nodes, using the layer's unique identifier as an index.

[0108] This operation represents the logical convergence point of the dual-track data flow within the target rendering environment. It iterates through all base interface nodes with mounted layer information components, reads their stored unique layer identifiers, and uses these identifiers as index keys to retrieve data from the constructed in-memory lookup table. Once a match is found, the corresponding layout parameters, such as position coordinates, size constraints, and text styles, are batch-written into the node's attribute fields. Because a unique identifier is used as the index, this injection process does not depend on the node's current name, hierarchical path, or sibling node order. Even if the target environment reorders or automatically renames nodes during parsing, the parameters can still accurately find their corresponding objects.

[0109] If the base interface node is a text node, the corresponding character spacing parameters, line spacing parameters, and automatic line spacing ratio parameters are extracted from the structured layout data; based on the baseline measurement mechanism of the text rendering component of the target rendering environment, the line spacing parameters and the automatic line spacing ratio parameters are calculated inversely to obtain the target line spacing; the character spacing parameters and the target line spacing are injected into the text node to correct the text layout effect.

[0110] The layout correction module is used to perform differentiated layout correction on the injected layout parameters based on the node type of the basic interface nodes, and generate the target user interface resources.

[0111] Because the source design environment and the target rendering environment often differ fundamentally in coordinate system definition, origin position, unit conversion, and layout semantics, directly assigning injected parameters to nodes usually fails to produce the correct visual effect. Therefore, this application introduces a differentiated layout correction mechanism, specifically: First, it identifies the node type of each basic interface node, such as determining whether it is a fixed-size node or a stretchable adaptive node; for fixed-size nodes, the injected absolute coordinates are converted into anchor point coordinates relative to the parent container, and the width and height values ​​are directly applied; while for stretchable nodes, the system does not write fixed width and height, but instead converts the injected margin information into boundary offsets (Offset) to ensure that the node can automatically scale according to the design intent when the size of the parent container changes.

[0112] As can be seen from the above technical solution, this embodiment provides a user interface resource generation device. This device is applied to electronic devices and specifically involves acquiring a layered design file from a source design environment and the corresponding structured layout data; parsing the layered design file and the structured layout data in a target rendering environment; generating basic interface nodes based on the layered design file; attaching corresponding layer unique identifiers to the basic interface nodes; injecting layout parameters from the structured layout data into the corresponding basic interface nodes using the layer unique identifiers as indexes; and performing differentiated layout corrections on the injected layout parameters according to the node type of the basic interface nodes to generate the target user interface resource. This application decouples unstable visual transmission from precise parameter transmission through a dual-track architecture, constructs interference-resistant cross-environment mapping anchors using unique identifiers, and bridges the semantic gap between heterogeneous environments through a differentiated correction mechanism. This avoids mapping relationship breakage when generating user interface resources between heterogeneous environments, thereby solving the problems of layout misalignment and parameter loss caused by broken mapping relationships.

[0113] In another specific embodiment of this application, the generation apparatus further includes one or more of the following: a boundary compensation correction module 50, a control construction parameter application module 60, and a process recovery and continuation module 70. Figure 4 One of the optional structures is shown.

[0114] The boundary compensation and correction module is used to obtain the image resources associated with the basic interface nodes, classify the image resources, and perform transparent boundary compensation and nine-grid boundary correction based on this.

[0115] The control construction parameter application module is used to write at least one of the following into the corresponding basic interface node when the layout parameters include control construction parameters: slider construction mode, scroll container layout mode, scroll spacing, and scroll item size. During the component binding stage, the module generates a slider control or scroll control in the target rendering environment based on the control construction parameters.

[0116] After generating and correcting the layout of the basic interface nodes, this application introduces an automatic resource classification and post-processing correction mechanism to ensure that the generated user interface resources are not only accurately positioned but also meet the resource management specifications and rendering performance requirements of the target rendering environment. Specifically, this involves obtaining the image resources associated with the basic interface nodes and extracting their naming identifiers; classifying the image resources into their corresponding target storage directories based on the naming identifiers; performing transparent boundary compensation and nine-grid boundary correction on the classified image resources; and finally updating the reference paths of the basic interface nodes to the image resources.

[0117] The process recovery and continuation module is used to record continuation information in the process of generating target user interface resources. When a domain reload event occurs in the host runtime environment, the process is recovered based on the continuation information.

[0118] To address the common issue of domain overload causing automated process interruptions in dynamic editor environments, this application records at least one of the following in the process of generating target user interface resources: the interface identifier to be executed, the generation strategy, and the process state, to the editor's persistent storage or session storage. When a domain overload event is detected in the target rendering environment, the corresponding generator is located based on the recorded information, the process is restored, and subsequent resource generation steps are continued.

[0119] Through the above operations, this application transforms the automated script process that relies on transient memory states into a recoverable generation process, thereby improving generation stability and production efficiency in a dynamic development environment.

[0120] The units described in the embodiments of this disclosure can be implemented in software or in hardware. The name of a unit does not necessarily limit the unit itself; for example, the first acquisition unit can also be described as "a unit that acquires at least two Internet Protocol addresses".

[0121] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), and so on.

[0122] Figure 5 This is a block diagram of an electronic device according to an embodiment of this application.

[0123] The following is for reference. Figure 5 This document illustrates a structural diagram suitable for implementing the electronic device in the embodiments of this disclosure. The terminal device in the embodiments of this disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. This electronic device is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this disclosure.

[0124] The electronic device may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from an input device 506 into a random access memory (RAM) 503. The RAM also stores various programs and data required for the operation of the electronic device. The processing unit, ROM, and RAM are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0125] Typically, the following devices can be connected to the I / O interface: input devices including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 508 including, for example, magnetic tapes, hard disks, etc.; and communication devices 509. Communication device 509 allows the electronic device to communicate wirelessly or wiredly with other devices to exchange data. Although electronic devices with various devices are shown in the figures, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.

[0126] This application also provides an embodiment of a computer-readable storage medium.

[0127] The aforementioned computer-readable storage medium is applied to an electronic device and carries one or more computer programs. When these programs are executed by the electronic device, the device acquires a layered design file from the source design environment, along with structured layout data corresponding to the layered design file. In the target rendering environment, the layered design file and structured layout data are parsed separately. Basic interface nodes are generated based on the layered design file, and corresponding layer unique identifiers are attached to these nodes. Using the layer unique identifier as an index, layout parameters from the structured layout data are injected into the corresponding basic interface nodes. Differential layout corrections are performed on the injected layout parameters according to the node type of the basic interface nodes, generating the target user interface resource. This application decouples unstable visual transmission from precise parameter transmission through a dual-track architecture, constructs interference-resistant cross-environment mapping anchors using unique identifiers, and bridges the semantic gap between heterogeneous environments through a differential correction mechanism. This avoids mapping relationship breakage when generating user interface resources between heterogeneous environments, thus solving the problems of layout misalignment and parameter loss caused by broken mapping relationships.

[0128] It should be noted that the computer-readable medium described above in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof.

[0129] In this disclosure, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0130] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0131] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present invention.

[0132] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device 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 terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.

[0133] The technical solution provided by the present invention has been described in detail above. Specific examples have been used to illustrate the principle and implementation of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core idea of ​​the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation and application scope based on the idea of ​​the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A method for generating a user interface resource, applied to an electronic device, comprising: The generation method includes the following steps: ​ Obtain the layered design file from the source design environment, and the structured layout data corresponding to the layered design file. The structured layout data includes the unique layer identifier and corresponding layout parameters of each layer in the layered design file. In the target rendering environment, the layered design file and the structured layout data are parsed respectively, basic interface nodes are generated based on the layered design file, and the corresponding unique identifier of the layer is attached to the basic interface nodes. Using the unique identifier of the layer as an index, the layout parameters in the structured layout data are injected into the corresponding basic interface node; Based on the node type of the basic interface node, perform differentiated layout correction on the injected layout parameters to generate the target user interface resource.

2. The generation method as described in claim 1, characterized in that, The steps include parsing the layered design file and the structured layout data in the target rendering environment, generating basic interface nodes based on the layered design file, and attaching the corresponding unique layer identifier to the basic interface nodes: The layered design file is read through the first parsing channel to extract layer structure information and image content; The structured layout data is read through the second parsing channel to extract the unique identifier of the layer and the layout parameters; The basic interface node is generated based on the layer structure information, and a layer information component is created for the basic interface node. The corresponding unique identifier of the layer is written into the basic interface node through the layer information component.

3. The generation method as described in claim 1, characterized in that, The step of injecting layout parameters from the structured layout data into the corresponding basic interface node using the unique identifier of the layer as an index includes the following steps: If the basic interface node is a text node, then the corresponding character spacing parameter, line spacing parameter, and automatic line spacing ratio parameter are extracted from the structured layout data. Based on the baseline measurement mechanism of the text rendering component of the target rendering environment, the line spacing parameter and the automatic line spacing ratio parameter are calculated by inverse solution to obtain the target line spacing. The character spacing parameter and the target line spacing are injected into the text node to correct the text layout effect.

4. The generation method as described in claim 1, characterized in that, The step of performing differentiated layout correction on the injected layout parameters based on the node type of the basic interface node includes the following steps: If the basic interface node is a fixed-size node, then the position coordinates and size data in the layout parameters are written into the anchor point attribute of the basic interface node; If the base interface node is a stretchable node, the margin offset data in the layout parameters is written into the boundary offset attribute of the base interface node to maintain the layout semantics of the base interface node when it stretches with the parent node.

5. The generation method as described in claim 4, characterized in that, The step of performing differentiated layout correction on the injected layout parameters based on the node type of the basic interface node further includes the step of: If the basic interface node meets the preset reusable component identification conditions and is identified as a reusable component node, then the parent node corresponding to the reusable component node is obtained. Based on the layout parameters, the scaling ratio and translation vector are calculated. The reusable component node is positioned in a compatible manner by adjusting the scaling and position attributes of the parent node, while keeping the internal structure of the child nodes of the reusable component node unchanged.

6. The generation method according to any one of claims 1 to 5, characterized in that, It also includes some or all of the following steps: Obtain the image resources associated with the basic interface node, extract the naming identifier of the image resources, classify the image resources into the corresponding target storage directory based on the naming identifier, perform transparent boundary compensation and nine-grid boundary correction on the classified image resources, and update the reference path of the basic interface node to the image resources. When the layout parameters include control construction parameters, at least one of the slider construction mode, scroll container layout mode, scroll spacing and scroll item size is written into the corresponding basic interface node, and a slider control or scroll control in the target rendering environment is generated according to the control construction parameters during the component binding stage. In the process of generating the target user interface resource, at least one of the interface identifier to be executed, the generation strategy, and the process state is recorded to the editor's persistent storage or session storage. When a domain overload event is detected in the target rendering environment, the corresponding generator is located based on the recorded information and the process is restored to continue running the subsequent resource generation steps.

7. A user interface resource generation apparatus, applied to electronic devices, characterized in that, The generating apparatus includes: The data acquisition module is configured to acquire a layered design file from the source design environment, and structured layout data corresponding to the layered design file. The structured layout data includes the unique layer identifier of each layer in the layered design file and the corresponding layout parameters. The node generation module is configured to parse the layered design file and the structured layout data in the target rendering environment, generate basic interface nodes based on the layered design file, and attach the corresponding unique identifier of the layer to the basic interface nodes. The parameter injection module is configured to inject the layout parameters in the structured layout data into the corresponding basic interface node using the unique identifier of the layer as an index. The layout correction module is configured to perform differential layout correction on the injected layout parameters based on the node type of the base interface node, and generate the target user interface resource.

8. The generating apparatus as claimed in claim 7, characterized in that, It also includes some or all of the following modules: The boundary compensation correction module is configured to obtain the image resources associated with the basic interface node, extract the naming identifier of the image resources, classify the image resources into the corresponding target storage directory based on the naming identifier, perform transparent boundary compensation and nine-grid boundary correction on the classified image resources, and update the reference path of the basic interface node to the image resources. The control construction parameter application module is configured to write at least one of the slider construction mode, scroll container layout mode, scroll spacing and scroll item size into the corresponding basic interface node when the layout parameters include control construction parameters, and generate a slider control or scroll control in the target rendering environment according to the control construction parameters during the component binding stage. The process recovery and continuation module is configured to record at least one of the following in the process of generating the target user interface resources: the interface identifier to be continued, the generation strategy, and the process status, to the editor persistent storage or session storage. When a domain overload event is detected in the target rendering environment, the corresponding generator is located based on the recorded information and the process is restored to continue running the subsequent resource generation steps.

9. An electronic device, characterized in that, It includes at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs or instructions; The processor is used to execute the computer program or instructions to enable the electronic device to implement the generation method as described in any one of claims 1 to 6.

10. A computer-readable storage medium for use in electronic devices, characterized in that, The storage medium carries one or more computer programs that can be executed by the processor, thereby enabling the electronic device to implement the generation method as described in any one of claims 1 to 6.