Method and apparatus for automatically generating a program based on IBM AS400

By automatically generating the program running framework and adjusting the program template on the IBM AS400 platform, the problem of irregular code and high time consumption in RPG program development is solved, and standardized program code is quickly generated.

CN114756221BActive Publication Date: 2025-08-01INSPUR BUSINESS MACHINE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210427508.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-22
Publication Date
2025-08-01
Estimated Expiration
2042-04-22

AI Technical Summary

Technical Problem

RPG program development has problems on the IBM AS400 platform where new programs are written for a long time, code is not standardized, program processing process interface definitions are not standardized, and program job communication definitions are not standardized.

Method used

Provides an automatic program generation method based on IBM AS400. By obtaining target operation requirements, a program running framework is generated, and the program templates to be adjusted are adjusted to generate program code based on RPG language.

Benefits of technology

It greatly reduces the code writing time, and the generated program code is standardized and meets the requirements, improving programming efficiency and code readability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114756221B_ABST
    Figure CN114756221B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for automatically generating a program based on IBM AS400, including: obtaining target running requirements; generating a program running framework according to the target running requirements; the program running framework includes a plurality of program templates to be adjusted; adjusting the program templates to be adjusted to generate program code based on the RPG language. According to the target running requirements input by the user, a standardized program template to be adjusted can be automatically generated; then, by adjusting the program template to be adjusted, standardized and compliant program code can be obtained. Since the user only needs to input the target running requirements and adjust the program template to be adjusted to generate program code, the time for code writing is greatly reduced. The present invention also provides a device, a device and a storage medium, which also have the above beneficial effects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of program generation, and in particular to a method for automatically generating a program based on IBM AS400, a device for automatically generating a program based on IBM AS400, a device for automatically generating a program based on IBM AS400, and a computer-readable storage medium. Background Art

[0002] As a minicomputer mainly promoted by IBM, IBM AS400 is used by millions of users in the fields of finance, retail, insurance, etc. Many IBM AS400 program developments use the RPG language for development. RPG stands for Report Program Generator, that is, a report program generation language. The main functions of an RPG program include implementing online / batch transactions by accessing a database, providing a human-computer access interface through an interactive program, and implementing functional modules such as socket communication through an API (Application Programming Interface), etc.

[0003] A complete set of RPG application programs includes: database file definition, service program definition, functional module program definition, independent data structure definition, operating environment parameter definition, communication module definition, external access interface design, etc., interactive interface definition, print output document definition, etc. Due to the unique programming rules of RPG programs, the development of RPG programs generally has problems such as the need for a large amount of time to write new programs and non-standard code forms. Therefore, how to provide a form-standardized code for IBM AS400 quickly is an urgent problem to be solved by those skilled in the art. Summary of the Invention

[0004] The purpose of the present invention is to provide a method for automatically generating a program based on IBM AS400, which can quickly generate form-standardized code; another purpose of the present invention is to provide a device for automatically generating a program based on IBM AS400, a device for automatically generating a program based on IBM AS400, and a computer-readable storage medium, which can quickly generate form-standardized code.

[0005] To solve the above technical problems, the present invention provides a method for automatically generating a program based on IBM AS400, including:

[0006] Obtaining a target operation requirement;

[0007] Generating a program operation framework according to the target operation requirement; the program operation framework includes a plurality of program templates to be adjusted;

[0008] Adjusting the program templates to be adjusted to generate a program code based on the RPG language.

[0009] Optionally, the program template to be adjusted includes a database DDS definition template, a program flow control template, a program function module template, a program common parameter declaration template, a program common module template, a program output template, a running environment definition template, and an independent data structure definition template.

[0010] Optionally, adjusting the program template to be adjusted to generate program code based on the RPG language includes:

[0011] Adjust the program template to be adjusted and compile it into a service program;

[0012] Use the service program as a parameter for generating a program to perform program compilation to obtain program code based on the RPG language.

[0013] Optionally, it is characterized in that adjusting the program template to be adjusted to generate program code based on the RPG language includes:

[0014] Add a file declaration, a data structure definition, and data processing logic statements in a preset format to the program template to be adjusted to generate program code based on the RPG language.

