A method and apparatus for automatically generating parameters

Through the combination of workbench components and compiler components, parameter codes are automatically generated, which solves the problems of low efficiency and inconsistent functions of existing parameter development, and realizes parameter development that quickly responds to business needs, improving development efficiency and consistency.

CN113157272BActive Publication Date: 2024-11-08CHINA CONSTRUCTION BANK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110528050.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-14
Publication Date
2024-11-08
Estimated Expiration
2041-05-14

AI Technical Summary

Technical Problem

The existing parameter development model is inefficient and needs to be developed from scratch when business needs change, resulting in developers wasting time and energy, and business logic and page layout cannot be accurately implemented, resulting in inconsistent functions with expectations.

Method used

The user-selected parameter page elements, business rules and database fields are obtained through the workbench component, and the compiler component is translated into technical messages, input into code framework components, generate front-end and back-end codes, and generate persistent layer database maps through reverse engineering File, perform automated testing to generate target parameters.

Benefits of technology

It realizes automatic parameter generation, reduces the repeated work of developers, avoids distortion in the delivery of business requirements, improves development efficiency and functional consistency, and saves development costs and communication costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113157272B_ABST
    Figure CN113157272B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for automatically generating parameters, and relates to the technical field of automatic program design. A specific implementation method includes obtaining parameter page element business messages through a workbench component, and a code framework component generates front-end code by reflection; obtaining business messages carrying user-defined parameter business rules and verification information through a workbench component, and the code framework component generates front-end logic code by reflection and generates back-end code through reverse engineering; obtaining database field business messages through a workbench component, and the code framework component obtains the corresponding persistence layer database mapping file through reverse engineering; obtaining full front-end code and back-end code based on the front-end code, front-end logic code, and persistence layer database mapping file to obtain full back-end code, and inputting it into the automated test component to generate target parameters. Thus, the present invention solves the problems of low efficiency of existing parameter development and inconsistency between completed functions and expectations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of automatic program design, and in particular to a method and device for automatically generating parameters. Background Art

[0002] Parameters are the basis for banks to apply scientific management, decision analysis and business processes. At present, large-scale information systems widely use parameter settings to achieve quantitative and accurate risk control and the rapid release of products and services. Parameters have been valued by more and more banks and financial institutions. In response to the needs of innovative development and integrated business, banks and financial institutions have begun to build a unified and centralized parameter management system. With the increase in business complexity and the diversity of service populations in the financial field, the speed of parameter iteration and optimization is getting faster and faster, and the development difficulty is increasing. Modularization and framework design and development of parameters will become a trend.

