Method and device for generating scripts based on product requirements

Through the large model interface analysis of product requirements documents and generating quasi -scripts, the problem of high communication costs, technical solution limit, and low code writing efficiency in the development process of software engineering, and achieved more efficient product demand understanding and code development.

CN119336295APending Publication Date: 2025-01-21HANGZHOU YONGRONG INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411262969.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-10
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

The existing software engineering development process has communication costs and misunderstandings, limitations of technical solution design, efficiency and consistency of code writing, and insufficient code testing.

Method used

By calling the large model interface, the product requirements document is parsed and processed to generate code development requirements. The original code is queried from the project knowledge graph, code encoding is performed, and a quasi-script is generated. Finally, a quasi-script corresponding to the product requirements is generated based on the quasi-script.

Benefits of technology

It reduces communication costs and misunderstandings between developers and product managers, improves the accuracy of understanding product requirements, reduces duplication of work by developers, and improves code development efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119336295A_ABST
    Figure CN119336295A_ABST
Patent Text Reader

Abstract

The invention provides a method and device for generating scripts based on product requirements, and belongs to the technical field of computers. The method is applied to first equipment. According to one specific embodiment, the method comprises the steps that firstly, a large model interface is called to analyze a product requirement document, and a plurality of code development requirements are generated; secondly, aiming at any code development demand: querying an original code corresponding to the code development demand from a project knowledge graph; calling a large model interface to carry out code coding processing on the original code and the code development demand, and generating a quasi script corresponding to the code development demand; and finally, based on the quasi-script corresponding to each code development demand, generating the quasi-script corresponding to the product demand. Therefore, the communication cost and misunderstanding between developers and product managers are reduced, and the accuracy of understanding the product requirements is improved; and moreover, the repeated labor of developers is reduced, and the code development efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer technology, and in particular relates to a method and device for generating scripts based on product requirements. Background Art

[0002] According to the existing software engineering development process, software developers basically follow the fixed work stages of product requirement understanding, technical solution design, code writing, and code testing when carrying out project development.

[0003] Although the above operation stages are classic and commonly practiced models, there are some disadvantages, such as: (1) Communication costs and misunderstandings: In the stage of understanding requirements, poor communication between developers and product managers may lead to deviations in understanding requirements, which in turn affects the quality of the final product and development efficiency. (2) Limitations of technical solution design: The technical solution may be limited by the designer's knowledge and experience and may not take into account all optimal solutions or the latest technological advances. (3) Efficiency and consistency of code writing: The coding stage may lead to inconsistent code styles due to individual differences, and manual coding is prone to errors, reducing development efficiency. Insufficient code testing: Manual testing may not cover all edge cases, and writing automated test scripts also requires additional time and effort.

[0004] Therefore, there is an urgent need to provide an efficient software engineering development process. Summary of the invention

[0005] In view of the above problems existing in the prior art, an embodiment of the present invention provides a method and device for generating scripts based on product requirements; the method can quickly generate scripts based on product requirements, thereby improving the quality and efficiency of script generation.

[0006] According to a first aspect of an embodiment of the present invention, a method for generating scripts based on product requirements is provided, which is applied to a first device; the method comprises: calling a large model interface to parse a product requirement document to generate a plurality of code development requirements; for any code development requirement: querying the original code corresponding to the code development requirement from the project knowledge graph; calling a large model interface to perform code encoding processing on the original code and the code development requirement to generate a quasi-script corresponding to the code development requirement; wherein the project knowledge graph is used to indicate a target code library corresponding to a project; based on the quasi-script corresponding to each of the code development requirements, a quasi-script corresponding to the product requirement is generated.

[0007] Optionally, the method further includes: obtaining the user's project code development requirements; querying the target code corresponding to the project code development requirements from the local code library, and generating a project knowledge graph.

[0008] Optionally, the method further includes: performing a legality check on the code development requirements to generate a verified code development requirement; and / or performing a legality check on the quasi-script to generate a verified quasi-script; and parsing and cleaning the verified quasi-script and storing it in a local database.