[0015] Optionally, adjusting the program template to be adjusted to generate program code based on the RPG language includes:

[0016] Obtain keywords;

[0017] Based on the pseudocode, call a code generation script to adjust the program template to be adjusted according to the keywords to generate program code based on the RPG language.

[0018] Optionally, after generating the program code based on the RPG language, it further includes:

[0019] Call an entry program to test the program code to obtain a test result.

[0020] Optionally, after generating the program code based on the RPG language, it further includes:

[0021] When the program code is generated, register the program code.

[0022] The present invention also provides a program automatic generation device based on IBM AS400, including:

[0023] A requirement acquisition module for acquiring a target running requirement;

[0024] A framework generation module for generating a program running framework according to the target running requirement; the program running framework includes a plurality of program templates to be adjusted;

[0025] A code generation module, configured to adjust the to-be-adjusted program template and generate a program code based on the RPG language.

[0026] The present invention also provides a program automatic generation device based on IBM AS400, including:

[0027] A memory, configured to store a computer program;

[0028] A processor, configured to implement the steps of the program automatic generation method based on IBM AS400 as described in any one of the above when executing the computer program.

[0029] The present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the program automatic generation method based on IBM AS400 as described in any one of the above are implemented.

[0030] A program automatic generation method based on IBM AS400 provided by the present invention includes: obtaining a target operation requirement; generating a program operation framework according to the target operation requirement; the program operation framework includes a plurality of to-be-adjusted program templates; adjusting the to-be-adjusted program templates to generate a program code based on the RPG language.

[0031] According to the target operation requirement input by a user, a standard to-be-adjusted program template can be automatically generated; then, by adjusting the to-be-adjusted program template, a standard and compliant program code can be obtained. Since the user only needs to input the target operation requirement and adjust the to-be-adjusted program template to generate the program code, the time for code writing is greatly reduced.

[0032] The present invention also provides a program automatic generation device based on IBM AS400, a program automatic generation device based on IBM AS400, and a computer-readable storage medium, which also have the above beneficial effects. Description of the Drawings

[0033] In order to more clearly illustrate the technical solutions of the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required to be used in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0034] Figure 1 It is a flowchart of a program automatic generation method based on IBM AS400 provided by an embodiment of the present invention;

[0035] Figure 2 A flowchart of a specific method for automatically generating a program based on IBM AS400 provided by an embodiment of the present invention;

[0036] Figure 3 A structural block diagram of a device for automatically generating a program based on IBM AS400 provided by an embodiment of the present invention;

[0037] Figure 4 A structural block diagram of a device for automatically generating a program based on IBM AS400 provided by an embodiment of the present invention. Specific implementation manners

[0038] The core of the present invention is to provide a method for automatically generating a program based on IBM AS400. In the prior art, there are generally the following difficulties in the development of RPG programs: a large amount of time is required for writing new programs; there are a large number of non-standardities in program codes; there are non-standardities in the definition of the interface of the program processing process; there are non-standardities in the definition of the communication between jobs in the program; there are non-standardities in the algorithms for the program to control things.

[0039] A method for automatically generating a program based on IBM AS400 provided by the present invention includes: obtaining target operation requirements; generating a program operation framework according to the target operation requirements; the program operation framework includes a plurality of program templates to be adjusted; and adjusting the program templates to be adjusted to generate program codes based on the RPG language.

[0040] According to the target operation requirements input by the user, a standard program template to be adjusted can be automatically generated; and then, by adjusting the program template to be adjusted, standard and compliant program codes can be obtained. Since the user only needs to input the target operation requirements and adjust the program template to be adjusted to generate program codes, the time for writing codes is greatly reduced.

[0041] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific implementation manners. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0042] For the IBM AS400 minicomputer, the typical online transaction processing process includes:

[0043] First, the external input is sent to the communication port of the core host through the message via the enterprise bus or the integrated front-end. Then, there can be one or more communication ports of the core host, and each port has one or more servo programs for processing. Next, the communication handle is sent to the dispatching job. After the dispatching job completes the message parsing and transaction information statistics, it is sent to different data queues according to the transaction code parsed from the message. Finally, the online job obtains the communication handle and the transaction message by reading the data in the data queue, encapsulates it through the main control platform transaction, and performs business calculations by calling specific transaction processing modules, updates the account data. After completing the print output, it sends the transaction processing result message to the transaction initiating end through the communication session, and closes the communication session after negotiation.

[0044] Correspondingly, the above online transaction process includes multiple parts such as a communication service program, a job dispatching process, a transaction statistics program, a transaction processing program, and a print output program. Among them, the communication processing is completed in the communication program and the transaction end program, and the communication handle and the communication message are passed between programs or jobs as parameters. The communication module has a similar processing logic, but the listened ports are different; the main control program has a similar logic, and the transaction processing module is configured with a matching transaction processing module according to the number of transactions to be processed. For the above scenario, the application needs to configure program types such as a communication program, a message processing program, a job dispatching program, a main control program, a transaction processing module, and a print output program. Each program type corresponds to a specific program template.

[0045] The typical batch program processing flow usually includes two parts: a batch control program and a batch execution program. The batch running process includes multiple different stages, and different transaction contents are run in each stage. Multiple jobs are run in parallel to improve the running speed. After each batch job runs to completion, it needs to notify the batch control job. The batch control job needs to control the execution status of the current batch of jobs, and only after the current batch of jobs runs to completion can the job content of the next batch be submitted. This process includes a batch control job and a batch execution job. The batch execution job needs to schedule different execution modules. For example, in banking batches, relevant business modules such as batch collection and payment calculation, personal loan due repayment, credit card automatic repayment, regular automatic transfer, fund regular investment, and interest settlement processing will be called. This process requires generating a batch control program template, a batch job template, etc.

[0046] Please refer to Figure 1 , Figure 1 which is a flowchart of a method for automatically generating a program based on IBM AS400 provided by an embodiment of the present invention.

[0047] See Figure 1 In an embodiment of the present invention, the method for automatically generating a program based on IBM AS400 includes:

[0048] S101: Obtain the target operation requirements.

[0049] In this step, the user first needs to input the target operation requirements, which are the operation requirements for the tasks to be executed according to the actual needs of the user. The specific content of the operation requirements can be set according to the actual situation and will not be specifically limited here. For example, the target operation requirements input here can specifically be to execute the above-mentioned online transaction processing or batch program processing, etc.

[0050] S102: Generate a program operation framework according to the target operation requirements.

[0051] In the embodiment of the present invention, the program operation framework includes multiple program templates to be adjusted.

[0052] In this step, it is necessary to generate a corresponding program operation framework according to the above-mentioned target operation requirements, and this program operation framework usually needs to include multiple program templates to be adjusted. In the embodiment of the present invention, the above-mentioned program templates to be adjusted include database DDS definition templates, program flow control templates, program function module templates, program common parameter declaration templates, program common module templates, program output templates, operation environment definition templates, and independent data structure definition templates. Each of the above templates is a program code function module involved in AS400 programming. For example, DDS (abbreviation for data description specifications, similar to the definition syntax of SQL, used to define database structures such as tables, views, and indexes, and is a dedicated syntax structure for defining the internal structure of the database in AS400) is a script definition for defining the database structure in AS400. Since AS400 embeds the DB2 / 400 database, an important step in AS400 programming is to define the database structure; the flow control template is used to design the control module and control the call of the next-level module of the program according to the input parameters; the program function module template is used to define the implementation of specific transaction algorithms; the program common parameter declaration template is used to define the assignment of global or local constants or variables; the program common module template is used to define the declaration of common functions or procedures, such as password verification algorithms, interest calculation algorithms, etc.; the program output template is used to define the program output, such as outputting the user details query result, outputting the transaction confirmation output, etc.; the operation environment definition template is used to define the date format, define the precision of interest calculation, define the next interest settlement date, etc.; the independent data structure definition template, such as communication message format definition, encryption key, communication IP, port definition, etc.