[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:

[0004] The conventional parameter development model nowadays will bring some problems. For example, during the development process, if the needs of business personnel change, developers will most likely need to develop from scratch. In addition, with the implementation of a large number of parameters, the business logic and page layout of the parameters have been summarized into similar or common patterns. However, from a technical dimension, each new parameter needs to be redeveloped, wasting a lot of time and energy. In addition, during the parameter design and development process, the problem often encountered is that business personnel do not understand technology, and technical personnel do not understand business. When business needs cannot be achieved with accurate and convenient technology and when the development results cannot meet business operations, the demand information will be distorted and distorted during the transmission process. The final result is that the developed parameters cannot cover business needs at best, and are completely contrary to business needs at worst, and the completed functions are inconsistent with expectations. Summary of the invention

[0005] In view of this, an embodiment of the present invention provides a method and device for automatically generating parameters, which can solve the problems of low efficiency of existing parameter development and inconsistency between completed functions and expectations.

[0006] To achieve the above-mentioned purpose, according to one aspect of an embodiment of the present invention, a method for automatically generating parameters is provided, comprising obtaining a business message carrying a parameter page element selected by a user through a workbench component, translating it into a technical message through a compiler component and inputting it into a code framework component, so as to generate a front-end code based on the parameter page element selected by the user;

[0007] The workbench component obtains the business message that carries the user-defined parameter business rules and verification information, and translates it into a technical message through the compiler component and inputs it into the code framework component, and then generates the front-end logic code based on the user-defined parameter business rules and verification information, and generates the back-end code through reverse engineering;

[0008] The business message carrying the user-defined database fields is obtained through the workbench component, translated into technical messages by the compiler component and input into the code framework component, and then the corresponding persistence layer database mapping file is obtained through reverse engineering based on the database fields;

[0009] The full front-end code obtained based on the front-end code and the front-end logic code, as well as the full back-end code obtained based on the back-end code and the persistence layer database mapping file, are input into the automated testing component for testing to generate target parameters.

[0010] Optionally, before obtaining the business message carrying the parameter page element selected by the user through the workbench component, the following steps are included:

[0011] The library component outputs the full parameter page element information to the compiler component through the technical message, and then the compiler component translates the technical message into a business message, and outputs it to the workbench component for display, so that the user can select the required page elements.

[0012] Optionally, it also includes: generating front-end HTML and CSS code based on the page element reflection of the parameters selected by the user.

[0013] Optionally, generate front-end HTML and CSS code based on user-selected parameters page element reflection, including:

[0014] The code framework component uses the parameter page element as an identifier and obtains the corresponding front-end HTML and CSS code through the htmlAndCssImp() method reflection.

[0015] Optionally, before obtaining the business message carrying the user-defined parameter business rules and verification information through the workbench component, the following steps are included:

[0016] The library component outputs all parameter business rules and verification information to the compiler component through technical messages, which are then translated into business messages by the compiler component and output to the workbench component for display, so that users can define parameter business rules and field value verification rules.

[0017] Optionally, the front-end logic code is generated based on the user-defined parameter business rules and verification information reflection, including:

[0018] The code framework component uses the parameter business rules and verification information defined by the user in the technical message as an identifier, and obtains the corresponding front-end js code through reflection through the jsImp() method.

[0019] Optionally, before obtaining the business message carrying the user-defined database field through the workbench component, the following steps are included:

[0020] The library component outputs the database field types required for all parameters to the compiler component through technical messages, which are then translated into business messages by the compiler component and output to the workbench component for display, so that users can define corresponding database field types for the already defined parameter page columns.

[0021] Optionally, the corresponding persistence layer database mapping file is obtained through reverse engineering based on the database fields, including:

[0022] The code framework component uses the user-defined database field in the technical message as an identifier, and obtains the corresponding persistence layer database mapping file through reverse engineering of the xmlImp() method; wherein the persistence layer database mapping file includes xml code and database script.

[0023] In addition, the present invention also provides a device for automatically generating parameters, including a workbench component, a compiler component, a code framework component and an automated testing component; wherein,

[0024] The business message carrying the parameter page element selected by the user is obtained through the workbench component, and is translated into a technical message through the compiler component and input into the code framework component to generate the front-end code based on the reflection of the parameter page element selected by the user;

[0025] The workbench component obtains the business message that carries the user-defined parameter business rules and verification information, and translates it into a technical message through the compiler component and inputs it into the code framework component, and then generates the front-end logic code based on the user-defined parameter business rules and verification information, and generates the back-end code through reverse engineering;

[0026] The business message carrying the user-defined database fields is obtained through the workbench component, translated into technical messages by the compiler component and input into the code framework component, and then the corresponding persistence layer database mapping file is obtained through reverse engineering based on the database fields;

[0027] The full front-end code obtained based on the front-end code and the front-end logic code, as well as the full back-end code obtained based on the back-end code and the persistence layer database mapping file, are input into the automated test component for testing to generate target parameters.

[0028] Optionally, it also includes a library component, wherein the library component outputs the full parameter page element information to the compiler component through a technical message, and then the compiler component translates the technical message into a business message, and outputs it to the workbench component for display, so that the user can select the required page elements.

[0029] Optionally, the code framework component uses the parameter page element as an identifier and obtains the corresponding front-end HTML and CSS codes through reflection through the htmlAndCssImp() method.

[0030] Optionally, it also includes a library component, wherein the library component outputs all parameter business rules and verification information to the compiler component through technical messages, which are then translated into business messages through the compiler component and output to the workbench component for display, so that users can define parameter business rules and field value verification rules.

[0031] Optionally, the code framework component generates front-end logic code based on user-defined parameter business rules and verification information reflection, including:

[0032] The code framework component uses the parameter business rules and verification information defined by the user in the technical message as an identifier, and obtains the corresponding front-end js code through reflection through the jsImp() method.

[0033] Optionally, it also includes a library component, wherein the library component outputs the database field types required for all parameters to the compiler component through technical messages, which are then translated into business messages by the compiler component and output to the workbench component for display, so that users can define corresponding database field types for the already defined parameter page fields.

[0034] Optionally, the code framework component obtains the corresponding persistence layer database mapping file through reverse engineering based on the database fields, including:

[0035] The code framework component uses the user-defined database field in the technical message as an identifier, and obtains the corresponding persistence layer database mapping file through reverse engineering of the xmlImp() method; wherein the persistence layer database mapping file includes xml code and database script.

[0036] One embodiment of the above invention has the following advantages or beneficial effects: The present invention summarizes common parameter page fields and element types, verification rules, and required data types, and develops a corresponding code framework on this basis, and encapsulates this framework into a parameter automation design platform (based on B / S structure). The specific function of the parameter automation design platform is to compile the technical points of the development into page information that business personnel understand. Business personnel will automatically call the methods encapsulated in the embedded framework by operating this workbench, and business personnel will generate the front-end and back-end codes of the parameters by themselves through the parameter automation design platform without the participation of developers.

[0037] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0039] Figure 1 is a schematic diagram of the main process of the method for automatically generating parameters according to the first embodiment of the present invention;