[0009] Optionally, the calling of the large model interface performs code encoding processing on the original code and the code development requirements to generate a quasi-script corresponding to the code development requirements; including: encapsulating the original code and the code development requirements through DSL, outputting the encapsulated original code and the encapsulated code development requirements; calling the large model interface performs code encoding processing on the encapsulated original code and the encapsulated code development requirements, and outputting the quasi-script corresponding to the code development requirements.

[0010] Optionally, the large model interface includes but is not limited to the API interface of GPT-4, iFlytek Spark, Alitong YiQianwen, Baidu Wenxin Yiyan, or ChatGLM.

[0011] Optionally, the method further includes: generating an original code library based on the original code corresponding to each code development requirement; and debugging the quasi-script based on the original code library to generate a debugged quasi-script.

[0012] Optionally, the method further includes: calling a large model interface to encode several of the code development requirements and quasi-scripts, and outputting test cases and test scripts; based on the test cases and the test scripts, performing functional testing on the debugged quasi-scripts, and generating test results.

[0013] Optionally, the method further includes: visually displaying the quasi-script via a web page.

[0014] According to the second aspect of an embodiment of the present invention, there is also provided an apparatus for generating scripts based on product requirements, which is applied to a first device; comprising: a parsing module, which is used to call a large model interface to parse a product requirement document and generate a number of code development requirements; an encoding module, which is used to query the original code corresponding to the code development requirement from the project knowledge graph for any code development requirement; call the large model interface to perform code encoding on the original code and the code development requirement, and generate a quasi-script corresponding to the code development requirement; wherein the project knowledge graph is used to indicate a target code library corresponding to a project; a first generation module, which is used to generate a quasi-script corresponding to the product requirement based on the quasi-script corresponding to each of the code development requirements.

[0015] According to a third aspect of an embodiment of the present invention, there is also provided an electronic device, comprising: a processor; a memory for storing instructions executable by the processor; the processor is configured to read the executable instructions from the memory and execute the instructions to implement the method described in the first aspect.

[0016] According to a fourth aspect of an embodiment of the present invention, there is further provided a computer-readable medium on which a computer program is stored. When the program is executed by a processor, the method described in the first aspect is implemented.

[0017] The present invention provides a method for generating scripts based on product requirements, which is applied to a first device; comprising: first, calling a large model interface to parse a product requirement document and generate a number of code development requirements; second, for any code development requirement: querying the original code corresponding to the code development requirement from the project knowledge graph; calling the large model interface to perform code encoding on the original code and the code development requirement, and generating a quasi-script corresponding to the code development requirement; wherein the project knowledge graph is used to indicate the target code library corresponding to the project; then, based on the quasi-script corresponding to each of the code development requirements, a quasi-script corresponding to the product requirement is generated. This embodiment uses a large model to parse a product requirement document, and uses the large model to perform code encoding based on the code development requirements automatically generated after parsing and the original code corresponding to the code development requirements; thereby, not only the communication cost and misunderstanding between developers and product managers are reduced, and the accuracy of understanding product requirements is improved; but also the repetitive work of developers is reduced, and the efficiency of code development is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Hereinafter, some specific embodiments of the present invention will be described in detail in an exemplary and non-limiting manner with reference to the accompanying drawings. The same reference numerals in the accompanying drawings indicate the same or similar components or parts. It should be understood by those skilled in the art that these drawings are not necessarily drawn to scale. In the accompanying drawings:

[0019] Figure 1 A flowchart of a method for generating scripts based on product requirements provided by an embodiment of the present invention;

[0020] Figure 2 A schematic diagram of a process for generating a quasi-script corresponding to the code development requirement in one embodiment of the present invention;

[0021] Figure 3 It is a schematic diagram of the structure of an apparatus for generating scripts based on product requirements in one embodiment of the present invention. DETAILED DESCRIPTION

[0022] In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0023] like Figure 1 As shown, it is a flowchart of a method for generating scripts based on product requirements provided by an embodiment of the present invention.

