Method, device, equipment and product for generating codes

CN121143751APending Publication Date: 2025-12-16BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511269856.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-05
Publication Date
2025-12-16

AI Technical Summary

Technical Problem

When existing code generation tools rely on natural language descriptions, users need to spend a lot of time and effort organizing complex language description requirements, which can lead to inaccurate descriptions, ambiguity, and omissions, affecting the accuracy of the generated code and the user experience.

Method used

It provides a drawing board interface, allowing users to describe code by drawing graphics, which is then combined with natural language text to generate code. Image processing and multimodal models are used to understand user needs.

Benefits of technology

It reduces the cost of users describing their needs, improves the accuracy of code generation and user experience, solves the problems of ambiguity and omission in natural language description, and improves development efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121143751A_ABST
    Figure CN121143751A_ABST
Patent Text Reader

Abstract

The invention relates to a method, device and equipment for generating codes and a program product. The method includes displaying a drawing board providing preset elements for graphically describing a code function. The method comprises the following steps: acquiring a target graph drawn on a drawing board by a user, wherein the target graph comprises a preset element and describes at least one part of functions of a code; the method includes generating code based on a target graph and description text input by a user.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the field of computers, and more specifically, to methods, apparatuses, devices, and products for generating code. BACKGROUND

[0002] The core goal of code generation is to let the machine understand the mapping relationship between natural language requirements and code logic through technologies such as machine learning, natural language processing, and program analysis, and to generate code that meets user requirements. With the rapid development of deep learning, code generation tools have gradually become an important auxiliary means in the field of code development. There are currently a variety of code generation websites on the market, and users can express their requirements for the functions, layouts, interactions, and other aspects of websites or applications in detail through text. These tools can automatically convert the user's requirements into complete and executable code projects based on the natural language requirements input by the user through natural language processing technology, and support users to preview the generated website or application, greatly improving the efficiency of code development. SUMMARY

[0003] In a first aspect of embodiments of the present disclosure, a method for generating code is provided. The method includes displaying a palette, the palette providing preset elements for describing code functions in a graphical manner. The method includes obtaining a target graph drawn by a user on the palette, the target graph including the preset elements and describing at least part of the functions of the code. The method includes generating the code based on the target graph and a description text input by the user.

[0004] In a second aspect of embodiments of the present disclosure, an apparatus for generating code is provided. The apparatus includes a palette display module configured to display a palette, the palette providing preset elements for describing code functions in a graphical manner. The apparatus includes a target graph drawing module configured to obtain a target graph drawn by a user on the palette, the target graph including the preset elements and describing at least part of the functions of the code. The apparatus includes a code generation module configured to generate the code based on the target graph and a description text input by the user.

[0005] In a third aspect of embodiments of the present disclosure, an electronic device is provided. The electronic device includes one or more processors; and a storage apparatus storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the method of the first aspect.

[0006] In a fourth aspect of embodiments of the present disclosure, a computer program product is provided. The computer program product is tangibly stored on a non-transitory computer readable medium and includes machine executable instructions that, when executed, cause a machine to implement the method of the first aspect.

[0007] The above and other features and advantages of the present disclosure will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings in which: BRIEF DESCRIPTION OF DRAWINGS

[0008] The above and other features, aspects and advantages of various embodiments of the present disclosure will be more apparent from the following detailed description taken in conjunction with the accompanying drawings, in which like reference characters refer to like elements throughout. The following detailed description includes specific details for the purpose of providing an understanding of various embodiments of the present disclosure. However, it will be apparent to those skilled in the art that the various embodiments of the present disclosure can be practiced without these specific details. In some instances, well-known structures and devices are shown in block diagram form in order to facilitate describing one or more embodiments of the present disclosure. It is intended that the various embodiments of the present disclosure be construed as including the various exemplary embodiments and that they are intended to cover the modifications and equivalents of the present disclosure. It is also to be understood that the terminology employed herein is for the purpose of describing particular embodiments and is not intended to be limiting.

[0009] Figure 1 A schematic diagram illustrating an example environment in which various embodiments of the present disclosure can be implemented is shown;

