Search

CN-122018877-A - Page code generation method and device, electronic equipment, storage medium and product

CN122018877ACN 122018877 ACN122018877 ACN 122018877ACN-122018877-A

Abstract

The application relates to a page code generation method, a page code generation device, electronic equipment, a storage medium and a product. The method comprises the steps of determining at least one current local blueprint from page blueprints indicating target pages, predicting target logic codes corresponding to the current local blueprint by using a target large language model aiming at each current local blueprint, wherein the target logic codes are used for representing trigger conditions which are required to be met by a plurality of service components respectively, generating page codes corresponding to the current local blueprint aiming at each current local blueprint based on the target logic codes and page description information of the service components, determining the page description information based on visual objects corresponding to the service components, and obtaining the page codes corresponding to the page blueprint based on the page codes corresponding to the at least one current local blueprint. The application provides a page code generation scheme with higher efficiency and convenience.

Inventors

  • CAI LIDAN
  • AN TIANLU
  • Ou Dongni
  • YANG JIALU
  • LI LANHUI
  • CAO HONG
  • YANG HUI
  • FAN KE
  • SU JINSHENG
  • DENG JIANWEI
  • WANG YONGQI

Assignees

  • 腾讯科技(深圳)有限公司

Dates

Publication Date
20260512
Application Date
20241112

Claims (11)

  1. 1. A method for generating a page code, applied to a target platform, the method comprising: Determining at least one current local blueprint from a page blueprint indicating a target page, wherein the current local blueprint comprises at least one visual object; Predicting a target logic code corresponding to the current local blueprint by utilizing a target large language model aiming at each current local blueprint, wherein the target logic code is used for representing a triggering condition which is required to be met by triggering a plurality of service components respectively, and the plurality of service components are determined based on a service scene supported by the at least one visual object; Generating a page code corresponding to the current local blueprint based on the target logic code and page description information of each of the plurality of service components, wherein the page description information is determined based on the visual object corresponding to the service component; and obtaining the page codes corresponding to the page blueprints based on the page codes corresponding to the at least one current local blueprint.
  2. 2. The method of claim 1, wherein the target logic code includes at least one event code set, the event code set indicates the trigger condition corresponding to the service component, the page description information includes an interface code indicating a style and a location of the service component, and the generating the page code corresponding to the current local blueprint based on the target logic code and the page description information of each of the plurality of service components includes: For each service component, establishing a binding relation between the interface code and the event code set based on service component identification by using a dynamic engine to obtain a binding relation set corresponding to the plurality of service components; And fusing the page description information of each of the plurality of business components and the target logic code based on the binding relation group by using the dynamic engine so as to obtain the page code corresponding to the current local blueprint.
  3. 3. The method of claim 1, wherein after determining at least one current local blueprint from the blueprints indicating the target page, the method further comprises: determining a target historical local blueprint matched with the current local blueprint from a plurality of historical local blueprints; And adjusting the page codes corresponding to the target historical local blueprint to adapt to the current local blueprint so as to obtain the page codes corresponding to the current local blueprint.
  4. 4. The method of claim 3, wherein the determining a target historical local blueprint from a plurality of historical local blueprints that matches the current local blueprint comprises: Displaying a local blueprint processing interface, wherein the local blueprint processing interface comprises a first area and a second area, the first area displays the current local blueprint, the second area displays at least one candidate historical local blueprint, and the candidate historical local blueprint is a local blueprint with similarity with the current local blueprint being greater than a preset similarity in the plurality of historical local blueprints; In response to a selection operation for the second region, it is determined that the selected candidate historical local blueprint is the target historical local blueprint.
  5. 5. The method according to claim 1, wherein the method further comprises: displaying an interface diagram creation interface, wherein the interface diagram creation interface comprises a component display area and a component editing area, and a display item of the component display area comprises a plurality of preset components; when a drag operation for a candidate component is detected and a first destination position of the drag operation is located in the component editing area, displaying a mirror image component corresponding to the candidate component in a second destination position of the component editing area, wherein the candidate component is any component in the plurality of preset components, and the second destination position is determined based on the first destination position and the current component layout condition in the component editing area; Taking each current component in the component editing area as one business component, and generating an interface diagram adapting to the current local blueprint; the predicting the target logic code corresponding to the current local blueprint by using the target large language model comprises the step of predicting the target logic code by using the target large language model.
  6. 6. The method according to claim 1 or 2, wherein after determining at least one current local blueprint from the blueprints indicating the target page, the method further comprises: Acquiring target logic information sent by a target object; generating candidate codes representing the target logic information; and converting the candidate codes based on preset rules to obtain the target logic codes, wherein the target logic codes adopt a domain-specific programming language.
  7. 7. The method of claim 6, wherein after the obtaining the target logic information sent by the target object, the method further comprises: determining second logic information matched with the target logic information from a plurality of first logic information, wherein the plurality of first logic information corresponds to a plurality of historical local blueprints; And determining the logic code corresponding to the second logic information as the target logic code.
  8. 8. A page code generating apparatus, configured on a target platform, the apparatus comprising: The local blueprint determining module is used for determining at least one current local blueprint from the page blueprint indicating the target page, wherein the current local blueprint comprises at least one visual object; The logic code prediction module is used for predicting target logic codes corresponding to the current local blueprints by utilizing a target large language model aiming at each current local blueprint, wherein the target logic codes are used for representing trigger conditions which are required to be met by triggering a plurality of service components respectively, and the plurality of service components are determined based on service scenes supported by the at least one visual object; The local page code generation module is used for generating a page code corresponding to each current local blueprint based on the target logic code and page description information of each of the plurality of service components, wherein the page description information is determined based on the visual object corresponding to the service component; And the global page code obtaining module is used for obtaining the page codes corresponding to the page blueprints based on the page codes corresponding to the at least one current local blueprint.
  9. 9. An electronic device comprising at least one processor and a memory communicatively coupled to the at least one processor, wherein the memory stores at least one instruction or at least one program that is loaded and executed by the at least one processor to implement the page code generation method of any of claims 1-7.
  10. 10. A computer readable storage medium having stored therein at least one instruction or at least one program loaded and executed by a processor to implement the page code generation method of any of claims 1-7.
  11. 11. A computer program product comprising at least one instruction or at least one program loaded and executed by a processor to implement the page code generation method of any of claims 1-7.