[0024] A method for generating a script based on product requirements, comprising at least the following steps:

[0025] S101, calling the large model interface to parse the product requirement document and generate several code development requirements;

[0026] S102, for any code development requirement: query the original code corresponding to the code development requirement from the project knowledge graph; call the large model interface to perform code encoding processing on the original code and the code development requirement, and generate a quasi-script corresponding to the code development requirement; wherein the project knowledge graph is used to indicate the target code library corresponding to the project;

[0027] S103, generating a quasi-script corresponding to the product requirement based on the quasi-script corresponding to each of the code development requirements.

[0028] In S101, Large Model is used to indicate an AI model with a large number of parameters and strong computing power. The Large Model interface here is an API interface of GPT-4, iFlytek Spark, Alitong YiQianwen, Baidu Wenxin Yiyan, or ChatGLM, etc. The API interface is used to provide an interface for the first device or software to interact with an external device or software.

[0029] The product requirement document is a document that clearly describes the functional implementation, solution to key problems, or handling of existing codes involved in the iteration.

[0030] Code development requirements are used to indicate that the information obtained from natural language processing is abstracted into a more formalized description of programming requirements. In other words, code development requirements are requirements understanding reports, user stories, and acceptance criteria that map user requirements to specific programming tasks, algorithms, or data structures.

[0031] This embodiment uses a big model to parse the product requirement document and automatically generates a number of code development requirements; thus, the automated analysis capability of the big model reduces the communication costs and misunderstandings between developers and product managers, thereby improving the accuracy of understanding the product requirement document and shortening the project development cycle.

[0032] In S102 and S103, the large model makes business logic changes to the original code according to the code development requirements, and generates a quasi-script corresponding to the code development requirements.

[0033] Large models have the following advantages in encoding processing:

[0034] (1) Diversified technical solution design: The big model provides a variety of technical solutions by analyzing historical project data and the latest technology trends, helping designers make better decisions.

[0035] (2) Foresight and innovation: The large model can continuously learn the latest technological advances, provide forward-looking and innovative technical suggestions, and improve the technical content of the project.

[0036] (3) Code generation and standardization: The large model can automatically generate code frameworks and standard code segments according to code development requirements, improve coding efficiency, unify code styles, reduce errors caused by manual coding, and improve code quality.

[0037] (4) Reduce repetitive work: By automatically generating quasi-scripts, the repetitive work of developers is greatly reduced, allowing developers to focus more on creative tasks.

[0038] This embodiment generates a quasi-script corresponding to the code development requirements based on a large model; thereby, not only the generation quality of the quasi-script corresponding to the product requirements is improved, but also the generation efficiency of the quasi-script is improved.

[0039] This embodiment uses a big model to parse the product requirement document, and uses the big model to perform code encoding based on the code development requirements automatically generated after the analysis and the original code corresponding to the code development requirements. As a result, not only the communication costs and misunderstandings between developers and product managers are reduced, and the accuracy of understanding product requirements is improved, but also the repetitive work of developers is reduced and the efficiency of code development is improved.

[0040] In a preferred implementation of this embodiment, the method further includes: obtaining the user's project code development requirements; querying the target code corresponding to the project code development requirements from the local code library to generate a project knowledge graph.

[0041] Here, the project knowledge graph can be understood as a data structure that represents entities and their relationships, and is used to help the big model understand the code and data relationships in the project.

[0042] Specifically, the project knowledge graph of this embodiment includes but is not limited to the following contents: definition of the data model used by the project; definition of the API provided by the project to the outside world; definition of the external API that the project depends on; definition of the content of the third-party libraries used by the project; definition of the coding specifications required by the project; definition of the directory structure of the project; definition of the class templates used in the project; description of the core classes and core interfaces in the project; and definition of the project's architecture description.

[0043] This embodiment can visualize the classes, functions, modules and their relationships in the project by constructing a project knowledge graph. As the source of the original code input by the big model, the project knowledge graph can help the big model understand the relationship between the codes in the project and improve the accuracy of the big model's coding processing.