[0010] Figure 2 A flowchart illustrating a method for generating code according to some embodiments of the present disclosure is shown;

[0011] Figure 3 A schematic diagram illustrating a palette entry page of some embodiments of the present disclosure is shown;

[0012] Figure 4 A schematic diagram illustrating a palette component interface of some embodiments of the present disclosure is shown;

[0013] Figure 5 A schematic diagram illustrating a palette insertion page of some embodiments of the present disclosure is shown;

[0014] Figure 6 A schematic diagram illustrating a code generation page of some embodiments of the present disclosure is shown;

[0015] Figure 7 A block diagram illustrating an apparatus for generating code according to some embodiments of the present disclosure is shown; and

[0016] Figure 8 A block diagram illustrating an apparatus capable of implementing various embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0017] It can be understood that all user-related data involved in the present technical solution should be acquired and used after authorization by the user. This means that in the present technical solution, if the user's personal information needs to be used, the user's explicit consent and authorization are required before the data is acquired, otherwise the relevant data collection and use will not be carried out. It should also be understood that in the implementation of the present technical solution, relevant laws and regulations should be strictly followed in the process of data collection, use and storage, and necessary technical and measures should be taken to protect the security of the user's data and ensure the safe use of the data.

[0018] It can be understood that, before using the technical solutions disclosed in the embodiments of the present disclosure, the type of personal information involved in the present disclosure, the use range, the use scenario, etc. should be informed to the user and the authorization of the user should be obtained through appropriate means according to relevant laws and regulations.

[0019] For example, when receiving an active request of a user, a prompt information is sent to the user to explicitly prompt the user that the operation requested to be performed will need to obtain and use the personal information of the user. Thus, the user can autonomously select whether to provide the personal information to the software or hardware such as an electronic device, an application program, a server or a storage medium, etc. performing the operation of the technical solutions of the present disclosure according to the prompt information.

[0020] As an optional but non-limiting implementation manner, in response to receiving the active request of the user, the manner of sending the prompt information to the user may, for example, be a pop-up window manner, and the prompt information may be presented in the form of text in the pop-up window. In addition, the pop-up window may also carry a selection control for the user to select “agree” or “disagree” to provide the personal information to the electronic device.

[0021] It can be understood that the above notification and obtaining of the authorization of the user are only illustrative, and do not limit the implementation manners of the present disclosure, and other manners meeting the relevant laws and regulations can also be applied to the implementation manners of the present disclosure.

[0022] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms, and should not be interpreted as being limited to the embodiments set forth herein, but rather these embodiments are provided to more thoroughly and completely understand the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes, and are not intended to limit the scope of protection of the present disclosure.

[0023] In the description of the embodiments of the present disclosure, the term “comprising” and similar terms are understood to be open-ended, i.e., “including but not limited to”. The term “based on” is understood to mean “based at least in part on”. The term “one embodiment” or “the embodiment” is understood to mean “at least one embodiment”. The terms “first”, “second”, etc. can refer to different or same objects unless explicitly stated otherwise. The following can also include other explicit and implicit definitions.

[0024] As mentioned above, code generation tools can automatically generate complete, executable code based on user-inputted natural language requirements. However, this reliance solely on natural language has significant limitations. Users often need to spend considerable time and effort organizing their language to accurately describe their needs, resulting in high costs for users describing their requirements. Furthermore, for some complex business processes and page layouts, natural language descriptions are prone to ambiguity and omissions, making it difficult for code generation tools to accurately understand user intent. Inaccurate user requirement descriptions can lead to significant discrepancies between the generated code and user expectations, impacting user experience and development efficiency.

[0025] To address this, this disclosure proposes a code generation scheme. In this scheme, a processing device can display a canvas providing preset elements for graphically describing the functionality of the code. The processing device can then acquire a target graphic drawn by a user on the canvas, the target graphic including the preset elements and describing at least a portion of the code's functionality. Furthermore, the processing device can generate code based on the target graphic and descriptive text input by the user.