[0040] Figure 2 is a schematic diagram of the main process of the method for automatically generating parameters according to the second embodiment of the present invention;

[0041] Figure 3 is a schematic diagram of main modules of an apparatus for automatically generating parameters according to an embodiment of the present invention;

[0042] Figure 4 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0043] Figure 5 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0044] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0045] Figure 1 FIG. 1 is a schematic diagram of the main process of the method for automatically generating parameters according to the first embodiment of the present invention. Figure 1 As shown, the method for automatically generating parameters includes:

[0046] Step S101, obtain the business message carrying the parameter page element selected by the user through the workbench component, translate it into a technical message through the compiler component and input it into the code framework component to generate the front-end code based on the reflection of the parameter page element selected by the user.

[0047] Among them, the parameters play a controlling role in the business, and their values ​​(usually fixed values, enumerated values, range values, etc.) must be set in advance according to the target. The business parameter value is universal and valid for all relevant business instances, not just for a specific business instance. The business parameter value is not adjusted due to changes in business instances, but only due to changes in business rules. The English name of the message is message, which is a data unit for exchanging and transmitting information in the network. It is a data block sent by the site at one time. The length of the data changes according to actual needs, and the sending format is JSON. Reflection refers to the reflection mechanism, which is an important feature of Java. It allows the program to perform self-inspection at runtime, and also allows operations on its internal members. The reflection mechanism can load classes at runtime, so it can increase the flexibility of the program. Specifically, the reflection mechanism can provide the following functions: get the class to which an object belongs; get all members and methods of a class; create objects at runtime, and call object methods at runtime.

[0048] In some embodiments, before the workbench component obtains the business message carrying the parameter page element selected by the user, the library component can output the full parameter page element information to the compiler component through the technical message, and then the compiler component translates the technical message into a business message, and outputs it to the workbench component for display, so that the user can select the required page element, such as a drop-down box, input box, button, prompt box, etc. The compiler component can map all the technical information in the library component to the business information.

[0049] As some other embodiments, the front-end HTML and CSS codes are generated based on the reflection of the parameter page elements selected by the user. The specific implementation process can be that the code framework component uses the parameter page elements (such as select, input, etc.) as identifiers, and obtains the corresponding front-end HTML and CSS codes through the htmlAndCssImp() method reflection.