[0044] In a preferred implementation manner of this embodiment, the method further includes: performing a legality check on the code development requirements to generate a verified code development requirement; and / or performing a legality check on the quasi-script to generate a verified quasi-script; and parsing and cleaning the verified quasi-script and storing it in a local database.

[0045] Here, since the quasi-script output by the large model carries the transmission information related to the large model, the quasi-script needs to be parsed and cleaned when it is stored locally to remove the transmission information related to the large model, so as to obtain the cleaned script information.

[0046] Therefore, this embodiment can avoid data errors caused by the illusion of the large model itself through legality verification, thereby improving the quality of the results output by the large model.

[0047] In a preferred implementation of this embodiment, the method further includes: generating an original code library based on the original code corresponding to each code development requirement; debugging the quasi-script based on the original code library to generate a debugged quasi-script; and visually displaying the quasi-script through a web page. Thus, the accuracy of the quasi-script is improved through debugging, and errors that occur when making code changes in a large model are avoided. Finally, the quasi-script is displayed in the form of a webUI, which improves the user experience.

[0048] In a preferred implementation of this embodiment, the method further includes: calling a large model interface to encode a number of the code development requirements and quasi-scripts, and outputting test cases and test scripts; based on the test cases and the test scripts, performing functional testing on the debugged quasi-scripts to generate test results. This embodiment automatically generates test cases and test scripts, thereby being able to more quickly discover and fix problems in the code, which not only improves overall development efficiency and code stability; but also improves test coverage and test efficiency.

[0049] like Figure 2 As shown, it is a flowchart of generating a quasi-script corresponding to the code development requirement in one embodiment of the present invention.

[0050] Generate a quasi-script corresponding to the code development requirements; at least include the following steps:

[0051] S201, encapsulating the original code and the code development requirements through DSL, and outputting the encapsulated original code and the encapsulated code development requirements;

[0052] S202, calling the large model interface to perform code encoding processing on the encapsulated original code and the encapsulated code development requirements, and outputting a quasi-script corresponding to the code development requirements.

[0053] Specifically, DSL (Domain-Specific Language) is used to indicate a domain-specific language, which is mainly a programming language designed for a specific domain and can more efficiently describe and solve problems in that domain.

[0054] This embodiment uses DSL to encapsulate the original code and the code development requirements, so that the big model can understand and process the code generation task in a simpler and more intuitive way, thereby reducing the ambiguity and complexity caused by the common language; and improving the efficiency and accuracy of the big model in code encoding processing of the original code and code development requirements.

[0055] This embodiment automatically generates a quasi-script corresponding to the code development requirements based on a large model, thereby improving the efficiency and quality of quasi-script generation.

[0056] The following will describe in detail a method for generating scripts based on product requirements provided by this embodiment in conjunction with specific application scenarios.

[0057] A method for generating a script based on product requirements, applied to a first device, at least comprising the following steps:

[0058] S1, obtain the user's project code development requirements and product requirement documents;

[0059] S2, querying the target code corresponding to the project code development requirements from the local code library to generate a project knowledge graph; wherein the project knowledge graph is used to indicate the target code library corresponding to the project;

[0060] S3, calls the GPT-4 model API interface to parse the product requirement document and generate several code development requirements; and performs a legality check on each code development requirement to generate a verified code development requirement;

[0061] S4, for any verified code development requirement: query the original code corresponding to the verified code development requirement from the project knowledge graph; call the large model interface to perform code encoding processing on the original code and the code development requirement, and generate a quasi-script corresponding to the code development requirement; wherein, the project knowledge graph is used to indicate the target code library corresponding to the project; perform legality verification on the quasi-script to generate a verified quasi-script; and store the verified quasi-script in the local database.

[0062] S5, generating an original code library based on the original code corresponding to each code development requirement; debugging the quasi-script based on the original code library to generate a debugged quasi-script.

[0063] S6, calling the GPT-4 model API interface to encode several code development requirements and quasi-scripts, and output test cases and test scripts;

[0064] S7, based on the test case and the test script, perform functional testing on the debugged quasi-script to generate a test result.