[0026] In this way, the processing device can use the canvas as a means for users to express their needs, reducing the cost of describing those needs. Users don't need to spend a lot of time and effort organizing complex natural language; they can clearly express their needs through simple drawings. Furthermore, by acquiring the target graphic drawn by the user on the canvas, the device solves the problems of ambiguity and omissions that easily occur when describing complex business processes and page layouts using natural language, thus enabling a clearer and more accurate understanding of user intent. In addition, generating code based on the target graphic and the descriptive text input by the user ensures a high degree of matching between the generated code and user expectations, improving user experience and increasing development efficiency.

[0027] Figure 1 A schematic diagram of an example environment 100 in which various embodiments of this disclosure may be implemented is shown. For example... Figure 1 As shown, environment 100 includes processing device 102. Processing device 102 can be any device with processing capabilities. For example, processing device 102 can be a smartphone, tablet computer, laptop computer, desktop computer, workstation, or smart wearable device, etc. In environment 100, processing device 102 can run application 104. Users can interact with application 104 through processing device 102. In application 104, users can generate code using a whiteboard and descriptive text. For example, application 104 can be a code generation website.

[0028] In the environment 100, the application 104 can display the drawing board 106 and the text input box 110. The drawing board 106 provides preset elements for describing the function of the code in a graphical manner. In some embodiments, the preset elements can be connection lines, text boxes, geometric figures, etc. The user draws the target graph 108 through the drawing board 106. The target graph includes preset elements and describes at least part of the function of the code. For example, the target graph 108 can be a flowchart of business logic, and the target graph 108 can also be a wireframe of a product design prototype, for example, a wireframe of a webpage design. The text input box 110 can be used for the user to input description text 112. For example, the description text can be “generate the corresponding webpage according to the wireframe of the webpage design in the drawing board”. The description text in the text input box 110 can be text input by the user actively, or text automatically filled into the text input box 110 by the application in response to a specific user interaction. In some implementations, the application 104 can automatically fill in the prompt information of the description text associated with the target graph 108 based on the target graph 108, without the user manually inputting the description text 112 in the text input box 110.

[0029] In the environment 100, the application 104 can generate the code 114 based on the target graph 108 drawn by the user and the description text 112 input by the user. For example, the code 114 can be a website code, and the code 114 can also be an application code. In some implementations, the application 104 can use natural language processing techniques to determine the semantics of the description text 112. In addition, the application 104 can use image processing techniques to identify entities and entity relationships in the target graph 108. In other implementations, the application 104 can use a specially trained multi-modal model to determine the user requirements expressed by the target graph 108 in combination with the description text 112.

[0030] In this way, the processing device 102 can use the drawing board 106 as a way for the user to express requirements, reducing the cost of the user describing requirements, and the user does not need to spend a lot of time and effort to organize complex natural language, but can clearly express requirements through simple drawing. In addition, by obtaining the target graph 108 drawn by the user on the drawing board 106, the ambiguity and omission problems that often occur when describing complex business processes and page layouts in natural language are solved, so that the user's intention can be more clearly and accurately understood. In addition, generating the code 114 based on the target graph 108 and the description text 112 input by the user makes the generated code match the user's expectations to a high degree, improves the user experience, and improves the development efficiency.

[0031] Figure 2A flowchart of a method 200 for generating code according to some embodiments of the present disclosure is shown. Method 200 can be executed by an apparatus for generating code, which may be, for example, a standalone device or system. The apparatus can be implemented in software and / or hardware. The method 200 will now be illustrated schematically using an apparatus for generating code as the execution entity. Method 200 includes blocks 202, 204, and 206. For ease of discussion, [the following will be discussed in conjunction with...] Figure 1 and Figure 3 to Figure 5 Let's describe method 200.

[0032] like Figure 2 As shown, in box 202, a canvas is displayed, which provides preset elements for graphically describing code functionality. For example, in... Figure 1 In the environment 100 shown, application 104 can display canvas 106. For example, application 104 can have a first component on the page, which can be a canvas function entry icon. In some implementations, application 104 can display canvas 106 in response to a touch operation of the first component. Figure 3 A schematic diagram of a canvas entry page 300 according to some embodiments of this disclosure is shown, such as... Figure 3 As shown, in the canvas entry page 300, application 104 can set a text input box 302, and at the bottom of the text input box 302, the function entry icon of canvas 306 and the mode selection component 304 can be displayed, such as... Figure 3 As shown, the mode selection component 304 can include two modes: question and answer or development.