[0053] The program running framework with standardized format generated in this step includes program templates for each key module, and may also include communication program templates, main control program templates, interaction program templates, transaction processing program templates, print output program templates, etc. The functional program templates included in the program running framework can be set according to actual situations and are not specifically limited here.

[0054] S103: Adjust the program template to be adjusted to generate program code based on the RPG language.

[0055] In this step, it is necessary to adjust the above-mentioned program template to be adjusted, so as to finally generate program code based on the RPG language and applicable to IBM AS400.

[0056] Specifically, this step generally includes: adjusting the program template to be adjusted and compiling it into a service program; using the service program as a parameter for generating a program to perform program compilation to obtain program code based on the RPG language.

[0057] The service program is the Service Program, which provides functions, variables, or constants externally through binding to the Module. The compilation process of AS400 is relatively complex. The common code is compiled into modules, and the public variables and functions that need to be externally called in the modules need to be declared as Export through the binding directory script. That is, in this step, the adjusted program template to be adjusted will be first compiled into a service program. After all the modules are compiled into service programs, they will be used as parameters for generating programs to perform program compilation, and finally executable program code will be generated.

[0058] Specifically, for the database DDS definition template, since IBM AS400 is essentially an integrated database machine, many programs running on AS400 interact with the database. Before defining the program code, it is also an important process to define the database to be used. The built-in database of IBM AS400 is DB2 / 400, which integrates the characteristics of file-based databases and relational databases. The data of the database can be accessed and defined through SQL statements. Each specific database object (table, index, view, stored procedure, trigger) is represented as a specific file object. The database-assisted design provided in the embodiments of the present invention uses the DDS definition method, and the stored procedures and triggers adopt the automatic generation algorithm for external stored procedures and triggers.

[0059] For the program flow control template, it mainly provides program control code snippets required for various programming for C, CL, and RPG. Specifically, the program flow control template usually includes on-line transaction control flow, batch service control flow, service maintenance control flow, and data maintenance control flow; among them, the on-line transaction control flow includes communication control flow, main control flow, and service processing control flow; and the communication control flow includes server communication program and client communication program; while the batch service control flow can include concurrent job control flow, job scheduling control flow, and service processing control flow.

[0060] For the program function module template, it usually includes file declaration, data structure declaration, statement start keyword, closed-loop design of control statements, design pattern of SUBSR…ENDSR, design of PROC…ENDPR, variable and function declaration part, strict control of input variables, operators, and output variables; among them, the data structure declaration includes / COPY external file declaration reference, DCL-S variable declaration, DCL-C constant declaration, DCL-DS data structure declaration, pointer reference declaration, and array declaration; the closed-loop design of control statements usually includes DOW…ENDDO, FOR…ENDFOR, IF…ELSE…ENDIF, DO…UNTIL, SWITCH…ENDSL, etc.; the strict control of input variables, operators, and output variables usually includes type compatibility, variable length compatibility, format or type conversion compatibility, etc.

[0061] For the running environment definition template, it mainly includes subsystem definition, job queue definition, job description definition, output queue definition, etc.

[0062] The above-mentioned program templates to be adjusted are usually only a general content. In this step, according to the specific program implementation requirements, each program template to be adjusted needs to be adjusted to make it have corresponding functions, and finally obtain the program code corresponding to the entire program. It should be noted that by adjusting the running environment definition template of the running environment and modifying the components of the automatically generated code, multiple processing options can be provided for specific function modules. For example, inter-process communication can use different options such as files, data areas, data domains, data queues, and user queues. Different options use different declarations, and different write and read operations also require corresponding functions and parameters.

[0063] The specific content of this step will be introduced in detail in the following invention embodiments and will not be elaborated here.

[0064] A method for automatically generating a program based on IBM AS400 provided by an embodiment of the present invention includes: obtaining target running requirements; generating a program running framework according to the target running requirements; the program running framework includes a plurality of program templates to be adjusted; adjusting the program templates to be adjusted to generate program code based on the RPG language.

[0065] According to the target running requirements input by the user, a standardized program template to be adjusted can be automatically generated; then, by adjusting the program template to be adjusted, standardized and compliant program code can be obtained. Since the user only needs to input the target running requirements and adjust the program template to be adjusted to generate the program code, the time for code writing is greatly reduced.