[0065] S8, visually displaying the quasi-script in the test result through a web page.

[0066] In this embodiment, GPT-4 actually performs best in terms of demand understanding and script generation. For this reason, GPT-4 is selected as the underlying capability provider for demand understanding and code generation, and functions are encapsulated on its basis. The needs for analysis, understanding and code generation are gradually decomposed and generated in the manner of a product production line. By calling the API interface provided by GPT-4, the initial product requirements are produced as scripts, which are finally displayed to users for viewing. Therefore, during the project development process, not only the quality of quasi-scripts corresponding to product requirements and coding efficiency are improved, but also the user experience is improved.

[0067] like Figure 3 FIG. 1 is a schematic diagram of the structure of an apparatus for generating scripts based on product requirements in one embodiment of the present invention.

[0068] A device for generating scripts based on product requirements, applied to a first device; the device 300 includes: a parsing module 301, used to call a large model interface to parse a product requirement document to generate a number of code development requirements; an encoding module 302, used for: for any code development requirement: querying the original code corresponding to the code development requirement from the project knowledge graph; calling the large model interface to perform code encoding on the original code and the code development requirement to generate a quasi-script corresponding to the code development requirement; wherein the project knowledge graph is used to indicate a target code library corresponding to a project; a first generating module 303, used to generate a quasi-script corresponding to the product requirement based on the quasi-script corresponding to each of the code development requirements.

[0069] In a preferred implementation of this embodiment, the device also includes: an acquisition module for acquiring the user's project code development requirements; a second generation module for querying the target code corresponding to the project code development requirements from the local code library to generate a project knowledge graph.

[0070] In a preferred implementation manner of this embodiment, the third generation module is used to perform a legality check on the code development requirements to generate verified code development requirements; and / or, perform a legality check on the quasi-script to generate a verified quasi-script; and parse and clean the verified quasi-script and store it in a local database.

[0071] In a preferred implementation manner of this embodiment, the encoding module includes: an encapsulation processing unit, which is used to encapsulate the original code and the code development requirements through DSL, and output the encapsulated original code and the encapsulated code development requirements; a code encoding processing unit, which is used to call the large model interface to perform code encoding processing on the encapsulated original code and the encapsulated code development requirements, and output a quasi-script corresponding to the code development requirements.

[0072] In a preferred implementation manner of this embodiment, the large model interface includes but is not limited to the API interface of GPT-4, iFlytek Spark, Alitong YiQianwen, Baidu Wenxin Yiyan, or ChatGLM.

[0073] In a preferred implementation manner of this embodiment, the device also includes: a fourth generation module, which is used to generate an original code library based on the original code corresponding to each code development requirement; a fifth generation module, which is used to debug the quasi-script based on the original code library to generate a debugged quasi-script.

[0074] In a preferred implementation manner of this embodiment, the device also includes: an output module, which is used to call the large model interface to encode several of the code development requirements and quasi-scripts, and output test cases and test scripts; a testing module, which is used to perform functional testing on the debugged quasi-scripts based on the test cases and the test scripts, and generate test results.

[0075] In a preferred implementation manner of this embodiment, the device further includes: a display module, which is used to visually display the quasi-script in the form of a web page.

[0076] The above device can execute a method for generating scripts based on product requirements provided in an embodiment of the present invention, and has functional modules and beneficial effects corresponding to executing a method for generating scripts based on product requirements. For technical details not fully described in this embodiment, please refer to a method for generating scripts based on product requirements provided in an embodiment of the present invention.

[0077] The present invention also provides an electronic device, comprising: a processor; a memory for storing executable instructions of the processor; the processor is used to read the executable instructions from the memory and execute the instructions to implement a method for generating scripts based on product requirements described in the present invention.

[0078] In addition to the above-mentioned methods and devices, an embodiment of the present application may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the method according to various embodiments of the present application described in the above-mentioned "Exemplary Method" section of this specification.