[0033] In some embodiments, application 104 may display a prompt message to guide the user to use the canvas in response to the cursor hovering over the function entry icon of canvas 306. For example, the prompt message may be "Draw wireframes or flowcharts to express inspiration," guiding the user to use the canvas function.

[0034] In some embodiments, application 104 may respond to a touch operation of the function entry icon of canvas 306 to pop up the canvas interface. For example, the canvas interface may be a separate drawing area. Figure 4 Schematic diagrams of a canvas interface 400 according to some embodiments of the present disclosure are shown, such as Figure 4 As shown, the canvas interface 400 provides preset elements for graphically describing code functions. These preset elements can be preset graphics 402, text boxes 404, and connecting lines 406, etc. In some embodiments, the canvas interface 400 can also provide drawing templates, which can include at least one of radar charts, timeline charts, fishbone charts, bubble charts, or matrix charts. The drawing templates provided by the canvas interface 400 help users complete quick drawing tasks.

[0035] By the preset elements and the drawing template provided by the palette, the user can directly select the preset elements or the drawing template to draw, without drawing the basic graphics by himself, thereby improving the drawing efficiency and the standardization of the graphics. Moreover, the user can draw multiple types of graphics such as the flowchart, the time sequence diagram, the prototype diagram or the wireframe sketch, thereby meeting the requirement expression in different scenarios.

[0036] In some embodiments, a drawing completion operation component can be arranged at the bottom of the palette interface 400, such as Figure 4 As shown in the drawing completion operation component, the cancel and confirm 408 can be arranged at the bottom of the palette interface 400. In some implementations, in response to the touch operation of the confirm 408, the user is instructed to complete the drawing.

[0037] With reference to Figure 2 , at block 204, the target graphic drawn by the user on the palette is acquired, and the target graphic includes the preset elements and describes at least part of the function of the code. For example, in the environment 100 as shown in Figure 1 , the application 104 can acquire the target graphic 108 drawn by the user on the palette 106. In some implementations, the target graphic 108 can be a flowchart associated with the code, and the preset elements can at least include the elements representing the process nodes, the elements representing the decision nodes and the connection lines. In another implementation, the target graphic 108 can be a wireframe diagram associated with the code, and the preset elements can at least include the elements representing the components in the graphical user interface.

[0038] In some embodiments, the application 104 can display the identification of the target graphic in response to the completion of the drawing of the target graphic. Figure 5 A schematic diagram of a palette insertion page 500 of some embodiments of the present disclosure is shown. As shown in Figure 5 , the application 104 displays the identification 504 of the target graphic drawn by the user, and inserts the target graphic indicated by the identification 504 into the text input box 502 in the form of a picture as part of the user requirement.

[0039] In some embodiments, the application 104 can perform an audit on the target graphic in response to the completion of the drawing of the target graphic. If the target graphic includes information of a specific category, the application 104 will prevent the display of the identification of the target graphic. For example, the information of the specific category can be the target data related to the user. In this way, the compliance and the security of the code generation can be improved, and the security risk can be reduced.

[0040] In some embodiments, the identification 504 can be provided with a delete button, and the application 104 can delete the identification 504 from the text input box 502 in response to the touch operation of the delete button. In this way, the user can conveniently re-add the palette and draw on the newly added blank palette.

[0041] Continue to refer to Figure 2 In box 206, code is generated based on the target graphic and the descriptive text input by the user. For example, in... Figure 1 In the environment 100 shown, application 104 can generate code 114 based on the target graphic 108 and the descriptive text 112 input by the user. For example, as Figure 5 As shown, application 104 can generate code based on the target graphic indicated by identifier 504 and the descriptive text 506 input by the user. In some embodiments, the descriptive text 506 can be text actively entered by the user, or text automatically filled into the text input box 502 by application 104 in response to a specific user interaction. In some implementations, application 104 can automatically fill in a prompt message with descriptive text associated with the target graphic 108, without requiring the user to manually enter the descriptive text 506 into the text input box 502. In some implementations, application 104 can generate code based on the target graphic indicated by identifier 504 and the prompt message.