Description

Page code generation method and device, electronic equipment, storage medium and product Technical Field The present application relates to the field of internet communications technologies, and in particular, to a method and apparatus for generating a page code, an electronic device, a storage medium, and a product. Background With the rapid development of internet communication technology, more and more business scenarios require support of front-end development, and how to improve development efficiency becomes particularly important and urgent. However, in the related art, it is generally required that a designer provide a page design script, and then a developer writes page code according to the page design script, resulting in a low development efficiency. Accordingly, there is a need to provide a more efficient page code generation scheme. Disclosure of Invention In order to solve at least one technical problem set forth above, the present application provides a method, an apparatus, an electronic device, a storage medium, and a product for generating a page code: According to a first aspect of the present application, there is provided a page code generation method applied to a target platform, the method comprising: Determining at least one current local blueprint from a page blueprint indicating a target page, wherein the current local blueprint comprises at least one visual object; Predicting a target logic code corresponding to the current local blueprint by utilizing a target large language model aiming at each current local blueprint, wherein the target logic code is used for representing a triggering condition which is required to be met by triggering a plurality of service components respectively, and the plurality of service components are determined based on a service scene supported by the at least one visual object; Generating a page code corresponding to the current local blueprint based on the target logic code and page description information of each of the plurality of service components, wherein the page description information is determined based on the visual object corresponding to the service component; and obtaining the page codes corresponding to the page blueprints based on the page codes corresponding to the at least one current local blueprint. According to a second aspect of the present application, there is provided a page code generating apparatus configured to a target platform, the apparatus comprising: The local blueprint determining module is used for determining at least one current local blueprint from the page blueprint indicating the target page, wherein the current local blueprint comprises at least one visual object; The logic code prediction module is used for predicting target logic codes corresponding to the current local blueprints by utilizing a target large language model aiming at each current local blueprint, wherein the target logic codes are used for representing trigger conditions which are required to be met by triggering a plurality of service components respectively, and the plurality of service components are determined based on service scenes supported by the at least one visual object; The local page code generation module is used for generating a page code corresponding to each current local blueprint based on the target logic code and page description information of each of the plurality of service components, wherein the page description information is determined based on the visual object corresponding to the service component; And the global page code obtaining module is used for obtaining the page codes corresponding to the page blueprints based on the page codes corresponding to the at least one current local blueprint. According to a third aspect of the present application, there is provided an electronic device comprising at least one processor and a memory communicatively connected to the at least one processor, wherein the memory stores at least one instruction or at least one program, which is loaded and executed by the at least one processor to implement the page code generation method as described in the first aspect. According to a fourth aspect of the present application, there is provided a computer readable storage medium having stored therein at least one instruction or at least one program loaded and executed by a processor to implement the page code generation method as described in the first aspect. According to a fifth aspect of the present application there is provided a computer program product comprising at least one instruction or at least one program, the at least one instruction or at least one program being loaded and executed by a processor to implement a page code generation method as described in the first aspect. It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application as claimed. The i