[0050] Step S102, obtain the business message carrying the user-defined parameter business rules and verification information through the workbench component, translate it into a technical message through the compiler component and input it into the code framework component, and then generate the front-end logic code based on the user-defined parameter business rules and verification information reflection and generate the back-end code through reverse engineering.

[0051] Among them, reverse engineering refers to automatically generating java code, pojo, mapper and mapper.xml through tables in the database.

[0052] In a preferred embodiment, the present invention supports more components by configuring form controls. Specifically, after the front end initiates a request, a table is created online at the back end, and the back end generates back end code by reverse engineering according to the request of the front end, that is, according to the generated table structure, the method of reverse engineering and reflection encapsulation using mybatis is used to generate the corresponding back end code and the configuration file required for the parameters by the encapsulation method. It is worth noting that what is stored and encapsulated in the library component and the code framework component are the object types required for the parameters and the code blocks that complete the functions.

[0053] In some embodiments, before obtaining the business message carrying the user-defined parameter business rules and verification information through the workbench component, the library component can output the full parameter business rules and verification information to the compiler component through the technical message, and then translate it into a business message through the compiler component, and output it to the workbench component for display, so that the user can define the business rules of the parameters and the field value verification rules (such as joint query, value range, etc.).

[0054] As other embodiments, when the front-end logic code is generated based on the reflection of user-defined parameter business rules and verification information, the code framework component uses the user-defined parameter business rules and verification information (for example: <=, readOnly, etc.) in the technical message as identifiers, and obtains the corresponding front-end js code through the jsImp() method reflection.

[0055] Step S103, obtain the business message carrying the user-defined database field through the workbench component, translate it into a technical message through the compiler component and input it into the code framework component, and then obtain the corresponding persistence layer database mapping file through reverse engineering based on the database field.

[0056] In some embodiments, before obtaining the business message carrying the user-defined database field through the workbench component, the library component can output the database field type required for the full set of parameters to the compiler component through a technical message, which is then translated into a business message through the compiler component and output to the workbench component for display, so that the user can define the corresponding database field type for the already defined parameter page field.

[0057] As some other embodiments, when the corresponding persistence layer database mapping file is obtained through reverse engineering based on the database field, the code framework component uses the user-defined database field (such as varchar, number, primary key, etc.) in the technical message as an identifier, and obtains the corresponding persistence layer database mapping file through reverse engineering through the xmlImp() method; wherein the persistence layer database mapping file includes xml code and database script.

[0058] Step S104, input the full front-end code obtained based on the front-end code and the front-end logic code, and the full back-end code obtained based on the back-end code and the persistence layer database mapping file into the automated testing component for testing to generate target parameters.

[0059] In an embodiment, the automated testing component may include an interface automated testing tool. When the system needs to add a new interface, the corresponding interface is added to the system according to the format, and the test can be quickly performed according to the defined rules to quickly find problems. When the system version is updated, a complete automated test is performed on all interfaces, and regression testing can be quickly completed to determine whether the system update has an impact on the functions of the relevant interfaces.

[0060] It can be seen that the present invention solves the problems of both the business end and the development end, and generates a workbench page for the business personnel to operate in a description method that the business personnel understand, avoiding the situation in which the business personnel write the requirements into documents and then review and paraphrase them for the developers to understand, and avoiding the distortion and errors caused by multiple transmissions of information. For the development end, new parameters do not need to be developed repeatedly, and the common elements and code blocks are encapsulated into the platform, and the business personnel use them as needed to achieve the purpose of modular development. In addition, the implementation classes and methods in the code framework are calibrated one by one with the full amount of data in the library component, and the corresponding code and script can be generated according to the principle of reverse engineering. Update the elements and verification rules in the library component so that its full amount of information meets the needs of the business personnel for continuous updates. For the development of the workbench component, it is necessary to display the page information according to the message sent by the library component, and support the business personnel to operate it.