[0042] In some embodiments, application 104 may display a canvas component interface in response to a touch operation, the canvas component interface displaying the completed target graphic. Application 104 may update the completed target graphic in response to a user's drawing operation, and then application 104 may regenerate code based on the updated target graphic and user-inputted descriptive text. Figure 6 A schematic diagram of a generated code page 600 according to some embodiments of this disclosure is shown. For example... Figure 6 As shown, the code generation page 600 includes code 602 generated based on the target graphic drawn by the user and the descriptive text entered by the user. Application 104 can respond to a touch operation of identifier 606 by displaying a canvas. The user can then update the completed target graphic on the canvas. Finally, application 104 can generate code based on the updated target graphic and descriptive text 608. In this way, application 104 allows the user to continue drawing and editing the already drawn target graphic, facilitating real-time adjustments to the required description and improving the user experience.

[0043] In this way, the processing device can use the canvas as a means for users to express their needs, reducing the cost of describing those needs. Users don't need to spend a lot of time and effort organizing complex natural language; they can clearly express their needs through simple drawings. Furthermore, by acquiring the target graphic drawn by the user on the canvas, the device solves the problems of ambiguity and omissions that easily occur when describing complex business processes and page layouts using natural language, thus enabling a clearer and more accurate understanding of user intent. In addition, generating code based on the target graphic and the descriptive text input by the user ensures a high degree of matching between the generated code and user expectations, improving user experience and increasing development efficiency.

[0044] Figure 7 A block diagram of an apparatus 700 for generating code is shown in accordance with some embodiments of the present disclosure. As shown, the apparatus 700 includes a palette display module 702 configured to display a palette, the palette providing preset elements for graphically describing a function of the code. The apparatus 700 further includes a target graph drawing module 704 configured to obtain a target graph drawn by a user on the palette, the target graph including the preset elements and describing at least a part of the function of the code. In addition, the apparatus 700 further includes a code generation module 706 configured to generate the code based on the target graph and a description text input by the user. Figure 7

[0045] In some embodiments, wherein the target graph includes a flowchart associated with the code, and the preset elements include at least an element representing a process node, an element representing a decision node, and a connection line.

[0046] In some embodiments, wherein the target graph includes a wireframe diagram associated with the code, and the preset elements include at least an element representing a component in a graphical user interface.

[0047] In some embodiments, wherein the palette sets a drawing template, the apparatus 700 further includes a drawing template using module configured to draw the target graph through the drawing template in the palette.

[0048] In some embodiments, wherein the drawing template includes at least one of a radar chart, a timeline chart, a fishbone chart, a bubble chart, or a matrix chart.

[0049] In some embodiments, the apparatus 700 further includes an identification display module configured to display an identification of the target graph in response to the target graph being drawn to completion, and an identification using module configured to generate the code based on the identification-indicated target graph and the description text input by the user.

[0050] In some embodiments, wherein the code generation module 706 includes an identification touch module configured to display the palette in response to a touch operation on the identification, the palette displaying the target graph therein, a drawing update module configured to update the target graph in response to a drawing operation by the user, and a code update module configured to generate the code based on the updated target graph and the description text input by the user.

[0051] In some embodiments, wherein the identification sets a delete button, the apparatus 700 further includes a deletion module configured to delete the identification in response to a touch operation on the delete button.

[0052] ​In some embodiments, the identifier display module further includes an approval module configured to approve the target graphic in response to the completion of the drawing of the target graphic; and an identifier blocking module configured to block the display of the identifier of the target graphic in response to the inclusion of information of a specific category in the target graphic.

[0053] In some embodiments, the identifier usage module further includes a prompt information display module configured to display prompt information of descriptive text associated with the target graphic; the prompt information usage module is configured to generate code based on the target graphic indicated by the identifier and the prompt information.