[0066] Specific content regarding a method for automatically generating a program based on IBM AS400 provided by the present invention will be described in detail in the following embodiments of the invention.

[0067] Please refer to Figure 2 , Figure 2 which is a flowchart of a specific method for automatically generating a program based on IBM AS400 provided by an embodiment of the present invention.

[0068] See Figure 2 In an embodiment of the present invention, the method for automatically generating a program based on IBM AS400 includes:

[0069] S201: Obtain target running requirements.

[0070] S202: Generate a program running framework according to the target running requirements.

[0071] The above S201 to S202 are basically the same as S101 to S102 in the above-mentioned embodiment of the invention. For detailed content, please refer to the above-mentioned embodiment of the invention and will not be elaborated here.

[0072] S203: Add file declarations, data structure definitions, and data processing logic statements in a preset format to the program templates to be adjusted to generate program code based on the RPG language.

[0073] In an embodiment of the present invention, two specific ways of adjusting the program templates to be adjusted are specifically provided. The first is like S203, directly adding a preset format to the program templates to be adjusted, that is, adding file declarations, data structure definitions, and data processing logic statements with a unified format to ensure the unified and standardized format of the finally generated program code. The specific content of the file declarations, data structure definitions, and data processing logic statements needs to be set according to the actual situation and will not be specifically limited here.

[0074] S204: Obtain keywords.

[0075] The first way to adjust the program template to be adjusted is as shown in S204 to S205. In this step, keywords need to be obtained. The keywords usually represent: specifying the parameter definitions to be input, the IO operations to be performed, making conditional judgments according to specific conditions, determining the program modules to be called, and specifying the output formats to be generated. The specific content of the keywords needs to be set according to the actual situation and will not be specifically limited here.

[0076] S205: Based on the pseudocode, call the code generation script to adjust the program template to be adjusted according to the keywords, and generate program code based on the RPG language.

[0077] In this step, specifically, through the pseudocode and the code generation script based on the above input keywords, the program template to be adjusted is adjusted to generate the final program code. This step usually includes two situations: First, based on the pre - defined keywords and corresponding parameters, generate corresponding code snippets. For example, DCLF+U+A+DISK+COMMIT[CUSTOMER] is used to define and declare the data table file CUSTOMER, opened in update mode, supporting append record operations, database file attributes, and supporting transaction processing. Second, directly add calculation parts, such as READ CUSTOMER.

[0078] In this step, the specific program logic to be implemented is prompted through configuration parameters and pseudocode, and program code is automatically generated according to the background template. For the program generated in this way, the parameter declarations adopt a fixed format, the program modules use standardized programming codes, and the success rate and operation efficiency of the operation are guaranteed to a certain extent.

[0079] S206: Call the entry program to test the program code and obtain the test results.

[0080] That is, in this step, specifically call the entry program, input parameters to start the test program, and verify the program running process and calculation results through interactive operations or modifying the running process. Specifically, the above - automatically generated program code can be directly compiled and run. The program code itself has debugging output code, and in the debug mode, it can output the calculation results of the intermediate process of the program, the history of module calls, and the return code to reduce the debugging difficulty of the code.

[0081] S207: When the program code is generated, register the program code.

[0082] In this step, it can be combined with version control tools such as Git and Rational Concert. When generating a new code program, the registration process of the new code program is automatically realized, which is convenient for code management and maintenance in team development.

[0083] In the program running framework provided by the embodiments of the present invention, examples (demos) of various typical codes can be built-in. Taking the server-side communication program as an example, it provides processing codes based on blocking and non-blocking program processing codes; it provides complete code snippets from establishing a socket handle, binding an IP and a local port, listening, receiving client requests, sending data, receiving data, and closing the socket handle. For the processing of socket connections, it provides complete code for the processing in the current process, the processing in the spawned subprocess, and the cross-process handle passing through givedescriptor() and takedescriptor().