[0079] The computer program product may be written in any combination of one or more programming languages ​​to write program codes for performing the operations of the embodiments of the present application, including object-oriented programming languages, such as Java, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0080] In addition, an embodiment of the present application may also be a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes the steps of the method according to the following embodiments of the present application described in the above "Exemplary Method" section of this specification.

[0081] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0082] The basic principles of the present application are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present application are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present application. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, not for limitation, and the above details do not limit the present application to being implemented by adopting the above specific details.

[0083] The block diagrams of the devices, apparatuses, equipment, and systems involved in this application are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagram. As will be appreciated by those skilled in the art, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including", "comprising", "having", etc. are open words, referring to "including but not limited to", and can be used interchangeably with them. The words "or" and "and" used here refer to the words "and / or" and can be used interchangeably with them, unless the context clearly indicates otherwise. The words "such as" used here refer to the phrase "such as but not limited to", and can be used interchangeably with them.

[0084] It should also be noted that in the apparatus, device and method of the present application, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present application.

[0085] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present application. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present application. Therefore, the present application is not intended to be limited to the aspects shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

[0086] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present application to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.

[0087] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification and the features of different embodiments or examples, unless they are contradictory.

[0088] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0089] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A method for generating scripts based on product requirements, characterized in that: Applicable to a first device; comprising: Call the large model interface to parse the product requirement document and generate several code development requirements; For any code development requirement: query the original code corresponding to the code development requirement from the project knowledge graph; call the large model interface to perform code encoding processing on the original code and the code development requirement, and generate a quasi-script corresponding to the code development requirement; wherein the project knowledge graph is used to indicate the target code library corresponding to the project; Based on the quasi-script corresponding to each of the code development requirements, a quasi-script corresponding to the product requirement is generated.

2. The method according to claim 1, characterized in that Also includes: Obtain the user's project code development requirements; Query the target code corresponding to the project code development requirements from the local code library and generate a project knowledge graph.

3. The method according to claim 1, characterized in that Also includes: Performing a legality check on the code development requirements and generating verified code development requirements; And / or, the quasi-script is subjected to a legality check to generate a verified quasi-script; and the verified quasi-script is parsed and cleaned and then stored in a local database.

4. The method according to claim 1, characterized in that The calling of the large model interface performs code encoding processing on the original code and the code development requirements to generate a quasi-script corresponding to the code development requirements; including: Encapsulate the original code and the code development requirements through DSL, and output the encapsulated original code and the encapsulated code development requirements; The large model interface is called to perform code encoding processing on the encapsulated original code and the encapsulated code development requirements, and a quasi-script corresponding to the code development requirements is output.

5. The method according to claim 1, characterized in that The large model interface includes but is not limited to the API interface of GPT-4, iFlytek Spark, Alitong YiQianwen, Baidu Wenxin Yiyan, or ChatGLM.

6. The method according to claim 1, characterized in that Also includes: Generate an original code library based on the original code corresponding to each code development requirement; Based on the original code base, the quasi-script is debugged to generate a debugged quasi-script.

7. The method according to claim 6, characterized in that Also includes: Calling the large model interface to encode several code development requirements and quasi-scripts, and outputting test cases and test scripts; Based on the test case and the test script, a functional test is performed on the debugged quasi-script to generate a test result.

8. The method according to claim 1 or 6, characterized in that: Also includes: The quasi-script is visually displayed via a web page.

9. A device for generating scripts based on product requirements, characterized in that: Applicable to a first device; comprising: The parsing module is used to call the large model interface to parse the product requirement document and generate several code development requirements; The encoding module is used for: querying the original code corresponding to the code development requirement from the project knowledge graph for any code development requirement; calling the large model interface to perform code encoding processing on the original code and the code development requirement, and generating a quasi-script corresponding to the code development requirement; wherein the project knowledge graph is used to indicate the target code library corresponding to the project; The first generating module is used to generate a quasi-script corresponding to the product requirement based on the quasi-script corresponding to each code development requirement.

10. A computer readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method according to any one of claims 1 to 8.

Citation Information

Cited By

  • System and method for DSL-based program generation using llm

    WO2026173294A1