[0054] In some embodiments, wherein a first component is provided on the page, the canvas display module further includes a canvas usage guidance module configured to display prompts for guiding the use of the canvas in response to cursor hovering over the first component; and a first component touch module configured to display the canvas in response to touch operation of the first component.

[0055] Device 700 utilizes a drawing board as a means for users to express their needs, reducing the cost of describing those needs. Users no longer need to spend significant time and effort organizing complex natural language; they can clearly express their requirements through simple drawings. Furthermore, by acquiring the target graphic drawn by the user on the drawing board, the device resolves the ambiguity and omissions that often occur when describing complex business processes and page layouts using natural language, thus enabling a clearer and more accurate understanding of user intent. In addition, generating code based on the target graphic and the user-input descriptive text ensures a high degree of match between the generated code and user expectations, improving user experience and increasing development efficiency.

[0056] Figure 8 A block diagram of a device 800 capable of implementing various embodiments of the present disclosure is shown. (See diagram for example.) Figure 8 As shown, device 800 includes a central processing unit (CPU) and / or a graphics processing unit (GPU) 801, which can perform various appropriate actions and processes according to computer program instructions stored in read-only memory (ROM) 802 or loaded from storage unit 808 into random access memory (RAM) 803. The RAM 803 can also store various programs and data required for the operation of device 800. The CPU / GPU 801, ROM 802, and RAM 803 are interconnected via bus 804. Input / output (I / O) interface 805 is also connected to bus 804. Although not shown in... Figure 8 As shown, device 800 may also include a coprocessor.

[0057] A number of the components in device 800 are connected to the I / O interface 805, including an input unit 806, such as a keyboard, mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a disk, a CD, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows device 800 to exchange information / data with other devices over a computer network, such as the Internet, and / or various telecommunication networks.

[0058] The various methods or processes described above can be performed by the CPU / GPU 801. For example, in some embodiments, the methods can be implemented as a computer software program tangibly embodied in a machine readable medium, such as the storage unit 808. In some embodiments, portions or all of the computer program can be loaded and / or installed onto device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded onto the RAM 803 and executed by the CPU / GPU 801, one or more steps or actions of the methods or processes described above can be performed.

[0059] In some embodiments, the methods and processes described above can be implemented as a computer program product. The computer program product can include a computer readable storage medium having computer readable program instructions embodied therewith.

[0060] The computer readable storage medium can be a tangible device that can retain and store instructions for use by an instruction execution device. The computer readable storage medium can be, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium include the following: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanically encoded device such as punch-cards or punched tape, a

[0061] Computer readable program instructions described herein can be downloaded to respective computing / processing devices from a computer readable storage medium or to an external computer or external storage device via a network, for example, the Internet, a local area network, a wide area network and / or a wireless network. The network can comprise copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers and / or edge servers. A network adapter card or network interface in each computing / processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium within the respective computing / processing device.

[0062] Computer readable program instructions for carrying out operations of the present disclosure can be assembler instructions, instruction-set-architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state-setting data, or either source code or object code written in any combination of one or more programming languages, including an object oriented programming language and conventional procedural programming languages. The computer readable program instructions can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider). In some embodiments, electronic circuitry including, for example, programmable logic circuitry, field-programmable gate array (FPGA), or programmable logic array (PLA) can execute the computer readable program instructions by utilizing state information of the computer readable program instructions to personalize the electronic circuitry, in order to perform aspects of the present disclosure.

[0063] These computer readable program instructions can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks. These computer readable program instructions can also be stored in a computer readable storage medium that can include a non-transitory computer readable storage medium that can direct a computer, a programmable data processing apparatus, and / or other devices to function in a particular manner, such that the computer readable storage medium having instructions for causing an apparatus to implement various aspects of the functions / acts specified in the flowchart and / or block diagram block or blocks is produced.

[0064] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus or other device to produce a computer implemented process such that the instructions which execute on the computer, other programmable data processing apparatus, or other device implement the functions / acts specified in the flowchart and / or block diagram block or blocks.