[0084] A method for automatically generating a program based on IBM AS400 provided by the embodiments of the present invention is different from commercial case tools or code generation tools (Code Generation) on the market. The embodiments of the present invention focus on the IBM AS400 environment and commercial software usage scenarios. In addition to being able to automatically generate functional codes, it provides a professional environment in aspects such as program compilation, permission management of program objects, implementation of functional modules, and correction of templates. In the case of clear requirements, it can quickly develop a program prototype, while realizing the program functions, providing accuracy and precision, and ensuring the standardization and readability of the program codes. The focus of the embodiments of the present invention is on rapid program code development, and it provides rapid implementation of codes for various standard scenarios. By simply adjusting, it can achieve the specified functions. Compared with other case tools, the code programs generated by this patent have higher integrity and can be directly compiled and run. The embodiments of the present invention encapsulate the code generation, code permission management, and compilation process involved in programming, facilitating the rapid processing of AS400 program writing.

[0085] Next, a device for automatically generating a program based on IBM AS400 provided by the embodiments of the present invention will be introduced. The device for automatically generating a program based on IBM AS400 described below can be correspondingly referred to the method for automatically generating a program based on IBM AS400 described above.

[0086] Please refer to Figure 3 , Figure 3 which is a structural block diagram of a device for automatically generating a program based on IBM AS400 provided by the embodiments of the present invention. Referring to Figure 3 , the device for automatically generating a program based on IBM AS400 may include:

[0087] A requirement acquisition module 100, configured to acquire a target operation requirement.

[0088] A framework generation module 200, configured to generate a program running framework according to the target operation requirement; the program running framework includes a plurality of program templates to be adjusted.

[0089] A code generation module 300, configured to adjust the to-be-adjusted program template to generate a program code based on the RPG language.

[0090] Preferably, in the embodiment of the present invention, the to-be-adjusted program template includes a database DDS definition template, a program flow control template, a program function module template, a program common parameter declaration template, a program common module template, a program output template, a running environment definition template, and an independent data structure definition template.

[0091] Preferably, in the embodiment of the present invention, the code generation module 300 includes:

[0092] A service program unit, configured to adjust the to-be-adjusted program template and compile it into a service program.

[0093] A program code unit, configured to use the service program as a parameter for generating a program to perform program compilation, and obtain a program code based on the RPG language.

[0094] Preferably, in the embodiment of the present invention, the code generation module 300 is configured to:

[0095] Add a file declaration, a data structure definition, and data processing logic statements in a preset format to the to-be-adjusted program template to generate a program code based on the RPG language.

[0096] Preferably, in the embodiment of the present invention, the code generation module 300 includes:

[0097] A keyword acquisition unit, configured to acquire keywords.

[0098] A pseudocode unit, configured to, based on pseudocode, call a code generation script to adjust the to-be-adjusted program template according to the keywords, and generate a program code based on the RPG language.

[0099] Preferably, in the embodiment of the present invention, it further includes:

[0100] A test module, configured to call an entry program to test the program code and obtain a test result.

[0101] Preferably, in the embodiment of the present invention, it further includes:

[0102] A registration module, configured to register the program code when the program code is generated.

[0103] The program automatic generation device based on IBM AS400 in this embodiment is used to implement the aforementioned program automatic generation method based on IBM AS400. Therefore, the specific implementation manners in the program automatic generation device based on IBM AS400 can be seen in the embodiment part of the program automatic generation method based on IBM AS400 in the foregoing text. For example, the requirement acquisition module 100, the framework generation module 200, and the code generation module 300 are respectively used to implement steps S101 to S103 in the aforementioned program automatic generation method based on IBM AS400. Therefore, the specific implementation manners can refer to the descriptions of the corresponding individual part embodiments and will not be elaborated herein.

[0104] Next, a program automatic generation device based on IBM AS400 provided by an embodiment of the present invention will be introduced. The program automatic generation device based on IBM AS400 described below can be correspondingly referred to the program automatic generation method based on IBM AS400 and the program automatic generation device based on IBM AS400 described above.

[0105] Please refer to Figure 4 , Figure 4 which is a structural block diagram of a program automatic generation device based on IBM AS400 provided by an embodiment of the present invention.

