Page code file generation method, storage medium and electronic device
By extracting and integrating page design data and visual semantic features to generate engineering code files, the problem of manual reliance in converting DSL into engineering code files is solved, achieving efficient and accurate automated code generation.
Patent Information
- Application Number
- CN202611141876.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-30
- Publication Date
- 2026-11-24
AI Technical Summary
In existing technologies, converting DSL into engineering code files requires manual processing or a combination of manual and semi-automatic generation, resulting in high labor and time costs, and low reliability of the generated code files.
By acquiring the page design data and screenshots of the target display page, the layer data features and visual semantic features of the controls are extracted, fused into the fusion features of the controls, and mapped to the matching control frame to generate the project code file.
It enables the automated generation of project code files without human intervention, improving the accuracy of generated code and saving time and labor costs.
Smart Images

Figure CN123157262A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer-aided design and code generation technology, and in particular to a method for generating code files for web pages, a storage medium, and an electronic device. Background Technology
[0002] The page design data displayed on the page (such as MasterGo design drafts) accurately records numerical information such as the position, size, color, and text content of each layer on the page, while preserving the hierarchical relationship between elements and component links. This allows it to provide designers with a "smart canvas" for creation and collaboration, and can also be directly read and parsed by machines through standardized interfaces such as the Model Context Protocol Interface (MCP) (Minecraft Coder Pack).
[0003] Understandably, page design data can precisely describe the deterministic attributes of layers, such as position, size, and color values, in a structured manner, making it theoretically feasible for machines to parse and convert it into a code skeleton. However, the inherent limitation of page design data for displaying pages lies in the incompleteness of its descriptive dimensions: on the one hand, it lacks the ability to encode the sensory semantics in the visual presentation layer, such as the "lightness" of diffused shadows, the spatial transition rhythm of multi-color gradients, or the dynamic interactive semantics such as the timing feedback of button presses and hovers. This information is usually simplified to static parameters or even completely lost in the page design data for displaying pages; on the other hand, DSL only carries the visual results but does not establish a mapping contract from visual elements to the target platform component library (engineering interface)—that is, it lacks the conversion rules from "visual features (such as rounded corner capsules + brand colors)" to "component attributes." Thus, converting DSL into engineering code files requires manual processing or semi-manual + semi-automatic generation, resulting in high labor and time costs and low reliability of the obtained engineering code files. Summary of the Invention
[0004] This application provides a method for generating code files for web pages, a storage medium, and an electronic device to solve the problems in the prior art where converting DSL into engineering code files requires manual processing or a combination of manual and semi-automatic generation, resulting in high labor and time costs and low reliability of the obtained engineering code files.
[0005] Firstly, this application provides a method for generating a page's code file, the method comprising: Obtain the page design data of the target display page and a screenshot of the target display page; For each control in the target display page, extract the layer data features of the control from the page design data, and identify the visual semantic features of the control from the screenshot; For each control, the layer data features and visual semantic features of the control are concatenated to obtain the fused features of the control; The fusion feature of each control is mapped to a control frame that matches the fusion feature of the control to obtain the instance data of each control after mapping. Based on the instance data of each of the controls, the project code file for the target display page is generated.
[0006] In some implementations, mapping the blending feature of each of the controls to a control frame that matches the blending feature of the control includes: For each control, a control framework that matches the fusion characteristics of the control is selected from a preset control framework library; The fusion feature of each control is mapped to a control frame that matches the fusion feature of the control.
[0007] In some implementations, the control framework library includes an enterprise standard control framework library, and for each control, selecting a control framework from the preset control framework library that matches the fusion characteristics of the control includes: For each of the controls, determine from the enterprise standard control framework library whether there exists a control framework that matches the fusion features of the control; If it exists, then select a control framework from the enterprise standard control framework library that matches the fusion features of the control.
[0008] In some implementations, the fusion feature of each control includes multiple dimensions of control attribute parameters, and the control framework includes multiple dimensions of control attribute parameters. For each control, determining whether a control framework matching the fusion feature of the control exists from the enterprise standard control framework library includes: For any one of the controls, a matching score for each dimension is determined based on the control attribute parameters of each dimension of the control and the corresponding control attribute parameters of any control framework in the enterprise standard control framework library. The matching scores of each dimension are summed to obtain the overall matching score; If the overall matching score is greater than a set first score threshold, it is determined that there exists a control frame that matches the fusion feature of the control. If the overall matching score is less than a set second score threshold, it is determined that there is no control frame that matches the fusion feature of the control, wherein the second score threshold is less than the first score threshold.
[0009] In some implementations, after obtaining the overall matching score, the method further includes: If the overall matching score of any of the controls is greater than or equal to a set second score threshold and less than or equal to a first score threshold, a confirmation message is output. The confirmation message includes the name of the control and its overall matching score, as well as a prompt message indicating that the user needs to confirm whether there is a control frame that matches the fusion feature of the control. In response to the user's confirmation instruction on the prompt information, it is determined that there exists a control frame that matches the fusion characteristics of the control; Alternatively, in response to a negative instruction input by the user in the prompt information, it can be determined that there is no control frame that matches the fusion feature of the control.
[0010] In some implementations, determining the matching score for each dimension of any given control, based on the control attribute parameters of each dimension of the control and the corresponding dimension's control attribute parameters of any control framework in the enterprise standard control framework library, includes: For any one of the controls, determine the similarity between the control attribute parameters of each dimension of the control and the control attribute parameters of the corresponding dimension of any control framework in the enterprise standard control framework library; For each dimension, the matching score of the dimension is found from a preset mapping table based on the similarity associated with the dimension.
[0011] In some implementations, determining the matching score for each dimension of any given control, based on the control attribute parameters of each dimension of the control and the corresponding dimension's control attribute parameters of any control framework in the enterprise standard control framework library, includes: For any of the controls, determine whether the control attribute parameters of each dimension of the control are the same as the control attribute parameters of the corresponding dimension of any control framework in the enterprise standard control framework library; If any dimension of the control's attribute parameter is the same as the corresponding dimension of any control frame, then the matching score is determined from a preset mapping table based on the dimension of the same control attribute parameter.
[0012] In some implementations, the control framework library includes a native control framework library. After determining, for each control, whether a control framework matching the fusion characteristics of the control exists from a preset enterprise standard control framework library, the method further includes: If it does not exist, a control framework that matches the fusion features of the control will be selected from the native control framework library.
[0013] In some implementations, after generating the project code file for the target display page, the method further includes: The project configuration file in the project code file records the control framework library and dependency declarations to which the control framework that matches the fusion characteristics of each control belongs.
[0014] In some implementations, the method of generating the project code file of the target display page based on instance data of each of the controls further includes: Output matching description information for the matched control frames; Receive confirmation from the user regarding the matching description information.
[0015] In some implementations, the matching description information includes a matching result to be confirmed, and before receiving a user's confirmation instruction for the matching description information, the method further includes: Receive a user's instruction to modify the pending matching result of the matching description information, and modify the matching result.
[0016] In some implementations, the matching description information includes at least one or more of the following: The target display page's overview information; Page layout scheme; A control mapping list, wherein the control mapping list includes the identifier of each control and the identifier of the matching control frame; The control mapping list contains the identifiers of control frames from the native control framework library and descriptions of control frames that match the native control framework library. Matching results pending confirmation.
[0017] In some implementations, for each of the controls, the matched control frame includes a control frame for daytime mode and a control frame for nighttime mode, and the instance data of the control includes control instance data for daytime mode and instance data for nighttime mode. The generated project code file for the target display page includes: a project code file for the daytime mode of the target display page, a project code file for the nighttime mode, and a code file for periodically switching between the project code file for the daytime mode and the project code file for the nighttime mode.
[0018] In some implementations, the target display pages include multiple pages, and each target display page corresponds to a generated project code file.
[0019] In some implementations, obtaining the page design data of the target display page and a screenshot of the target display page includes: The dialog interface of the intelligent programming assistant is displayed, and the dialog interface includes an input box; Receive the link and screenshot of the target display page entered by the user in the input box; In response to the user's confirmation instruction for the link and screenshot entered in the input box, the page design data associated with the link and the screenshot of the target display page are obtained.
[0020] In some implementations, the project code file for generating the target display page includes: Generate the project code file for the target display page in Java or Compose format.
[0021] In some implementations, the method for generating the project code file for the target display page includes: Generate the project code file for the target display page to run on Android, iOS, or web platforms.
[0022] In some implementations, identifying the visual semantic features of each control in the screenshot includes: Based on an image recognition engine or a pre-trained image recognition network model, identify the visual semantic features of each control in the screenshot.
[0023] In a second aspect, this application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the electronic device performs the method provided in the first aspect of this application.
[0024] Thirdly, this application also provides a storage medium storing a computer program, which, when executed by a processor, causes the computer to perform the method provided in the first aspect of this application.
[0025] Fourthly, this application also provides a computer program product, including a computer program that, when run, causes an electronic device to perform the method provided in the first aspect of this application.
[0026] Fifthly, this application also provides a page code file generation apparatus, configured in an electronic device, according to embodiments of this application. The apparatus provided in embodiments of this application includes a data acquisition unit, a data extraction unit, a feature fusion unit, a feature mapping unit, and a code generation unit, wherein... The data acquisition unit is used to acquire the page design data of the target display page and screenshots of the target display page; The data extraction unit is used to extract the layer data features of each control in the target display page from the page design data, and to identify the visual semantic features of the control from the screenshot; The feature fusion unit is used to combine the layer data features and visual semantic features of each control to obtain the fused features of the control. The feature mapping unit is used to map the fusion feature of each control to a control frame that matches the fusion feature of the control, so as to obtain the instance data of each control after mapping. The code generation unit is used to generate the project code file for the target display page based on the instance data of each control.
[0027] Compared to existing technologies, this application offers the following advantages: This application provides a method for generating page code files, a storage medium, and an electronic device. It acquires page design data and a screenshot of the target display page. For each control in the target display page, it extracts the layer data features of the control from the page design data and identifies the visual semantic features of the control from the screenshot. For each control, it concatenates the layer data features and visual semantic features to obtain the control's fused features. Thus, the fused features can characterize not only the structural numerical features of the control (such as color, shape, size, and position) but also the visual semantics of the control (such as the control's function and dynamic effects).
[0028] Furthermore, the fusion features of each control are mapped to a control frame that matches the fusion features of that control, resulting in the mapped instance data of each control. In this way, based on the fusion features of the controls, the component attributes (i.e., the control frame) of each control are determined, thus automatically obtaining the instance data of each control. Since the fusion features can characterize not only the structural numerical features of the control but also its visual semantics, the accuracy of the mapped instance data of each control is high.
[0029] Finally, the project code file for the target display page can be generated based on the instance data of each control. This can be done automatically without relying on manual labor, saving time and manpower costs, and with high accuracy. Attached Figure Description
[0030] 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 some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0031] Figure 1 This is a schematic diagram illustrating the interaction between the server and the terminal device provided in an embodiment of this application; Figure 2A flowchart illustrating the method for generating code files for pages provided in this application embodiment; Figure 3 A schematic diagram of the dialogue interface of the intelligent programming assistant provided in the embodiments of this application; Figure 4 Functional block diagram of the page code file generation device provided in the embodiments of this application; Figure 5 A functional block diagram of the electronic device provided in the embodiments of this application. Detailed Implementation
[0032] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of the embodiments of this application.
[0033] The technical solutions of this application and how they solve the aforementioned technical problems will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0034] This application provides a method for generating a page's code file, applicable to electronic devices. For example... Figure 1 As shown, the electronic device can be, but is not limited to, server 101, which can communicate with terminal device 102 (such as an office computer). Figure 2 As shown, the method provided in this application embodiment includes: S201: Obtain the page design data and screenshot of the target display page 301.
[0035] For example, such as Figure 3As shown, terminal device 102 can display a dialog interface for the intelligent programming assistant, which includes an input box 302. Terminal device 102 receives a link and screenshot of the target display page 301 entered by the user in the input box 302 (e.g., uploading the link and screenshot, or pasting the link and screenshot into the input box 302); in response to the user's confirmation instruction for the link and screenshot entered in the input box 302 (e.g., pressing the "Enter" key in the input box 302), it obtains the page design data associated with the link and a screenshot of the target display page. It should be noted that the screenshot uploaded by the user in the input box 302 is annotated and aligned with the layer position in the DSL to identify gradients, shadows, icon details, and interactive states.
[0036] For example, the page design data is structured page data DSL (Domain-Specific Language).
[0037] Understandably, the aforementioned structured page data DSL means that at page coordinates (30, 456), there exists a rectangular layer with a width of 315 pixels, a height of 48 pixels, a corner radius of 24 pixels, and a background color of brand blue (#1890FF). Inside this layer is a text sublayer containing the text "Login," with a font size of 16 pixels and a white color. Based on this, the system can determine that this is a typical capsule-shaped main button—because its 48-pixel height and 24-pixel corner radius (equal to half its height) form a complete capsule shape, the combination of the brand blue background and white text conforms to the visual characteristics of a "main operation button," and the internal text sublayer provides the button's display text. This structured page data DSL provides precise numerical basis for subsequent component matching (such as mapping to the VCOS PrimaryButton) and code generation (generating the corresponding layout and attributes).
[0038] Additionally, you can obtain the component documentation and page-level configurations corresponding to the page design data. For example, you can obtain the structured page data DSL using MasterGo's Model Context Protocol (MCP) tool's getDsl, obtain the component documentation using MasterGo's MCP tool's getMeta, and obtain the page-level configurations using MasterGo's MCP tool's getComponentLink. The page design data DSL records the precise values of the page design data. For example, the coordinates, width, height, RGBA values of the background color, corner radius, and font size and weight of a control. It constructs the basic skeleton of the page and is the most direct source of values for subsequent code generation (such as HTML / CSS). The component documentation is the design's "control manual." It not only records which control was used (e.g., a button using Ant Design), but more importantly, it provides detailed documentation and attribute definitions for that control. For example, this control supports type="primary" for the primary button and size="large" for a large size. This allows you to specify the corresponding control in the page design data DSL in the code. <button type="primary" size="large">Instead of generating only a rigid style... Page-level configuration refers to the metadata and global settings of the page design data DSL itself. For example, it specifies which project the page design data belongs to (determining which code template to use), whether the canvas is for mobile or web page sizes (determining the type of code framework generated), and whether global color themes or font variables are defined in the file. These provide constraints and context for the generated code. For instance, if the page-level configuration indicates a "mobile project," the generated code file will be a code file for the cross-platform mobile application development framework React Native or a WeChat Mini Program; if the page-level configuration indicates "the project uses a dark theme," the corresponding global style variables will be injected into the code.
[0039] Understandably, the aforementioned MCP provides a universal standard "plug" that allows for the unified and efficient reading of various data from the MasterGo design draft. MCP can parse componentDocumentLinks in the DSL and call getComponentLink as needed to retrieve component documents to supplement the mapping rules.
[0040] S202: For each control in the target display page, extract the layer data features of the control from the page design data, and identify the visual semantic features of the control from the screenshot.
[0041] Specifically, layer data characteristics can include hierarchical structure: the parent-child relationship of a component. For example, a target area contains a "title" and a "button". Style attributes: specific numerical values. For example, width: 120px, height: 48px, corner_radius: 24px (large rounded corners), background: #1890FF (brand blue). Text content: the text in the button, such as "Submit", "Buy Now", and "OK".
[0042] Visual semantic features are qualitative and descriptive information used to supplement the missing "functional description information" in layer data features. Visual semantic features include whether the control is a "button," "input box 302," "card," or "icon"; whether the control is located in the top "navigation" area or the bottom "operation" area; whether the control has a color gradient, shadow, or interactive state. Specifically, a color gradient refers to a smooth transition from one color to another (e.g., from dark blue to light blue), used to create a sense of depth, light, modernity, or brand identity; shadows are the added projections or inner shadows of elements, used to establish visual hierarchy (Z-axis spatial sense) and distinguish between foreground and background. Common shadows include diffuse shadows (soft, with a wide diffusion range, used to create a "floating" feeling) and inner shadows (used to simulate a recessed or sculpted effect); the interactive state of a control refers to the different visual states presented by the control under different operations, such as the default state (Normal), hover state (when the mouse is hovering), pressed state (when the finger / mouse is pressed), and disabled state (when it cannot be operated). Providing clear operation feedback to users, informing them "this control is being operated" and "whether this control is currently available", is the key to improving product usability and the smoothness of the experience.
[0043] It should be noted that the visual semantic features of each control in the screenshot are identified based on the image recognition engine or a pre-trained image recognition network model.
[0044] Specifically, the image recognition network model can be learned by inputting multiple training samples into a deep learning network. The deep learning network can be, but is not limited to, convolutional neural networks (CNNs) and object detection models such as YOLO / Detectron2. Each training sample can be a historical image labeled with historical visual semantic features.
[0045] Furthermore, image recognition engines can use edge detection algorithms to find the precise pixel boundaries (x, y coordinates, width, height) of UI elements in a screenshot, calculate the color histogram of a certain area in the screenshot, and analyze whether its dominant color is cool or warm; analyze texture information to determine whether it is a solid color background or a gradient background; and estimate the blur radius and transparency of shadows through pixel contrast calculations. Moreover, it can supplement "precise numerical values": if the shadow data in the DSL is incomplete, image processing can directly measure specific values such as shadow offset and diffusion radius from the screenshot.
[0046] S203: For each control, combine the layer data features and visual semantic features of the control to obtain the control's fused features.
[0047] For example, each layer's data features and visual semantic features are associated with a location. Layer data features and visual semantic features with the same location can be concatenated to obtain the control's fused features. The layer data features, visual semantic features, and fused features are shown in Table 1 below.
[0048] Table 1
[0049] S204: Map the blending features of each control to a control frame that matches the blending features of the control, and obtain the instance data of each control after mapping.
[0050] Specifically, for each control, a control frame that matches the control's blending characteristics is selected from a preset control frame library; and the blending characteristics of each control are mapped to the control frame that matches the control's blending characteristics.
[0051] Additionally, for each control, it is determined from the enterprise standard control framework library whether a control framework matching the control's blending characteristics exists. The enterprise standard control framework library can be an internal component library (such as VCOS, with the library name com.vcos.common.widgets). For example, the addresses of each control framework in the enterprise standard control framework library can be obtained from a private Maven repository, allowing it to iterate through each control framework in the enterprise standard control framework library. If a matching control framework exists, it is selected from the enterprise standard control framework library that matches the control's blending characteristics.
[0052] It's important to note that the VCOS public control library serves as a vehicle for unified design standards and engineering practices. It encapsulates standard UI components such as buttons, navigation bars, and cards. Each control comes pre-built with a unified visual style, interactive feedback, and accessibility support, ensuring a high degree of visual and experiential consistency across all product interfaces. Developers can directly call these "standardized parts" when building pages, eliminating the need to repeatedly implement basic interaction logic. Furthermore, during brand upgrades or design specification adjustments, global updates can be achieved by modifying the control library's source code, significantly reducing maintenance costs and ensuring consistent user experience. This ensures that all generated pages adhere to the company's unified design standards (such as rounded corners, colors, press feedback, loading status, and accessibility support, all provided by VCOS components), eliminating the need for developers to implement them repeatedly. This not only ensures consistent user experience but also significantly reduces later maintenance costs. Additionally, the control framework library includes a native control framework library; if one does not exist, a control framework matching the control's integration characteristics will be selected from the native control framework library.
[0053] It's important to note that native control framework libraries refer to the collection of basic UI control frameworks provided by the operating system, such as View, Button, and TextView in Android, or UIView, UIButton, and UILabel in iOS. These form the "foundation" for building any application interface, providing the most basic rendering capabilities and interactive responses. However, they do not inherently include any enterprise-specific visual styles or interaction specifications—developers need to manually set colors, fonts, rounded corners, spacing, and other styles, and manually implement interactive behaviors such as press feedback and loading states. Native control framework libraries act as a fallback solution, ensuring that the subsequently generated project code files can display and run correctly.
[0054] Furthermore, the fusion characteristics of each control include multiple dimensions of control attribute parameters, and the control framework also includes multiple dimensions of control attribute parameters. The method described above for determining whether a control framework matches the fusion characteristics of a control can be specifically implemented as follows: Step 1: For any given control, determine the matching score for each dimension by comparing its control attribute parameters for each dimension with the corresponding control attribute parameters for any control framework in the enterprise standard control framework library. For example, dimensions may include the control's layer name, text content, function type, size, and color.
[0055] For example, for any given control, the similarity between the control attribute parameters of each dimension of the control and the corresponding control attribute parameters of any control framework in the enterprise standard control framework library is determined. For each dimension, the matching score of the dimension is found from a preset mapping table based on the similarity associated with the dimension. (For example, if the similarity is 80%, the matching score is 8 points; if the similarity is 70%, the matching score is 7 points.) In some implementations, for any given control, it is determined whether the control attribute parameters of each dimension of the control are the same as the control attribute parameters of the corresponding dimension of any control framework in the enterprise standard control framework library; if the control attribute parameters of any dimension of the control are the same as the control attribute parameters of the corresponding dimension of any control framework, then a matching score is determined from a preset mapping table based on the dimension of the same control attribute parameters.
[0056] For example, identical layer names: +30 points. Identical text content (e.g., both "Submit" or "OK"). Identical function type: e.g., both "Button", 20 points. Matching style attributes: both 48px × 24px in size, 15 points; both background colors are corporate brand blue #1890FF, 15 points; identical position: 10 points; all other dimensions are not completely identical.
[0057] Step 2: Sum the matching scores for each dimension to obtain the overall matching score.
[0058] Based on the above example, the overall matching score is 30+20+15+15+10=90.
[0059] Step 3: If the overall matching score is greater than the set first score threshold (e.g., 85 points), determine that there is a control frame that matches the fusion features of the control.
[0060] Step 4: If the overall matching score is less than the set second score threshold (e.g., 70 points), determine that there is no control frame that matches the fusion feature of the control. The second score threshold is less than the first score threshold.
[0061] Step 5: If the overall matching score of any control is greater than or equal to the set second score threshold and less than or equal to the first score threshold, output confirmation information. The confirmation information includes the name of the control and the overall matching score, as well as a prompt indicating that the user needs to confirm whether there is a control frame that matches the control's fusion characteristics. In response to the user's confirmation instruction on the prompt, determine that there is a control frame that matches the control's fusion characteristics; or in response to the user's negative instruction on the prompt, determine that there is no control frame that matches the control's fusion characteristics.
[0062] S205: Generate the project code file for the target display page 301 based on the instance data of each control.
[0063] Specifically, the contents of the project code files can include `res / layout / *.xml` files, `*.kt` (or Java / Compose) files, and `res / values / *` files. Understandably, `res / layout / *.xml` is the "skeleton" of the page, defining the position and structure of controls on the screen using XML; `*.kt` (or Java / Compose) is the "brain" of the page, responsible for binding data, handling click events, and other logic (if Compose output is selected, the layout and logic are integrated into the `.kt` file); `res / values / *` is the page's "palette," centrally storing constants such as colors (colors.xml), text (strings.xml), and dimensions (dimens.xml), achieving separation of style and structure.
[0064] Specifically, the code generator can generate the project code file for the target 301 page in either Java or Compose format. For example, when selecting Java format, it populates data based on ButtonTemplate.xml.template to generate an XML project code file (such as the *.kt file mentioned above); when selecting Compose format, it populates data based on ButtonTemplate.kt.template to generate a Kotlin Compose project code file (such as the *.kt file mentioned above). For instance, the code generator uses a template engine (such as Mustache / FreeMarker) to render XML and Kotlin files; resources (colors / dimens / styles) are output according to semantic naming rules.
[0065] It's important to note that the generated project code files are a set of ready-to-run page modules. Developers can copy these to the corresponding directory in their project and then, without needing to write layouts and basic interactions from scratch, simply integrate real API data and business logic (such as click navigation and network requests) into the Activity or Fragment to make the page actually run. To use them, simply drag the files res / layout / *.xml, *.kt, res / values / *, etc., into the corresponding directory of your Android Studio project, update the dependencies already configured in build.gradle, and you can compile and run directly.
[0066] In summary, the method for generating a page code file provided in this application involves obtaining page design data and a screenshot of a target display page 301. For each control in the target display page, the layer data features of the control are extracted from the page design data, and the visual semantic features of the control are identified from the screenshot. For each control, the layer data features and visual semantic features of the control are concatenated to obtain the control's fused features. Thus, the fused features can characterize not only the structural numerical features of the control (such as color, shape, size, and position) but also the visual semantics of the control (such as the control's function and dynamic effects).
[0067] Furthermore, the fusion features of each control are mapped to a control frame that matches the fusion features, resulting in the mapped instance data for each control. In this way, based on the fusion features of the controls, the component properties (i.e., the control frame) of each control are determined, thus automatically obtaining the instance data for each control. Because fusion features can characterize not only the structural numerical features of a control but also its visual semantics, the accuracy of the mapped instance data for each control is high.
[0068] Finally, the project code file for the target display page 301 can be generated based on the instance data of each control. This can be done automatically without relying on manual labor, saving time and manpower costs, and with high accuracy.
[0069] Furthermore, following S205 above, the method provided in this application embodiment further includes: outputting matching description information for the matched control frames; and receiving a user's confirmation instruction for the matching description information. Only after receiving the confirmation instruction is the project code file for the target display page 301 generated based on the instance data of each control, which allows the obtained project code file to better meet the user's needs.
[0070] For example, the matching description information includes at least one or more of the following: page overview information of the target display page 301; page layout scheme; control mapping list, wherein the control mapping list includes the identifier of each control and the identifier of the matched control frame; the identifier of the control frame from the native control frame library in the control mapping list, and the description information of the control frame matching the native control frame library; and the matching result to be confirmed.
[0071] Additionally, it can receive user commands to modify the matching results pending confirmation, allowing for adjustments to the matching information. For example, a user can change the matched native control framework library to a control framework library from the enterprise standard control framework library. This improves the accuracy of the subsequently generated code project files.
[0072] For example, the page overview may include: "The design draft is a car music player homepage, a landscape full-screen layout (2268×1156), divided into: left player area (650px wide): music application logo + album cover + song information + lyrics button area + progress bar + playback control buttons right content area (~1412px wide, scrollable): tab navigation bar (My / Recommended / Music Library / High Quality) + search box + horizontal banner carousel (You May Like / 30 Songs Daily / AI DJ / Favorite Songs) + recommended playlist list + chart entry." The matching results to be confirmed may include: "VCOS dependency: No dependency on the Enterprise Standard Control Framework library com.vcos.common.widgets was found in the project. Do you need to add VCOS? If so, please provide the version number. If not, all native Android components will be used. Language selection: The current project is Java. Do you want to keep Java or switch to Kotlin? Image resources: There are album cover, playlist cover, and other image addresses in the DSL. Do you need to download them as local drawable resources, or use placeholder images / colors? Tab text in the screenshot: The screenshot shows "My / Recommended / Music Library / High Quality", but the tab text in the DSL is all displayed as "Options" (placeholder text). Code will be generated according to the actual text in the screenshot. Recommended playlist titles and chart titles in the screenshot: The screenshot shows "Recommended Playlists" and "Charts>", but these title nodes are not included in the DSL (they may be truncated). They will be added according to the screenshot. If you need to modify any of the above parts, please suggest it. After confirmation, enter "Start Generating Code" to generate the code." In addition, the matching information may also include degradation instructions, dimensions and adaptation benchmarks, and key dimension confirmations. The degradation instructions may include the following: "Music logo + dropdown native image view ImageView + text view TextView + image view ImageView;" The VIP tag is a custom drawable object + a TextView. The playback control buttons can display an image using an AppCompatImageButton button and a custom text view drawable. Lyrics / words / standard Tab linear layout container LinearLayout + TextView (simple text labels); The progress bar uses the native SeekBar control plus a custom drag button thumb / background track trackdrawable. The right-side content area can be scrolled using a nested scrollable container (NestedScrollView, if there is no VCOS dependency).
[0073] Furthermore, the dimensions and adaptation criteria may include the following: Explanation of Android values after conversion of project DSL values; Design draft canvas size 2268×1156 — Root node layoutStyle; Design draft baseline width 2268—landscape screen vehicle design; dp conversion ratio—1:1 (DSL unit = dp) default; Font unit — sp —; Target screen resolution: 2268×1156 (in-vehicle landscape mode)
[0074] In addition, key dimension confirmation may include the following: Component DSL dimensions (w×h) converted to (dp) - notes; The root container is 2268×1156 match_parent; The left area has a fixed width of 650×1068650dp×match_parent; Album cover: 470×470 dp with rounded corners, 16dp; Pause button, 120×120dp circular; Previous / Next 72×72 (container) 72×72dp icon area 40×40dp; Tab segment selector: 834.4×88, wrap×88dp, 208.6×88dp per item; Search box 256.8×88 256×88 dp —; Banner card 256.8×220 dp, rounded corners 28 dp; Playlist cover: 256.8×256.8 dp (256×256 dp) with rounded corners (28 dp). The progress bar track is 618×6 match_parent×6dp with rounded corners. In addition, after S205 above, the method provided in this application embodiment further includes: recording the control framework library and dependency declaration of the control framework that matches the fusion features of each control in the project configuration file of the project code file.
[0075] For example, in the root build.gradle repositories, write: `maven {allowInsecureProtocol true; url='http: / / 10.223.105.162:8084 / repository / voyah-snapshots / ; credentials{username 'nexus_dn'; password 'nexus123'}}`.
[0076] In this way, the project's build configuration file (app / build.gradle) is automatically modified while generating the project code files, ensuring that all external dependencies are correctly pulled, making the generated code "run out of the box". Specifically, firstly, it adds the Maven repository configuration, that is, adds the address of the company's private Maven repository (such as maven { url 'https: / / repo.yourcompany.com / vcos'}) to the repositories block; secondly, it adds dependency declarations, that is, adds statements such as implementation 'com.yourcompany:vcos:2.1.0' to the dependencies block, explicitly telling Gradle "which specific libraries need to be downloaded", so that developers do not need to manually configure any dependencies, and can directly click "run" to successfully compile, greatly shortening the configuration time from code generation to actual operation.
[0077] It should be noted that the aforementioned target display page 301 includes multiple pages, and each target display page 301 corresponds to a generated project code file. For example, the input box 302 supports receiving multiple shortLinks (page addresses) or fileId+layerIds (i.e., page identifiers) at once, and outputs independent layouts and Activities / Fragments by page grouping. To prevent excessively long contexts, the number of target display pages 301 will not exceed 3 or 4. This improves the efficiency of generating project code files and further saves time.
[0078] Furthermore, for each control, the matched control framework includes both daytime mode and nighttime mode control frameworks, and the control instance data includes both daytime mode and nighttime mode control instance data. Therefore, the generated project code file for the target display page 301 includes: the daytime mode project code file for the target display page 301, the nighttime mode project code file, and a code file used for periodically switching between the daytime and nighttime mode project code files (e.g., using the UiMode-aware container and the theme resource path provided by VCOS to generate nighttime resources and map interactive effects, such as press, hover, or loading effects). This allows for consistent implementation of dark mode, UiMode-aware controls, and interactive effects.
[0079] Specifically, the aforementioned UiMode-aware container is a configuration object (Configuration.UI_MODE_NIGHT_YES / NO) provided by the Android system, which can sense the time to determine whether it is in "day mode" or "night mode". In the generated code file, a UiMode-aware container (such as an Activity or a custom ThemeWrapper) is created. When switching modes, this UiMode-aware container captures the change and triggers a UI redraw. Furthermore, the theme resource path provided by VCS specifies where all colors, images, and other resources should be placed and how they should be named in night mode. For example, in day mode, the main button background color references @color / primary_blue_day; while in night mode, it automatically references @color / primary_blue_night. This resource with the _night suffix is pointed to through the "theme resource path".
[0080] For example, in daytime mode, the button dims by 20% when pressed (color_pressed_day); in nighttime mode, the button brightens by 20% when pressed (color_pressed_night), because brightening against a dark background simulates the feeling of "pressing." Hover (commonly used for mouse operations): Daytime mode adds a light-colored overlay; nighttime mode adds a highlighted outline to avoid adding more gray to the dark background and making it difficult to see. Loading: Daytime mode uses a dark spinning circle animation; nighttime mode automatically changes to a light-colored spinning circle to ensure clear visibility against any background.
[0081] Additionally, it can generate project code files for the target display page (301 redirect) to run on Android, iOS, or web platforms. For example, for Android, it outputs the UI layout file res / layout / *.xml, Kotlin source code files *.kt, and the project build configuration file build.gradle; for iOS (SwiftUI), it outputs the source code files *.swift and the configuration file Package.swift; and for web (React), it outputs the control source code files *.jsx / *.tsx and the project configuration file package.json. These files contain the page structure, component mappings, style constants, and dependency declarations. After integrating them into the corresponding platform's project, developers can obtain a working page that matches the design and conforms to the native development specifications of each platform without having to code from scratch.
[0082] In addition, such as Figure 4 As shown, this application embodiment also provides a page code file generation device, configured in an electronic device. It should be noted that the basic principle and technical effects of the page code file generation device provided in this application embodiment are the same as those in the above embodiments. For the sake of brevity, any parts not mentioned in this application embodiment can be referred to the corresponding content in the above embodiments. The device provided in this application embodiment includes a data acquisition unit, a data extraction unit, a feature fusion unit, a feature mapping unit, and a code generation unit, wherein... The data acquisition unit is used to acquire the page design data of the target display page 301 and a screenshot of the target display page 301; The data extraction unit is used to extract the layer data features of each control in the target display page from the page design data, and to identify the visual semantic features of the control from the screenshot; The feature fusion unit is used to combine the layer data features and visual semantic features of each control to obtain the fused features of the control. The feature mapping unit is used to map the fusion feature of each control to a control frame that matches the fusion feature of the control, so as to obtain the instance data of each control after mapping. The code generation unit is used to generate the project code file for the target display page 301 based on the instance data of each control.
[0083] In some implementations, the feature mapping unit is specifically used to select, for each control, a control frame that matches the fusion feature of the control from a preset control frame library; and to map the fusion feature of each control to the control frame that matches the fusion feature of the control.
[0084] In some implementations, the control framework library includes an enterprise standard control framework library and a feature mapping unit, specifically used to determine, for each control, whether there exists a control framework in the enterprise standard control framework library that matches the control's fusion features; if so, to select a control framework in the enterprise standard control framework library that matches the control's fusion features.
[0085] In some implementations, the fusion feature of each control includes control attribute parameters in multiple dimensions, the control framework includes control attribute parameters in multiple dimensions, and the feature mapping unit is specifically used to determine the matching score for each dimension of any control based on the control attribute parameters of each dimension of the control and the corresponding dimension of the control attribute parameters of any control framework in the enterprise standard control framework library; sum the matching scores of each dimension to obtain a comprehensive matching score; if the comprehensive matching score is greater than a set first score threshold, it is determined that there exists a control framework that matches the fusion feature of the control; if the comprehensive matching score is less than a set second score threshold, it is determined that there is no control framework that matches the fusion feature of the control, wherein the second score threshold is less than the first score threshold.
[0086] In some embodiments, the apparatus provided in this application further includes: an information output unit, configured to output confirmation information when the overall matching score of any control is greater than or equal to a set second score threshold and less than or equal to a first score threshold, the confirmation information including the name of the control and the overall matching score, and a prompt message indicating that the user needs to confirm whether there is a control frame that matches the fusion feature of the control; The feature mapping unit is also used to determine, in response to a user's confirmation instruction to the input of a prompt message, that there exists a control frame that matches the blending features of the control; or to determine, in response to a user's negative instruction to the input of a prompt message, that there does not exist a control frame that matches the blending features of the control.
[0087] In some implementations, the feature mapping unit is specifically used to determine, for any given control, the similarity between the control attribute parameters of each dimension of the control and the control attribute parameters of the corresponding dimension of any control framework in the enterprise standard control framework library; for each dimension, the matching score of the dimension is found from a preset mapping relationship table based on the similarity associated with the dimension.
[0088] In some implementations, the feature mapping unit is specifically used to determine, for any given control, whether the control attribute parameters of each dimension of the control are the same as the control attribute parameters of the corresponding dimension of any control framework in the enterprise standard control framework library; if the control attribute parameters of any dimension of the control are the same as the control attribute parameters of the corresponding dimension of any control framework, then a matching score is determined from a preset mapping table based on the dimension of the same control attribute parameters.
[0089] In some implementations, the control framework library includes a native control framework library and a feature mapping unit, specifically used to select a control framework from the native control framework library that matches the fusion features of the control if the feature does not exist.
[0090] In some embodiments, the apparatus provided in this application further includes: an information configuration unit, used to record in the project configuration file of the project code file the control framework library to which the control framework that matches the fusion features of each control belongs and its dependency declarations.
[0091] In some embodiments, the apparatus of this application further includes: an information output unit for outputting matching description information for the matched control frame; and an information receiving unit for receiving a user's confirmation instruction for the matching description information.
[0092] In some implementations, the matching description information includes the matching result to be confirmed. The apparatus in this application embodiment further includes: The information receiving unit is used to receive the user's modification instruction for the unconfirmed matching result of the matching description information, and to modify the matching result.
[0093] In some implementations, the matching description information includes at least one or more of the following: The target page displays a page overview information for page 301; Page layout scheme; A control mapping list, which includes the identifier of each control and the identifier of the matching control frame; The control mapping list contains the identifiers of control frames from the native control framework library, and descriptions of the control frames that match the native control framework library. Matching results pending confirmation.
[0094] In some implementations, for each control, the matched control frame includes a control frame for daytime mode and a control frame for nighttime mode, and the instance data of the control includes control instance data for daytime mode and instance data for nighttime mode; then the generated project code file of the target display page 301 includes: the project code file of the target display page 301 for daytime mode, the project code file for nighttime mode, and a code file for periodically switching between the project code file for daytime mode and the project code file for nighttime mode.
[0095] In some implementations, there are multiple target display pages 301, and each target display page 301 corresponds to a generated project code file.
[0096] In some implementations, the data acquisition unit is specifically used to display the dialogue interface of the intelligent programming assistant, the dialogue interface including an input box 302; receive a link and screenshot of the target display page 301 entered by the user in the input box 302; and in response to the user's confirmation instruction on the link and screenshot entered in the input box 302, acquire the page design data associated with the link.
[0097] In some implementations, the code generation unit is specifically used to generate the project code file for the target display page 301 in Java or Compose format.
[0098] In some implementations, the code generation unit is specifically used to generate project code files for the target display page 301 to run on an Android platform, an iOS platform, or a web platform.
[0099] In some implementations, the data extraction unit is specifically used to identify the visual semantic features of each control in the screenshot based on an image recognition engine or a pre-trained image recognition network model.
[0100] Figure 5 This is a schematic diagram of the structure of an electronic device provided in one embodiment of this application. Please refer to... Figure 5 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and memory. The memory may include main memory, such as high-speed random-access memory (RAM), or non-volatile memory, such as at least one disk drive. Of course, the electronic device may also include other hardware required for other business operations.
[0101] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 5 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0102] Memory is used to store programs. Specifically, programs may include program code, which includes computer operation instructions. Memory may include main memory and non-volatile memory, and provides instructions and data to the processor.
[0103] The processor reads the corresponding computer program from non-volatile memory into memory and then runs it, forming a code file generation device for pages at the logical level. The processor executes the program stored in memory and performs the method provided in the above embodiments of this application. For example, it performs the following: acquiring page design data of a target display page and a screenshot of the target display page; extracting layer data features of each control in the page design data and identifying the visual semantic features of each control in the screenshot; for each control, concatenating the layer data features and visual semantic features of the control to obtain the fusion feature of the control; mapping the fusion feature of each control to a control frame that matches the fusion feature of the control to obtain the mapped instance data of each control; and generating the project code file of the target display page based on the instance data of each control.
[0104] The methods described in the embodiments of this application can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.
[0105] The electronic device can also perform Figure 2 The method, and implement the page code file generation device in Figure 2 The functions of the embodiments shown are not described again in this application.
[0106] Of course, in addition to the software implementation, the electronic device in the embodiments of this application does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc. That is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0107] Furthermore, this application also proposes a storage medium that stores one or more programs, each program including instructions that, when executed by an electronic device comprising multiple applications, enable the electronic device to perform the methods provided in the above embodiments of this application. For example, the methods include: acquiring page design data of a target display page and a screenshot of the target display page; extracting layer data features of each control in the page design data and identifying visual semantic features of each control in the screenshot; for each control, concatenating the layer data features and visual semantic features of the control to obtain a fusion feature of the control; mapping the fusion feature of each control to a control frame matching the fusion feature of the control to obtain mapped instance data of each control; and generating the project code file of the target display page based on the instance data of each control.
[0108] Specifically, storage media, including permanent and non-permanent, removable and non-removable media, can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.
[0109] In addition, this application also provides a computer program product, including a computer program that, when run, causes an electronic device to perform the methods provided in the above embodiments of this application.
[0110] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover 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 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.
[0111] In summary, the above descriptions are merely preferred embodiments of this application and are not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application. < / button>
Claims
1. A method for generating a page's code file, characterized in that, The method includes: Obtain the page design data of the target display page and a screenshot of the target display page; For each control in the target display page, extract the layer data features of the control from the page design data, and identify the visual semantic features of the control from the screenshot; For each control, the layer data features and visual semantic features of the control are concatenated to obtain the fused features of the control; The fusion feature of each control is mapped to a control frame that matches the fusion feature of the control to obtain the instance data of each control after mapping. Based on the instance data of each of the controls, the project code file for the target display page is generated.
2. The method according to claim 1, characterized in that, The step of mapping the fusion feature of each control to a control frame that matches the fusion feature of the control includes: For each control, a control framework that matches the fusion characteristics of the control is selected from a preset control framework library; The fusion feature of each control is mapped to a control frame that matches the fusion feature of the control.
3. The method according to claim 2, characterized in that, The control framework library includes an enterprise standard control framework library. For each control, selecting a control framework from the preset control framework library that matches the integration features of the control includes: For each of the controls, determine from the enterprise standard control framework library whether there exists a control framework that matches the fusion features of the control; If it exists, then select a control framework from the enterprise standard control framework library that matches the fusion features of the control.
4. The method according to claim 3, characterized in that, The fusion feature of each control includes multiple dimensions of control attribute parameters, and the control framework includes multiple dimensions of control attribute parameters. For each control, determining whether a control framework matching the fusion feature exists from the enterprise standard control framework library includes: For any one of the controls, a matching score for each dimension is determined based on the control attribute parameters of each dimension of the control and the corresponding control attribute parameters of any control framework in the enterprise standard control framework library. The matching scores of each dimension are summed to obtain the overall matching score; If the overall matching score is greater than a set first score threshold, it is determined that there exists a control frame that matches the fusion feature of the control. If the overall matching score is less than a set second score threshold, it is determined that there is no control frame that matches the fusion feature of the control, wherein the second score threshold is less than the first score threshold.
5. The method according to claim 4, characterized in that, After obtaining the overall matching score, the method further includes: If the overall matching score of any of the controls is greater than or equal to a set second score threshold and less than or equal to a first score threshold, a confirmation message is output. The confirmation message includes the name of the control and its overall matching score, as well as a prompt message indicating that the user needs to confirm whether there is a control frame that matches the fusion feature of the control. In response to the user's confirmation instruction on the prompt information, it is determined that there exists a control frame that matches the fusion characteristics of the control; Alternatively, in response to a negative instruction input by the user in the prompt information, it can be determined that there is no control frame that matches the fusion feature of the control.
6. The method according to claim 4, characterized in that, For any one of the controls, the matching score for each dimension is determined based on the control attribute parameters of each dimension of the control and the corresponding control attribute parameters of any control framework in the enterprise standard control framework library, including: For any one of the controls, determine the similarity between the control attribute parameters of each dimension of the control and the control attribute parameters of the corresponding dimension of any control framework in the enterprise standard control framework library; For each dimension, the matching score of the dimension is found from a preset mapping table based on the similarity associated with the dimension.
7. The method according to claim 4, characterized in that, For any one of the controls, the matching score for each dimension is determined based on the control attribute parameters of each dimension of the control and the corresponding control attribute parameters of any control framework in the enterprise standard control framework library, including: For any of the controls, determine whether the control attribute parameters of each dimension of the control are the same as the control attribute parameters of the corresponding dimension of any control framework in the enterprise standard control framework library; If any dimension of the control's attribute parameter is the same as the corresponding dimension of any control frame, then the matching score is determined from a preset mapping table based on the dimension of the same control attribute parameter.
8. The method according to claim 3, characterized in that, The control framework library includes a native control framework library. After determining, for each control, whether a control framework matching the integration features of the control exists from a preset enterprise standard control framework library, the method further includes: If it does not exist, a control framework that matches the fusion features of the control will be selected from the native control framework library.
9. The method according to claim 2, characterized in that, After generating the project code file for the target display page, the method further includes: The project configuration file in the project code file records the control framework library and dependency declarations to which the control framework that matches the fusion characteristics of each control belongs.
10. The method according to claim 1, characterized in that, The method for generating the project code file of the target display page based on the instance data of each of the controls further includes: Output matching description information for the matched control frames; Receive confirmation from the user regarding the matching description information.
11. The method according to claim 10, characterized in that, The matching description information includes the matching result to be confirmed. Before receiving the user's confirmation instruction for the matching description information, the method further includes: Receive a user's instruction to modify the pending matching result of the matching description information, and modify the matching result.
12. The method according to claim 10, characterized in that, The matching description information includes at least one or more of the following: The target display page's overview information; Page layout scheme; A control mapping list, wherein the control mapping list includes the identifier of each control and the identifier of the matching control frame; The control mapping list contains the identifiers of control frames from the native control framework library and descriptions of control frames that match the native control framework library. Matching results pending confirmation.
13. The method according to claim 1, characterized in that, For each of the controls, the matching control frames include control frames for daytime mode and control frames for nighttime mode, and the instance data of the controls includes control instance data for daytime mode and instance data for nighttime mode. The generated project code file for the target display page includes: a project code file for the daytime mode of the target display page, a project code file for the nighttime mode, and a code file for periodically switching between the project code file for the daytime mode and the project code file for the nighttime mode.
14. The method according to claim 1, characterized in that, The target display page includes multiple pages, and each target display page corresponds to a generated project code file.
15. The method according to claim 1, characterized in that, The acquisition of the page design data of the target display page and the screenshot of the target display page includes: The dialog interface of the intelligent programming assistant is displayed, and the dialog interface includes an input box; Receive the link and screenshot of the target display page entered by the user in the input box; In response to the user's confirmation instruction for the link and screenshot entered in the input box, the page design data associated with the link and the screenshot of the target display page are obtained.
16. The method according to any one of claims 1-15, characterized in that, The project code file that generates the target display page includes: Generate the project code file for the target display page in Java or Compose format.
17. The method according to any one of claims 1-15, characterized in that, The identification of the visual semantic features of each control in the screenshot includes: Based on an image recognition engine or a pre-trained image recognition network model, identify the visual semantic features of each control in the screenshot.
18. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, it causes the electronic device to perform the method provided in any one of claims 1-17.
19. A storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, causes the computer to perform the method provided as claimed in any one of claims 1-17.
20. A computer program product, comprising a computer program, characterized in that, When a computer program is run, it causes an electronic device to perform the method as claimed in any one of claims 1 to 17.