[0065] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus or other device to produce a computer implemented process such that the instructions which execute on the computer, other programmable data processing apparatus, or other device implement the functions / acts specified in the flowchart and / or block diagram block or blocks.

[0066] Embodiments of the present disclosure have been described above, and the description is intended to be illustrative, and not restrictive, of the disclosed embodiments. Many modifications and variations of the disclosed embodiments are possible in light of the above teachings. It is therefore to be understood that within the scope of the disclosed embodiments, modifications and variations of the disclosed embodiments can be practiced. It is also to be understood that the specific order or hierarchy of steps in the processes disclosed is an illustration of exemplary processes. Based upon the description and illustrations provided herein, those skilled in the art will understand that changes can be made to the order of steps in the processes and that many of the individual steps can be modified or eliminated. Additionally, the description and illustrations provided herein are intended to describe and enable not enable only the particular embodiments disclosed. The wording used herein should not be construed to limit the scope of the disclosure, but rather to provide clarity and context. Thus, other embodiments can be used and modified in various ways without departing from the scope or spirit of the present disclosure.

Claims

1. A method for generating code, comprising: Display canvas, which provides preset elements for graphically describing code functionality; Obtain the target graphic drawn by the user on the canvas, the target graphic including the preset elements and describing at least a portion of the functionality of the code; as well as The code is generated based on the target graphic and the descriptive text input by the user.

2. The method of claim 1, wherein the target graphic includes a flowchart associated with the code, and the preset elements include at least elements representing process nodes, elements representing decision nodes, and connecting lines.

3. The method of claim 1, wherein the target graphic comprises a wireframe diagram associated with the code, and the preset element comprises at least an element representing a component in a graphical user interface.

4. The method according to claim 1, wherein the drawing board is provided with a drawing template, the method further comprising: The target graphic is drawn using the drawing template in the drawing board.

5. The method according to claim 4, wherein the drawing template includes at least one of radar chart, timeline chart, fishbone chart, bubble chart or matrix chart.

6. The method according to claim 1, further comprising: In response to the completion of the drawing of the target graphic, the identifier of the target graphic is displayed; as well as Code is generated based on the target graphic indicated by the identifier and the descriptive text input by the user.

7. The method of claim 6, wherein generating code based on the target graphic and user-input descriptive text comprises: In response to a touch operation on the identifier, the canvas is displayed, and the target graphic is displayed on the canvas; Update the target graphic in response to the user's drawing operation; as well as Code is generated based on the updated target graphic and the descriptive text input by the user.

8. The method according to claim 6, wherein the identifier is set to delete the button, the method further includes: In response to a touch operation of the delete button, the identifier is deleted.

9. The method of claim 6, wherein displaying an identifier of the target graphic in response to the completion of drawing the target graphic includes: In response to the completion of the target graphic drawing, the target graphic is reviewed; as well as In response to the inclusion of specific category information in the target graphic, the display of the target graphic's identifier is prevented.

10. The method of claim 6, wherein generating the code based on the target graphic indicated by the identifier and the descriptive text input by the user comprises: Display prompts with descriptive text associated with the target graphic; as well as Code is generated based on the target graphic indicated by the identifier and the prompt information.

11. The method of claim 1, wherein a first component is provided on the page, and displaying the canvas comprises: In response to the cursor hovering over the first component, a prompt message is displayed to guide the use of the canvas; as well as The canvas is displayed in response to a touch operation on the first component.

12. An apparatus for generating code, comprising: The canvas display module is configured to display a canvas that provides preset elements for graphically describing code functions; A target graphic drawing module is configured to acquire a target graphic drawn by a user on a canvas, the target graphic including the preset elements and describing at least a portion of the functionality of the code; as well as The code generation module is configured to generate the code based on the target graphic and the descriptive text input by the user.

13. An electronic device, comprising: processor; as well as A memory coupled to the processor, the memory having instructions stored therein, which, when executed by the processor, cause the electronic device to perform the method according to any one of claims 1 to 11.

14. A computer program product tangibly stored on a non-transitory computer-readable medium and comprising machine-executable instructions that, when executed, cause a machine to perform the method according to any one of claims 1 to 11.