[0106] Referring to Figure 4 , the program automatic generation device based on IBM AS400 may include a processor 11 and a memory 12.

[0107] The memory 12 is used to store a computer program; the processor 11 is used to implement the specific content of the program automatic generation method based on IBM AS400 described in the above-mentioned embodiment of the present invention when executing the computer program.

[0108] In the program automatic generation device based on IBM AS400 in this embodiment, the processor 11 is used to install the program automatic generation device based on IBM AS400 described in the above-mentioned embodiment of the present invention. At the same time, the combination of the processor 11 and the memory 12 can implement the program automatic generation method based on IBM AS400 described in any of the above-mentioned embodiments of the present invention. Therefore, the specific implementation manners in the program automatic generation device based on IBM AS400 can be seen in the embodiment part of the program automatic generation method based on IBM AS400 in the foregoing text. The specific implementation manners can refer to the descriptions of the corresponding individual part embodiments and will not be elaborated herein.

[0109] The present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements a program automatic generation method based on IBM AS400 introduced in any of the above-described invention embodiments. The remaining content may refer to the prior art and will not be elaborated herein.

[0110] The embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the embodiments, reference can be made to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple. For the relevant parts, reference can be made to the description in the method section.

[0111] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in this article can be implemented by electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.

[0112] The steps of the methods or algorithms described in combination with the embodiments disclosed in this article can be directly implemented by hardware, software modules executed by a processor, or a combination of both. The software modules can be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium well-known in the technical field.

[0113] Finally, it should also be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising a..." does not exclude the existence of additional identical elements in the process, method, article or device comprising the element.

[0114] The above has introduced in detail a method for automatically generating a program based on IBM AS400, a device for automatically generating a program based on IBM AS400, a device for automatically generating a program based on IBM AS400, and a computer-readable storage medium. Specific examples are used in this article to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention. It should be noted that for those of ordinary skill in the art in this technical field, without departing from the principle of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the protection scope of the claims of the present invention.

Claims

1. A method for automatically generating a program based on IBM AS400, characterized in that, including: Obtain the target running requirements; Generate a program running framework according to the target running requirements; the program running framework includes multiple program templates to be adjusted; The program templates to be adjusted include a database DDS definition template, a program flow control template, a program function module template, a program common parameter declaration template, a program common module template, a program output template, a running environment definition template, and an independent data structure definition template; Obtain keywords; The keywords represent: specifying the parameter definitions to be input, the IO operations to be performed, making conditional judgments according to specific conditions, determining the program modules to be called, and specifying the output formats to be generated; Based on the pseudocode, call the code generation script to adjust the program templates to be adjusted according to the keywords, and generate program code based on the RPG language; Call the entry program to test the program code and obtain the test results; When the program code is generated, register the program code through a version control tool.

2. An automatic program generation device based on IBM AS400, characterized in that, including: A requirement acquisition module for obtaining the target running requirements; A framework generation module for generating a program running framework according to the target running requirements; the program running framework includes multiple program templates to be adjusted; The program templates to be adjusted include a database DDS definition template, a program flow control template, a program function module template, a program common parameter declaration template, a program common module template, a program output template, a running environment definition template, and an independent data structure definition template; A keyword acquisition unit for obtaining keywords; the keywords represent: specifying the parameter definitions to be input, the IO operations to be performed, making conditional judgments according to specific conditions, determining the program modules to be called, and specifying the output formats to be generated; A pseudocode unit for, based on the pseudocode, calling the code generation script to adjust the program templates to be adjusted according to the keywords and generate program code based on the RPG language; A test module for calling the entry program to test the program code and obtain the test results; A registration module for registering the program code through a version control tool when the program code is generated.

3. An automatic program generation device based on IBM AS400, characterized in that, including: A memory for storing computer programs; A processor for implementing the steps of the program automatic generation method based on IBM AS400 as described in claim 1 when executing the computer program.

4. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, and when the computer program is executed by the processor, the steps of the program automatic generation method based on IBM AS400 as described in claim 1 are implemented.

Citation Information

Patent Citations

  • A method and apparatus for program generation

    CN109408043A