[0061] Figure 2 is a schematic diagram of the main process of the method for automatically generating parameters according to the second embodiment of the present invention. Figure 2 As shown, it includes a workbench component, a compiler component, a library component, a code framework component and an automated testing component. Among them, the workbench component is a component displayed to the user and operated by the user, including a parameter page element module, a parameter verification rule module and a parameter database field module. Preferably, these modules help business personnel design parameter pages and functions in a form that they can understand. The parameter page element module allows business personnel to select parameter page fields (such as drop-down boxes, radio buttons, input boxes, etc.) and elements (buttons, pop-ups, etc.) and record preset values ​​(such as drop-down box element values, input box default values, etc.). The parameter verification rule module allows business personnel to define parameter operation logic (such as linkage conditions, prompts, etc.) and verification (such as numerical input range, sensitive words, etc.). The parameter database field module allows business personnel to define the field type (such as char, number, etc.) of the corresponding field value in the database.

[0062] The compiler component can convert technical messages and business messages into each other. The compiler component connects business components (workbench components) and technical components (library components and code framework components). It stores the mapping relationship between business messages and technical messages (such as the drop-down box corresponds to select, the numeric input field corresponds to number, not greater than corresponds to <=, etc.).

[0063] The library component stores the objects that users need to select, including the parameter page element library module, the parameter verification rule library module, and the parameter database field library module, which correspond to the three sub-modules of the workbench respectively. Its function is to provide business personnel with optional object types.

[0064] The code framework component encapsulates the instantiation methods required for all elements in the library component. Operators configure the corresponding parameter information in the parameter visualization page according to business needs. After confirming the submission, the parameter request is initiated to the backend. The backend determines the specific method based on the reflection of the request message from the frontend, and reverse-engineers the HTML page, java file, xml, and configuration file. In other words, the code framework component encapsulates the initialization code of the elements stored in the library component. For example, when the element defined in the input message is select, the code framework component will generate the HTML and CSS code corresponding to the drop-down box through reflection and reverse engineering principles. If the input message defines the validation rules, the corresponding js code or backend java code will be generated based on this.

[0065] In addition, the function of the automated testing component is to automatically test the generated front-end and back-end codes and database scripts, including unit testing and interface testing.

[0066] The specific implementation process includes: the parameter page element library module in the library component outputs the full parameter page element information to the compiler component through the technical message, and then the compiler component translates the technical message into a business message, and outputs it to the parameter page element module in the workbench component for display, so that the user can select the required page element. Then, the business message carrying the parameter page element selected by the user is obtained through the parameter page element module in the workbench component, and is translated into a technical message by the compiler component and input into the code framework component. The code framework component uses the parameter page element as an identifier, and obtains the corresponding front-end HTML and CSS code through the htmlAndCssImp() method, that is, rendering generates the front-end code.

[0067] Afterwards, the parameter verification rule library module in the library component outputs the full parameter business rules and verification information to the compiler component through the technical message, which is then translated into a business message through the compiler component and output to the parameter verification rule module in the workbench component for display, so that the user can define the business rules and field value verification rules of the parameters. The business message carrying the user-defined parameter business rules and field value verification information is obtained through the parameter verification rule module of the workbench component, and translated into a technical message through the compiler component and input into the code framework component. The code framework component uses the user-defined parameter business rules and field value verification information in the technical message as an identifier, and obtains the corresponding front-end js code (i.e., generates the front-end logic code) through reflection through the jsImp() method, and generates java code (i.e., generates the back-end java code) through reverse engineering.

[0068] Afterwards, the parameter database field library module in the library component outputs the database field types required for all parameters to the compiler component through technical messages, which are then translated into business messages by the compiler component and output to the parameter database field module in the workbench component for display, so that users can define corresponding database field types for defined parameter page fields. The business message carrying the user-defined database field is obtained through the parameter database field module in the workbench component, which is translated into a technical message by the compiler component and input into the code framework component. The code framework component uses the user-defined database field in the technical message as an identifier, and reverse-engineers the corresponding persistence layer database mapping file through the xmlImp() method; wherein, the persistence layer database mapping file includes xml code and database scripts.

[0069] Finally, the full front-end code obtained based on the front-end HTML and CSS code and the front-end js code, as well as the full back-end code obtained based on the java code and the persistence layer database mapping file, are input into the automated testing component for unit testing and interface testing to generate target parameters.

[0070] It is worth mentioning that in order to meet the growing needs of users and changes in business models, such as adding new column (i.e. element) types, new business logic, new validation rules, etc., the parameter page element library module, parameter validation rule library module, and parameter database field library module of the library component need to be updated regularly, and the corresponding methods encapsulated by the corresponding code framework components also need to implement the code for the newly added content in the library component. In addition, for newly added parameters, the functions of the newly added parameters and the existing parameters can be compared. If the function of the newly edited parameter generated by the business personnel is the same as the function of the parameter already in the parameter library, the user can be prompted whether to generate it with one click; if the function of the newly edited parameter generated by the business personnel is different from the function of the parameter already in the parameter library, the user can be prompted whether to modify the function based on the existing parameters, thereby reducing the time and energy cost of users editing parameters.

[0071] Therefore, it can be seen that the present invention is a concept and framework for automatically generating parameter codes, which avoids errors and distortions in the transmission process of business demand information. In addition, when business personnel modify the requirements, they directly modify the workbench component information, saving a lot of development costs and communication costs. At the same time, it is only necessary to update the library components and code framework components according to the new business, without the need to develop each parameter one by one, saving development costs and time.

[0072] Figure 3 is a schematic diagram of the main modules of the apparatus for automatically generating parameters according to an embodiment of the present invention, such as Figure 3 As shown, the device for automatically generating parameters includes a workbench component 301, a compiler component 302, a code framework component 303 and an automated test component 304; wherein,

[0073] The business message carrying the parameter page element selected by the user is obtained through the workbench component 301, and is translated into a technical message through the compiler component 302 and input into the code framework component 303, so as to generate the front-end code based on the parameter page element selected by the user;

[0074] The workbench component 301 obtains the business message carrying the user-defined parameter business rules and verification information, and translates it into a technical message through the compiler component 302 and inputs it into the code framework component 303, and then generates the front-end logic code based on the user-defined parameter business rules and verification information, and generates the back-end code through reverse engineering;

[0075] The business message carrying the user-defined database field is obtained through the workbench component 301, translated into a technical message through the compiler component 302 and input into the code framework component 303, and then the corresponding persistence layer database mapping file is obtained through reverse engineering based on the database field;

[0076] The full front-end code obtained based on the front-end code and the front-end logic code, and the full back-end code obtained based on the back-end code and the persistence layer database mapping file are input into the automated testing component 304 for testing to generate target parameters.

[0077] In some embodiments, the device for automatically generating parameters also includes a library component, wherein the library component outputs the full parameter page element information to the compiler component through a technical message, and then translates the technical message into a business message through the compiler component, and outputs it to the workbench component for display, so that the user can select the required page elements.

[0078] In some embodiments, the code framework component 303 uses the parameter page element as an identifier and obtains the corresponding front-end HTML and CSS code through reflection through the htmlAndCssImp() method.

[0079] In some embodiments, a library component is also included, wherein the library component outputs the full parameter business rules and verification information to the compiler component through a technical message, which is then translated into a business message through the compiler component and output to the workbench component for display, so that the user can define the business rules of the parameters and the field value verification rules.

[0080] In some embodiments, the code framework component 303 generates front-end logic code based on user-defined parameter business rules and verification information reflection, including:

[0081] The code framework component uses the parameter business rules and verification information defined by the user in the technical message as an identifier, and obtains the corresponding front-end js code through reflection through the jsImp() method.

[0082] In some embodiments, a library component is also included, wherein the library component outputs the database field types required for the full set of parameters to the compiler component through technical messages, which are then translated into business messages through the compiler component and output to the workbench component for display, so that the user can define the corresponding database field types for the already defined parameter page fields.

[0083] In some embodiments, the code framework component 303 obtains the corresponding persistence layer database mapping file through reverse engineering based on the database field, including:

[0084] The code framework component uses the user-defined database field in the technical message as an identifier, and obtains the corresponding persistence layer database mapping file through reverse engineering of the xmlImp() method; wherein the persistence layer database mapping file includes xml code and database script.

[0085] It should be noted that the method for automatically generating parameters and the device for automatically generating parameters in the present invention have a corresponding relationship in terms of specific implementation contents, so the repeated contents will not be described again.

[0086] Figure 4 An exemplary system architecture 400 is shown to which the method for automatically generating parameters or the apparatus for automatically generating parameters according to the embodiments of the present invention can be applied.

[0087] like Figure 4 As shown, system architecture 400 may include terminal devices 401, 402, 403, network 404 and server 405. Network 404 is used to provide a medium for communication links between terminal devices 401, 402, 403 and server 405. Network 404 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0088] Users can use terminal devices 401, 402, 403 to interact with server 405 through network 404 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 401, 402, 403, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).

[0089] The terminal devices 401 , 402 , and 403 may be various electronic devices having a screen with automatically generated parameters and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0090] The server 405 may be a server that provides various services, such as a backend management server (only an example) that provides support for shopping websites browsed by users using the terminal devices 401, 402, and 403. The backend management server may analyze and process the received data such as product information query requests, and feed back the processing results (such as target push information, product information - only an example) to the terminal device.

[0091] It should be noted that the method for automatically generating parameters provided in the embodiment of the present invention is generally executed by the server 405 , and accordingly, the computing device is generally disposed in the server 405 .

[0092] It should be understood that Figure 4 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0093] Reference below Figure 5 , which shows a schematic diagram of the structure of a computer system 500 of a terminal device suitable for implementing an embodiment of the present invention. Figure 5 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0094] like Figure 5 As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 504 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the computer system 500 are also stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0095] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 504 including a hard disk, etc.; and a communication section 505 including a network interface card such as a LAN card, a modem, etc. The communication section 505 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed so that a computer program read therefrom is installed into the storage section 504 as needed.

[0096] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 505, and / or installed from the removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the above-mentioned functions defined in the system of the present invention are executed.

[0097] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer 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. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0098] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0099] The modules involved in the embodiments of the present invention may be implemented by software or hardware.

[0100] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by a device, the device includes obtaining a business message carrying a parameter page element selected by a user through a workbench component, translating it into a technical message through a compiler component and inputting it into a code framework component, so as to generate a front-end code based on the parameter page element selected by the user reflection; obtaining a business message carrying a user-defined parameter business rule and verification information through a workbench component, translating it into a technical message through a compiler component and inputting it into a code framework component, and then reflecting and generating a front-end logic code based on the user-defined parameter business rule and verification information, and generating a back-end code through reverse engineering; obtaining a business message carrying a user-defined database field through a workbench component, translating it into a technical message through a compiler component and inputting it into a code framework component, and then obtaining a corresponding persistence layer database mapping file through reverse engineering based on the database field; inputting the full front-end code obtained based on the front-end code and the front-end logic code, and the full back-end code obtained based on the back-end code and the persistence layer database mapping file into the automated test component for testing to generate target parameters.

[0101] The technical solution according to the embodiment of the present invention can solve the problems of low efficiency of existing parameter development and inconsistency between completed functions and expectations.

[0102] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for automatically generating parameters, characterized in that: include: The business message carrying the parameter page element selected by the user is obtained through the workbench component, and is translated into a technical message through the compiler component and input into the code framework component to generate the front-end code based on the reflection of the parameter page element selected by the user; The workbench component obtains the business message that carries the user-defined parameter business rules and verification information, and translates it into a technical message through the compiler component and inputs it into the code framework component, and then generates the front-end logic code based on the user-defined parameter business rules and verification information, and generates the back-end code through reverse engineering; The business message carrying the user-defined database fields is obtained through the workbench component, translated into technical messages by the compiler component and input into the code framework component, and then the corresponding persistence layer database mapping file is obtained through reverse engineering based on the database fields; The full front-end code obtained based on the front-end code and the front-end logic code, as well as the full back-end code obtained based on the back-end code and the persistence layer database mapping file, are input into the automated test component for testing to generate target parameters.

2. The method according to claim 1, characterized in that Before obtaining the business message carrying the parameter page element selected by the user through the workbench component, it includes: The library component outputs the full parameter page element information to the compiler component through the technical message, and then the compiler component translates the technical message into a business message, and outputs it to the workbench component for display, so that the user can select the required page elements.

3. The method according to claim 1, characterized in that Also includes: Generates front-end HTML and CSS code based on page element reflection based on user-selected parameters.

4. The method according to claim 3, characterized in that Generates front-end HTML and CSS code based on page element reflection based on user-selected parameters, including: The code framework component uses the parameter page element as an identifier and obtains the corresponding front-end HTML and CSS code through reflection operations.

5. The method according to claim 1, characterized in that Before obtaining the business message carrying the user-defined parameter business rules and verification information through the workbench component, including: The library component outputs all parameter business rules and verification information to the compiler component through technical messages, which are then translated into business messages by the compiler component and output to the workbench component for display, so that users can define parameter business rules and field value verification rules.

6. The method according to claim 1, characterized in that Generate front-end logic code based on user-defined parameter business rules and validation information reflection, including: The code framework component uses the parameter business rules and verification information defined by the user in the technical message as an identifier, and obtains the corresponding front-end js code through reflection through the jsImp() method.

7. The method according to claim 1, characterized in that Before obtaining the business message carrying the user-defined database field through the workbench component, include: The library component outputs the database field types required for all parameters to the compiler component through technical messages, which are then translated into business messages by the compiler component and output to the workbench component for display, so that users can define corresponding database field types for the already defined parameter page columns.

8. The method according to claim 1, characterized in that Based on the database fields, the corresponding persistence layer database mapping file is obtained through reverse engineering, including: The code framework component uses the user-defined database field in the technical message as an identifier, and obtains the corresponding persistence layer database mapping file through reverse engineering; wherein the persistence layer database mapping file includes XML code and database script.

9. A device for automatically generating parameters, characterized in that: It includes workbench components, compiler components, code framework components and automated testing components; among them, The business message carrying the parameter page element selected by the user is obtained through the workbench component, and is translated into a technical message through the compiler component and input into the code framework component to generate the front-end code based on the reflection of the parameter page element selected by the user; The workbench component obtains the business message that carries the user-defined parameter business rules and verification information, and translates it into a technical message through the compiler component and inputs it into the code framework component, and then generates the front-end logic code based on the user-defined parameter business rules and verification information, and generates the back-end code through reverse engineering; The business message carrying the user-defined database fields is obtained through the workbench component, translated into technical messages by the compiler component and input into the code framework component, and then the corresponding persistence layer database mapping file is obtained through reverse engineering based on the database fields; The full front-end code obtained based on the front-end code and the front-end logic code, as well as the full back-end code obtained based on the back-end code and the persistence layer database mapping file, are input into the automated test component for testing to generate target parameters.

10. The device according to claim 9, characterized in that It also includes a library component, wherein the library component outputs the full parameter page element information to the compiler component through a technical message, and then the compiler component translates the technical message into a business message, and outputs it to the workbench component for display, so that the user can select the required page elements.

11. The device according to claim 9, characterized in that It also includes a library component, which outputs all parameter business rules and verification information to the compiler component through technical messages, which are then translated into business messages through the compiler component and output to the workbench component for display, so that users can define parameter business rules and field value verification rules.

12. The device according to claim 9, characterized in that include: The code framework component uses the parameter page element as an identifier and obtains the corresponding front-end HTML and CSS code through reflection operations.

13. The device according to claim 9, characterized in that It also includes a library component, which outputs the database field types required for all parameters to the compiler component through technical messages, which are then translated into business messages by the compiler component and output to the workbench component for display, so that users can define corresponding database field types for the already defined parameter page fields.

14. An electronic device, characterized in that: include: one or more processors; a storage device for 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 according to any one of claims 1 to 8.

15. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.