A method, apparatus, device, and storage medium for generating code files

By automatically generating the front-end and back-end modes of the management system, the problem of inefficiency in traditional management system development is solved, and efficient and secure code generation and deployment are achieved.

CN115408009BActive Publication Date: 2025-07-18CCB FINTECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211203474.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-29
Publication Date
2025-07-18
Estimated Expiration
2042-09-29

AI Technical Summary

Technical Problem

In traditional management system development, due to the differences in code writing capabilities and compilation vulnerabilities of different developers, the development efficiency is inefficient and the compilation process takes a long time, and there are many compilation vulnerabilities and performance missing.

Method used

By obtaining resource fields in the definition file and management system function information, the front-end mode and back-end mode are automatically generated and added to the front-end framework and back-end framework to generate object code files, reduce manual participation, and avoid compilation vulnerabilities and performance missing.

Benefits of technology

It improves the development efficiency of the management system, reduces development time, simplifies the deployment process, enhances system security, and avoids compilation vulnerabilities and performance missing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115408009B_ABST
    Figure CN115408009B_ABST
Patent Text Reader

Abstract

The present disclosure provides a method, apparatus, device, storage medium, and program product for generating code files, which can be applied to the field of computer technology. Among them, the generated code files are used to construct a management system. The method includes: obtaining a definition file for constructing a management system, where the definition file includes M resource fields, M is greater than or equal to 1, and the resource fields correspond to the resources to be managed in the management system, and the resources to be managed include business transaction information; generating N front-end modes and N back-end modes according to the M resource fields and the function information of the management system, N is greater than or equal to M, there is a unique mapping relationship between the front-end mode and the resource field, and there is a unique mapping relationship between the back-end mode and the resource field; and generating a target code file for constructing the management system by adding the N front-end modes and the N back-end modes to the front-end framework and the back-end framework of the management system respectively.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and particularly to a method, apparatus, device, storage medium, and program product for generating code files. Background Art

[0002] A management system is used to perform processing operations such as adding, deleting, modifying, and querying resource data, and then write the processed resource data to disk in a database. The management system may include a front-end management page and a back-end server. The traditional development method is to merge the operation codes written by front-end developers and back-end developers respectively to form a management system.

[0003] However, there are differences in the code writing abilities of different developers, and there are various compilation vulnerabilities or performance deficiencies in the operation codes, resulting in a large amount of time spent checking compilation vulnerabilities. In addition, the compilation process of the operation codes takes a large amount of time, resulting in low development efficiency of the management system. Summary of the Invention

[0004] In view of the above problems, the present disclosure provides a method, apparatus, device, storage medium, and program product for generating code files.

[0005] According to a first aspect of the present disclosure, there is provided a method for generating a code file, where the code file is used to construct a management system; the method includes:

[0006] Obtain a definition file for constructing a management system, where the definition file includes M resource fields, M is greater than or equal to 1, and the resource fields correspond to the resources to be managed in the management system, and the resources to be managed include business transaction information;

[0007] Generate N front-end modes and N back-end modes according to the M resource fields and the function information of the management system, N is greater than or equal to M, there is a unique mapping relationship between the front-end mode and the resource field, and there is a unique mapping relationship between the back-end mode and the resource field; and

[0008] Generate a target code file for constructing a management system by adding the N front-end modes and the N back-end modes to the front-end framework and the back-end framework of the management system respectively.

[0009] According to an embodiment of the present disclosure, the management functions of the management system include adding, deleting, modifying, and querying, and the function information includes function execution rules; generating N front-end modes and N back-end modes according to the M resource fields and the function information of the management system includes:

[0010] Traverse the M resource fields according to the field names of the M resource fields; and

[0011] Generate a front - end mode and a back - end mode corresponding to each resource field according to the function execution rules of the management system and M resource fields, obtaining N front - end modes and N back - end modes. The front - end mode includes a first addition mode, a first deletion mode, a first modification mode, and a first query mode, and the back - end mode includes a second addition mode, a second deletion mode, a second modification mode, and a second query mode, where N ≤ 4 * M.

[0012] According to an embodiment of the present disclosure, the resource field includes a plurality of first fields and a second field for describing the first field. The first field is used to describe the attributes of the resource field, and the second field is used to define the first field.

[0013] According to an embodiment of the present disclosure, the second field includes an addition flag field and a value range field;

[0014] Generate a front - end mode and a back - end mode corresponding to each resource field according to the function execution rules of the management system and M resource fields, obtaining N front - end modes and N back - end modes, including:

[0015] Determine K first fields including the addition flag field within the m1 - th resource field according to the primary key name of the addition flag field, where K ≥ 1 and m1 ≥ 1 and m1 ≤ M;

[0016] Determine P first fields with non - empty key values of the addition flag field from the K first fields, where P ≥ 1 and P ≤ K;

[0017] Verify the parameters corresponding to the P first fields according to the value range fields within the P first fields to obtain a verification result; and

[0018] Generate a first addition mode and a second addition mode corresponding to the m1 - th resource field when it is determined that the verification result passes.

[0019] According to an embodiment of the present disclosure, the second field includes a query flag field; Generate a front - end mode and a back - end mode corresponding to each resource field according to the function execution rules of the management system and M resource fields, obtaining N front - end modes and N back - end modes, including:

[0020] Determine Q first fields including the query flag field within the m2 - th resource field according to the primary key name of the query flag field, where Q ≥ 1; and

[0021] Generate a first query mode and a second query mode corresponding to the m2 - th resource field when it is determined that the key value of the query flag field is non - empty.

[0022] According to an embodiment of the present disclosure, the second query mode is used to create a database query statement based on a query tag field, and after completing the database query, store the returned data in a cache database.

[0023] According to an embodiment of the present disclosure, by adding N front-end modes and N back-end modes to the front-end framework and the back-end framework of the management system respectively, a target code file for constructing the management system is generated, including:

[0024] Generate M services corresponding to M resource fields according to the front-end framework and the back-end framework;

[0025] Create N function interfaces corresponding to the M services; and

[0026] Create call relationships between the N front-end modes and the N function interfaces, and between the N back-end modes and the N function interfaces to obtain the target code file.

[0027] A second aspect of the present disclosure provides a method for constructing a management system, including: calling the target code file to generate a target management system for managing business transaction information, where the business transaction information includes account information and / or login information, and the target code file is determined according to the above code file generation method.

[0028] A third aspect of the present disclosure provides a code file generation device, where the code file is used to construct a management system; the device includes:

[0029] An acquisition module for acquiring a definition file for constructing a management system, where the definition file includes M resource fields, M is greater than or equal to 1, and the resource fields correspond to resources to be managed in the management system, and the resources to be managed include business transaction information;

[0030] A first generation module for generating N front-end modes and N back-end modes according to the M resource fields and the function information of the management system, N is greater than or equal to M, and there is a unique mapping relationship between the front-end mode and the resource field, and there is a unique mapping relationship between the back-end mode and the resource field;

[0031] A second generation module for generating a target code file for constructing a management system by adding the N front-end modes and the N back-end modes to the front-end framework and the back-end framework of the management system respectively.

[0032] A fourth aspect of the present disclosure provides an electronic device, including: one or more processors; a memory for storing one or more programs, where when the one or more programs are executed by the one or more processors, the one or more processors execute the above code file generation method.

[0033] The fifth aspect of the present disclosure further provides a computer-readable storage medium, on which executable instructions are stored, and when the instructions are executed by a processor, the processor is caused to execute the above-mentioned code file generation method.

[0034] The sixth aspect of the present disclosure further provides a computer program product, including a computer program, and when the computer program is executed by a processor, the above-mentioned code file generation method is implemented.

[0035] According to the technical solution of the present disclosure, based on the definition file, the resource fields in the definition file and the function information of the management system to be constructed are combined together to jointly generate a front-end mode and a back-end mode that match the functions of the management system, realizing the automatic generation of the function code of the management system. After generating N front-end modes and N back-end modes corresponding to M resource fields, by adding the generated N front-end modes and N back-end modes to the front-end framework and the back-end framework, a target code file including the entire management system is generated. Since the definition file obtained in the present disclosure is pre-determined according to the resources to be managed, there is no need to determine the configuration information through the interactive operation of developers. In addition, in the process of generating the front-end mode and the back-end mode according to the resource fields and the function information of the management system in the definition file, there is no code editing operation by code developers and no drag-and-drop operation of page elements. Therefore, the method provided by the present disclosure can reduce the participation of developers in the process of constructing the management system, help to avoid compilation vulnerabilities and performance deficiencies caused by developers writing code, and improve the security of the management system. In addition, since the process of generating the entire target code file does not require manual coding participation, the present disclosure can reduce the development time of constructing the management system and improve the development efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Through the following description of the embodiments of the present disclosure with reference to the drawings, the above-mentioned content and other objects, features and advantages of the present disclosure will become clearer. In the drawings:

[0037] Figure 1 Schematically shows an application scenario of the code file generation method according to an embodiment of the present disclosure;

[0038] Figure 2 Schematically shows a flowchart of the code file generation method according to an embodiment of the present disclosure;

[0039] Figure 3 Schematically shows a flowchart of the front-end mode and back-end mode generation method according to an embodiment of the present disclosure;

[0040] Figure 4 Schematically shows a flowchart of the first new mode and second new mode generation method according to an embodiment of the present disclosure;

[0041] Figure 5Schematically shows a schematic diagram of a code file generation process according to an embodiment of the present disclosure;

[0042] Figure 6 Schematically shows a structural block diagram of a code file generation device according to an embodiment of the present disclosure; and

[0043] Figure 7 Schematically shows a block diagram of an electronic device suitable for a code file generation determination method according to an embodiment of the present disclosure. Detailed implementation manners

[0044] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present disclosure. In the following detailed description, for the sake of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, obviously, one or more embodiments can also be implemented without these specific details. In addition, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessarily confusing the concepts of the present disclosure.

[0045] The terms used herein are merely for describing specific embodiments and are not intended to limit the present disclosure. The terms "including", "comprising", etc. used herein indicate the presence of the described features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0046] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.

[0047] In the case of using expressions such as "at least one of A, B, and C", generally, it should be interpreted according to the meaning commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include, but is not limited to, a system having only A, only B, only C, having A and B, having A and C, having B and C, and / or having A, B, and C, etc.).

[0048] In the technical solution of the present disclosure, the processing of the data involved (such as including but not limited to user personal information) in terms of collection, storage, use, processing, transmission, provision, disclosure, and application, etc. all comply with the provisions of relevant laws and regulations, take necessary confidentiality measures, and do not violate public order and good customs.

[0049] In the related art, generally, front-end developers and back-end developers independently write operation codes for a management system, and the written front-end operation codes and back-end operation codes are merged to construct the management system. Since the code writing work is completed by multiple developers, and there are differences in the code writing habits and writing abilities of different developers, the difficulty of merging the front-end operation codes and back-end operation codes increases. In addition, it is also necessary to spend time checking the correctness of multiple operation codes. The above operations will all lead to problems such as long development time, low development efficiency, and high manual participation.

[0050] In addition, in the related art, the writing and generation of front-end operation codes and back-end operation codes depend on multiple development tools and on interactive operations such as editing and dragging by developers. The final code merging will depend on a new merging tool, resulting in complex writing and merging operations for the entire code. Since a wide variety of development tools are used, the development efficiency of the management system is affected.

[0051] Embodiments of the present disclosure provide a method for generating a code file, where the code file is used to construct a management system; the method includes: obtaining a definition file for constructing the management system, where the definition file includes M resource fields, M is greater than or equal to 1, the resource fields correspond to resources to be managed in the management system, and the resources to be managed include business transaction information; generating N front-end patterns and N back-end patterns according to the M resource fields and the function information of the management system, N is greater than or equal to M, there is a unique mapping relationship between the front-end pattern and the resource field, and there is a unique mapping relationship between the back-end pattern and the resource field; and generating a target code file for constructing the management system by adding the N front-end patterns and the N back-end patterns to the front-end framework and the back-end framework of the management system respectively.

[0052] Figure 1 Fig. schematically shows an application scenario of the method for generating a code file according to an embodiment of the present disclosure.

[0053] As Figure 1 shown, the application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is used to provide a medium for a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.

[0054] A user can interact with the server 105 through at least one of the first terminal device 101, the second terminal device 102, and the third terminal device 103 via the network 104 to receive or send messages, etc. Various code compilation tools, etc. (only for example) can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103.

[0055] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be various electronic devices with a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and so on.

[0056] The server 105 can be a server providing various services, such as a background management server (only for example) that supports the websites browsed by the user using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server can analyze and process data such as received code call requests, etc., and feedback the processing results (such as code texts obtained or generated according to user requests, etc.) to the terminal device.

[0057] It should be noted that the code file generation method provided by the embodiments of the present disclosure can generally be executed by the server 105. Correspondingly, the code file generation device provided by the embodiments of the present disclosure can generally be set in the server 105. The code file generation method provided by the embodiments of the present disclosure can also be executed by a server or a server cluster different from the server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or the server 105. Correspondingly, the code file generation device provided by the embodiments of the present disclosure can also be set in a server or a server cluster different from the server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or the server 105.

[0058] It should be understood that Figure 1 the numbers of the terminal devices, networks, and servers in

[0059] are merely illustrative. According to the implementation requirements, there can be any number of terminal devices, networks, and servers. Figure 1 Based on the scenario described below Figures 2 to 5 the code file generation method of the public embodiments will be described in detail through

[0060] Figure 2 Schematically shows a flowchart of the code file generation method according to an embodiment of the present disclosure.

[0061] As Figure 2 shown, the method includes operations S210 to S250.

[0062] In operation S210, a definition file for constructing a management system is obtained, and the definition file includes M resource fields.

[0063] According to an embodiment of the present disclosure, the management system to be constructed can be used to manage multiple resources. The resources to be managed include business transaction information, for example, information such as transaction amount, transaction time, etc. It can also include basic information, for example, account basic information, balance information, account name, etc.

[0064] According to an embodiment of the present disclosure, the definition file is used to describe the resources to be managed by the management system to be constructed. Specifically, the definition file includes M resource fields, and the resource fields correspond to the resources to be managed in the management system, and M is greater than or equal to 1. For example, the "user" resource field corresponds to the account name resource.

[0065] According to an embodiment of the present disclosure, the definition file can be generated by parsing a data table of the resources to be managed, or can be pre-filled by a developer according to the resources to be managed. The format of the resource fields in the definition file corresponds to the resources to be managed and conforms to the definition standard of the resources to be managed.

[0066] According to an embodiment of the present disclosure, the definition file includes a proto file, and the method for obtaining the definition file includes: by using the plugin call command of the open-source protoc, calling the proto file under a preset address into a code file generation tool. The code file generation tool can parse the obtained definition file to obtain M resource fields. The code file generation tool can be a plugin tool based on protoc.

[0067] In operation S220, N front-end modes and N back-end modes are generated according to the M resource fields and the function information of the management system, and N is greater than or equal to M.

[0068] According to an embodiment of the present disclosure, the management system can perform data operations on the resources to be managed. Specifically, the function information of the management system includes management functions and function execution rules corresponding to the management functions. Specifically, the management functions of the management system include operations such as addition, modification, deletion, and query.

[0069] According to an embodiment of the present disclosure, for each resource field, there are N front-end modes and N back-end modes that are uniquely corresponding to the functions of the management system. For example, for a management system including four operations of addition, modification, deletion, and query, correspondingly, N front-end modes and N back-end modes corresponding to the M resource fields are generated, where N is less than or equal to 4M.

[0070] According to an embodiment of the present disclosure, the front-end mode refers to a code method for implementing a certain management function for the resource field at the front end. The front-end mode includes, but is not limited to, the element distribution logic of the front-end page and the interaction logic between the front-end page and the back-end code.

[0071] The back-end mode refers to a code method for implementing a certain management function for the resource field at the back end. Among them, the back-end mode includes, but is not limited to: the interaction logic between the front-end request and the back-end call, the call logic between the back-end call and the database, and the call logic between the back-end and the cache database, etc.

[0072] There is a unique mapping relationship between the front-end mode and the resource field, and there is a unique mapping relationship between the back-end mode and the resource field. Moreover, for the same management function of the same resource field, the front-end mode and the back-end mode match.

[0073] According to an embodiment of the present disclosure, the front-end mode and the back-end mode are code statements automatically generated according to M resource fields and the function information of the management system. For example, for an SQL database, the front-end mode and the back-end mode are SQL statements, and the implementation logic of the resource field can be reflected.

[0074] In operation S230, by adding N front-end modes and N back-end modes to the front-end framework and the back-end framework of the management system respectively, a target code file for constructing the management system is generated.

[0075] According to an embodiment of the present disclosure, after generating N front-end modes and N back-end modes, by adding the N front-end modes to the front-end framework of the management system and adding the N back-end modes to the back-end framework of the management system, a complete set of target code files integrating the front-end and back-end modes and the frameworks is obtained. Among them, the target code file can be stored as a completed function plug-in at a preset address. When it is necessary to apply the management system to be constructed, the construction of the management system can be directly realized by calling the target code file, without using other code writing tools to write the implementation code.

[0076] According to an embodiment of the present disclosure, the back-end framework includes, but is not limited to: the GRPC service based on Remote Procedure Call (RPC). The front-end framework includes, but is not limited to, the Ant Design framework.

[0077] According to an embodiment of the present disclosure, the method of adding the front-end mode and the back-end mode to the front-end framework and the back-end framework includes: obtaining the front-end base code and the back-end base code on the front-end framework and the back-end framework, and then associating the generated front-end mode and back-end mode with the front-end base code and the back-end base code respectively, to generate a target code file including the construction method of the entire management system.

[0078] Based on a definition file, the present disclosure combines the resource fields in the definition file with the function information of the management system to be constructed, jointly generates a front-end mode and a back-end mode that match the functions of the management system, and realizes the automatic generation of the function code of the management system. After generating N front-end modes and N back-end modes corresponding to M resource fields, by adding the generated N front-end modes and N back-end modes to the front-end framework and the back-end framework, a target code file including the entire management system is generated. Since the definition file obtained by the present disclosure is pre-determined according to the resources to be managed, there is no need to determine the configuration information through the interactive operation of developers. In addition, during the process of generating the front-end mode and the back-end mode according to the resource fields and the function information of the management system in the definition file, there is no code editing operation by code developers and no dragging operation of page elements. Therefore, the method provided by the present disclosure can reduce the participation of developers in the process of constructing the management system, help avoid compilation vulnerabilities and performance deficiencies caused by developers writing code, and improve the security of the management system. In addition, since the process of generating the entire target code file does not require manual coding participation, the present disclosure can reduce the development time of constructing the management system and improve the development efficiency.

[0079] In addition, since the generated target code file includes the construction code of the entire management system, during application, only by calling the target code file can the deployment be completed without rewriting the deployment code. Therefore, the method provided by the present disclosure also helps to simplify the subsequent management system deployment process and improve the efficiency from development to deployment.

[0080] Figure 3 The flowchart of the front-end mode and back-end mode generation method according to an embodiment of the present disclosure is schematically shown.

[0081] As Figure 3 shown, the generation method of this embodiment includes operation S321 to operation S322, and can be a specific embodiment of operation S220.

[0082] In operation S321, according to the field names of the M resource fields, the M resource fields are traversed.

[0083] According to an embodiment of the present disclosure, for each management function in each resource field, there corresponds a front-end mode and a back-end mode. Correspondingly, there will be a front-end mode and a back-end mode corresponding to at least one management function under each resource field, thereby obtaining N front-end modes and N back-end modes corresponding to the M resource fields.

[0084] Multiple resource fields are distinguished by field names. According to the field names of the resource fields, traverse the M resource fields, and then process each resource field. Specifically, the processing of each resource field includes generating multiple front-end modes and back-end modes corresponding to the management functions of the management system according to the qualification conditions for the resource field.

[0085] In operation S322, according to the function execution rules of the management system and the M resource fields, generate a front-end mode and a back-end mode corresponding to each resource field, obtaining N front-end modes and N back-end modes. The front-end modes include a first addition mode, a first deletion mode, a first modification mode, and a first query mode. The back-end modes include a second addition mode, a second deletion mode, a second modification mode, and a second query mode, where N ≤ 4 * M.

[0086] According to an embodiment of the present disclosure, the function information of the management system includes management functions and function execution rules. Among them, the management functions include addition, deletion, modification, and query. The function execution rules correspond one-to-one with the management functions.

[0087] For the M resource fields, there is an addition execution logic corresponding to the addition function, such as verifying the added data. And the addition execution logic includes a front-end execution logic and a back-end execution logic that match each other to generate a corresponding addition front-end mode and addition back-end mode.

[0088] According to an embodiment of the present disclosure, since the resources to be managed corresponding to the resource fields are different, correspondingly, the management functions corresponding to the resource fields will also be different. For example, for the two resource fields of account name and account balance, the management functions corresponding to the account name include addition, modification, deletion, and query; the management functions corresponding to the account balance include addition, deletion, and query. Correspondingly, the first modification mode and the second modification mode corresponding to the account name comply with the modification function execution rules; the first modification mode and the second modification mode corresponding to the account balance are empty, or there are no first modification mode and second modification mode for the account balance.

[0089] According to an embodiment of the present disclosure, the management functions corresponding to each resource field include at least one of the following: addition, modification, deletion, and query. Therefore, the N front-end modes and N back-end modes generated correspond to the M resource fields, and N ≤ 4 * M.

[0090] According to an embodiment of the present disclosure, the resource field includes a plurality of first fields and a second field for describing the first field. The first field is used to describe the attributes of the resource field, and the second field is used to qualify the first field.

[0091] According to an embodiment of the present disclosure, each resource field corresponds to a function module in the management system to be constructed. Each function module includes the qualification conditions and implementation modes of the resource field. For example, the first field corresponds to the implementation mode, and the second field corresponds to the qualification conditions.

[0092] Specifically, the first field may be multi-type information of the resource field, such as name, remarks, creation time, etc. The second field is a qualification field for the first field. For example, when the first field is a name, the second field may be a field type of string and a field value range.

[0093] For example, for the "user" resource field, the first field includes user_id, username, password, sex, create_time, and update_time, and the second field includes desc, search, show, name, min, max, modify, create, cache. Among them, desc can be displayed at the front end of the constructed management system to describe the database field; search is the field used by the management system to execute the query function; show indicates whether the management system needs to display; name indicates the database field name and the parameter name for front-end and back-end interaction; min and max indicate the value range of the first field. The integer type represents the value range, and the string type represents the field length range; modify indicates whether the first field can be modified; create indicates the field that the management system needs to bring when creating a single instance; Cache indicates the primary key of the cache index. Among them, the key value 0 represents no, and 1 represents yes.

[0094] For example, user_id: desc = "user id", search = 1, show = 1, name = "uid", min = 0, max = 100000000, modify = 0, create = 0, cache = 0;

[0095] username: desc = "user name", search = 1, show = 1, name = "username", min = 0, max = 200, modify = 1, create = 1, cache = 1;

[0096] sex: desc = "gender", show = 1, name = "sex", min = 0, max = 1, modify = 1, create = 1, cache = 0, etc.

[0097] According to an embodiment of the present disclosure, the first field and the second resource may further include an extended supplementary field to update the definition file according to the resource to be managed. The data of the first field and the second field may be fixed or determined by the field to be managed.

[0098] Figure 4 The flowchart of the method for generating the first new mode and the second new mode according to an embodiment of the present disclosure is schematically shown.

[0099] As Figure 4 shown, the method of this embodiment includes operations S4221 to S4224, and can be used as a specific embodiment of operation S322.

[0100] In operation S4221, according to the primary key name of the new tag field, determine K first fields in the m1-th resource field that include the new tag field.

[0101] According to an embodiment of the present disclosure, the second field includes a new tag field and a value range field. The new tag field may indicate whether the first field needs to have new input. The field name of the new tag field is "create", and the value range field includes "min" and "max".

[0102] According to an embodiment of the present disclosure, when the management function is new, analyze the m1-th resource field among the M resource fields. Specifically, according to the primary key name of the new tag field, screen all the first fields in the m1-th resource field to determine K first fields that include the new tag field, where K is greater than or equal to 1, and m1 is greater than or equal to 1 and less than or equal to M.

[0103] In operation S4222, determine P first fields among the K first fields whose key values of the new tag field are non-empty.

[0104] According to an embodiment of the present disclosure, after screening out K first fields that include the new tag field from all the first fields, obtain the key values of the K first fields, and judge the key values of the K first fields to determine P first fields whose key values are non-empty, where P is greater than or equal to 1 and less than or equal to K.

[0105] For example, for the first fields user_id and sex, the key values of the new tag field create are 0 and 1 respectively, indicating that the user id cannot include new parameters, and the user gender can include new parameters.

[0106] In operation S4223, according to the value range field in the P first fields, verify the parameters corresponding to the P first fields to obtain a verification result.

[0107] According to an embodiment of the present disclosure, after obtaining P first fields whose key values of the newly added marked fields are non-empty, the parameters corresponding to the P first fields are verified according to the key value of the value range field to obtain a verification result.

[0108] For example, the parameters corresponding to the P first fields may be a newly added user table generated from December 1st to December 7th, and the newly added user table includes user IDs of multiple newly added users. The verification of the newly added user table includes verifying whether the field types are correct, whether the field lengths are within the range, etc.

[0109] In operation S4224, when it is determined that the verification result is passed, a first new addition mode and a second new addition mode corresponding to the m1-th resource field are generated.

[0110] According to an embodiment of the present disclosure, a passed verification result indicates that the parameters corresponding to the first fields meet the data requirements. When it is determined that the verification result is passed, a first new addition mode and a second new addition mode corresponding to the m1-th resource field are generated.

[0111] Among them, the generated first new addition mode includes generating front-end execution code and front-end page elements corresponding to the above-mentioned new addition execution logic. The page elements include a new addition button, so that the web side can implement the new addition function by clicking the new addition button; the second new addition mode includes generating back-end execution code corresponding to the above-mentioned new addition execution logic, such as a created SQL statement, and writing the back-end execution code into the database.

[0112] According to an embodiment of the present disclosure, the second new addition mode further includes generating an SQL statement for writing the newly added data into the cache database after writing the back-end execution code into the database. The cache database may be a Redis cluster.

[0113] After determining multiple first fields through the primary key name of the newly added marked field, the present disclosure generates a new addition method after data verification, realizes the automatic generation of the new addition method, and improves the development efficiency.

[0114] According to an embodiment of the present disclosure, the second field includes a query marked field. According to the function execution rules of the management system and M resource fields, front-end modes and back-end modes corresponding to each resource field are generated to obtain N front-end modes and N back-end modes, including:

[0115] According to the primary key name of the query marked field, Q first fields including the query marked field in the m2-th resource field are determined, where Q is greater than or equal to 1; and

[0116] When it is determined that the key value of the query marked field is non-empty, a first query mode and a second query mode corresponding to the m2-th resource field are generated.

[0117] According to an embodiment of the present disclosure, the primary key name of the query marker field can be "search". When the management function is query, by screening all the first fields under the m2-th resource field, Q first fields including the query marker field are obtained. Then, the first fields with non-null key values of the query marker field within the Q first fields are screened out, and the query function is implemented based on the first fields with non-null query marker fields.

[0118] Among them, the code corresponding to the first query mode and the above execution logic further includes, after the above execution logic, returning the first fields with non-null query marker fields to the backend.

[0119] According to an embodiment of the present disclosure, the second query mode is used to create a database query statement based on the query marker field, and after completing the database query, store the returned data in the cache database. Specifically, the second query mode includes the code corresponding to the above execution logic, and after the above execution logic, create an sql statement based on the first fields with non-null search fields to complete the database query function, and create a new redis cache for the returned data.

[0120] The present disclosure constructs a call relationship chain between the database and the code, and a call relationship between the cache database and the data query method through the second query method, which helps to improve the query efficiency of the management system through the cache database while implementing the query logic.

[0121] According to an embodiment of the present disclosure, the second field includes a deletion marker field. When the management function is deletion, according to the primary key name of the deletion marker field, multiple first fields including the deletion marker field are screened out from the m3-th resource field, and then when it is determined that the key value of the deletion marker field is non-null, a first deletion mode and a second deletion mode corresponding to the m3-th resource field are generated.

[0122] Among them, the deletion marker field includes cache, and also includes other marker fields. Specifically, cache represents an index field. When performing a deletion operation, the currently deleted field can be determined according to cache, and indexing can be completed according to cache to implement the deletion function. It should be noted that cache, as an index field, is only used as a deletion marker field in the deletion scenario to index the fields to be deleted.

[0123] Specifically, the first deletion mode includes, in response to a deletion request, transmitting the deletion field to the backend. The second deletion mode includes creating a deletion sql statement based on the deletion field provided by the frontend to delete the above deletion field from the database, and organizing redis commands to delete data from the cache according to the cache field after successful deletion.

[0124] According to an embodiment of the present disclosure, the second field includes a modification flag field. When the management function is modification, according to the primary key name of the modification flag field, multiple first fields including the modification flag field are filtered out from the m4th resource field, and then it is verified whether the key value of the modification flag field is non-empty. If it is non-empty, a first modification mode and a second modification mode corresponding to the m4th resource field are generated.

[0125] Among them, the first modification mode includes code corresponding to the above execution logic, page elements of a modification button, and after the modification is completed, the data is requested to the backend through a modification interface. The second modification mode includes creating an update statement for sql according to the modified fields to implement database modification; and after the database modification is successful, the modified fields are indexed from the redis cache according to the cache field, and the modified fields are deleted from the redis cache.

[0126] According to an embodiment of the present disclosure, by adding N front-end modes and N back-end modes to the front-end framework and back-end framework of the management system respectively, a target code file for constructing the management system is generated, including:

[0127] Generating M services corresponding to M resource fields according to the front-end framework and the back-end framework;

[0128] Creating N function interfaces corresponding to the M services; and

[0129] Creating call relationships between the N front-end modes and the N function interfaces, and between the N back-end modes and the N function interfaces to obtain the target code file.

[0130] For example, taking the anti framework as the front-end framework and the grpc framework as the back-end framework as an example. According to the overall architectures of the anti framework and the grpc framework, the corresponding code templates are called to generate M services corresponding to M resource fields. Then, according to the front-end framework and the back-end framework, N function interfaces corresponding to the M services are created respectively. There are multiple function interfaces corresponding to the management functions under each service. The function interfaces can be created by calling the base code of the front-end framework and the back-end framework. Finally, after creating the interfaces and services, call relationships between the N front-end modes and the N function interfaces, and between the N back-end modes and the N function interfaces are established to obtain the target code file.

[0131] For example, when the resource field is "message", the created service name is ["message" Service], and the created function interfaces include the create interface [Create "message"], the delete interface [Delete "message"], the modify interface [Modify "message"], and the query interface [Query "message"]. The front end creates corresponding operations based on the message name, such as page element generation operations and front-end page execution logic. The creation methods include calling preset code templates. The operations created by the front end are associated with the operations created by the back end through the function interfaces of the back end.

[0132] The present disclosure generates corresponding services through the front-end framework and the back end, and realizes the combination of methods and frameworks through interfaces, so as to generate the target code files to be applied for the entire management system. Subsequently, there is no need to write call code programs, and a complete management system can be directly constructed, reducing the manual participation and improving the development efficiency.

[0133] Figure 5 A schematic diagram of a code file generation process according to an embodiment of the present disclosure is schematically shown.

[0134] As Figure 5 shown, the generation process 500 includes 501 to 506.

[0135] According to an embodiment of the present disclosure, a definition file 501 can be obtained from the management resource library. Then, the definition file 501 is parsed to obtain M resource fields in the definition file 501. According to multiple first fields in the M resource fields and second fields defining the first fields, front-end modes and back-end modes corresponding to each resource field are generated, and finally, a front-end mode 502 and a back-end mode 503 corresponding to the M resource fields are obtained.

[0136] After generating the front-end mode 502 and the back-end mode 503 corresponding to the M resource fields, front-end services 504 and back-end services 505 corresponding to the M resource fields are respectively created according to the characteristics of the front-end framework and the back-end framework. Then, multiple function interfaces corresponding to the management functions are created under the front-end services 504 and the back-end services 505, and the front-end mode, the back-end mode, and the function interfaces are connected to form a complete call chain, and finally, a target code file 506 including the entire management system is generated.

[0137] The present disclosure also provides a method for constructing a management system, including:

[0138] Call the target code file to generate a target management system for managing business transaction information, which includes account information and / or login information. The target code file is determined according to the above code file generation method. The target code file can be a Proto file. Among them, the Proto file can also be used as an interface document and transferred to the business system.

[0139] Specifically, after generating the target code file for constructing account information and / or login information, by calling the target code file from a preset address, the target management system can be directly generated on the terminal device, without the need for developers to deploy the management system through other interactive operations such as editing and dragging. Therefore, the method provided by the present disclosure can reduce the participation of developers in the process of constructing the management system, help avoid compilation vulnerabilities and performance deficiencies caused by developers writing code, and improve the security of the management system.

[0140] Figure 6 Schematically shows a structural block diagram of a code file generation device according to an embodiment of the present disclosure.

[0141] As Figure 6 shown, the code file generation device 600 of this embodiment includes an acquisition module 610, a first generation module 620, and a second generation module 630.

[0142] The acquisition module 610 is used to obtain a definition file for constructing a management system. The definition file includes M resource fields, where M is greater than or equal to 1. The resource fields correspond to the resources to be managed in the management system, and the resources to be managed include business transaction information. In one embodiment, the acquisition module 610 can be used to perform the operation S210 described above, which will not be elaborated here.

[0143] The first generation module 620 is used to generate N front-end modes and N back-end modes according to the M resource fields and the function information of the management system, where N is greater than or equal to M. The front-end mode has a unique mapping relationship with the resource field, and the back-end mode has a unique mapping relationship with the resource field. In one embodiment, the first generation module 620 can be used to perform the operation S220 described above, which will not be elaborated here.

[0144] The second generation module 630 is used to generate a target code file for constructing a management system by adding the N front-end modes and the N back-end modes to the front-end framework and the back-end framework of the management system respectively. In one embodiment, the second generation module 630 can be used to perform the operation S230 described above, which will not be elaborated here.

[0145] According to an embodiment of the present disclosure, the first generation module 620 includes a first determination unit and a second determination unit.

[0146] The first determination unit is configured to traverse M resource fields according to the field names of the M resource fields. In one embodiment, the first determination unit may be configured to perform operation S321 described above, which will not be elaborated here.

[0147] The second determination unit is configured to generate a front-end mode and a back-end mode corresponding to each resource field according to the function execution rules of the management system and the M resource fields, obtaining N front-end modes and N back-end modes. The front-end mode includes a first addition mode, a first deletion mode, a first modification mode, and a first query mode, and the back-end mode includes a second addition mode, a second deletion mode, a second modification mode, and a second query mode, where N ≤ 4 * M. In one embodiment, the second determination unit may be configured to perform operation S322 described above, which will not be elaborated here.

[0148] According to an embodiment of the present disclosure, the second determination unit includes a first determination subunit, a second determination subunit, a third determination subunit, and a fourth determination subunit.

[0149] The first determination subunit is configured to determine K first fields in the m1-th resource field that include the new mark field according to the primary key name of the new mark field, where K ≥ 1 and m1 ≥ 1 and m1 ≤ M. In one embodiment, the first determination subunit may be configured to perform operation S4221 described above, which will not be elaborated here.

[0150] The second determination subunit is configured to determine P first fields from the K first fields where the key value of the new mark field is non-null, where P ≥ 1 and P ≤ K. In one embodiment, the second determination subunit may be configured to perform operation S4222 described above, which will not be elaborated here.

[0151] The third determination subunit is configured to verify the parameters corresponding to the P first fields according to the value range fields in the P first fields, obtaining a verification result. In one embodiment, the third determination subunit may be configured to perform operation S4223 described above, which will not be elaborated here.

[0152] The fourth determination subunit is configured to generate a first addition mode and a second addition mode corresponding to the m1-th resource field when it is determined that the verification result passes. In one embodiment, the third determination subunit may be configured to perform operation S4224 described above, which will not be elaborated here.

[0153] According to an embodiment of the present disclosure, the second determination unit further includes a fifth determination subunit and a sixth determination subunit.

[0154] The fifth determination subunit is configured to determine Q first fields in the m2-th resource field that include the query mark field according to the primary key name of the query mark field, where Q ≥ 1.

[0155] The sixth determination subunit is configured to generate a first query pattern and a second query pattern corresponding to the m2th resource field when it is determined that the key value of the query flag field is non-null.

[0156] According to an embodiment of the present disclosure, the second generation module 630 includes a first generation unit, a second generation unit, and a third generation unit.

[0157] The first generation unit is configured to generate M services corresponding to M resource fields according to a front-end framework and a back-end framework.

[0158] The second generation unit is configured to create N function interfaces corresponding to the M services.

[0159] The third generation unit is configured to create call relationships between N front-end patterns and N function interfaces and between N back-end patterns and N function interfaces to obtain a target code file.

[0160] According to an embodiment of the present disclosure, the present disclosure further includes a construction device configured to call the target code file to generate a target management system for managing business transaction information, where the business transaction information includes account information and / or login information, and the target code file is determined according to the above code file generation method.

[0161] According to an embodiment of the present disclosure, any multiple of the acquisition module 610, the first generation module 620, and the second generation module 630 may be combined and implemented in one module, or any one of them may be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules may be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the acquisition module 610, the first generation module 620, and the second generation module 630 may be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on chip, a system on substrate, a system on package, an application specific integrated circuit (ASIC), or any other reasonable way of integrating or packaging circuits, etc., implemented by hardware or firmware, or implemented in any one of the three implementation ways of software, hardware, and firmware or in any suitable combination of them. Alternatively, at least one of the acquisition module 610, the first generation module 620, and the second generation module 630 may be at least partially implemented as a computer program module, and when the computer program module is run, it can execute the corresponding functions.

[0162] Figure 7 A block diagram of an electronic device suitable for the code file generation determination method according to an embodiment of the present disclosure is schematically shown.

[0163] As shown Figure 7 in FIG. 1, the electronic device 700 according to an embodiment of the present disclosure includes a processor 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage section 708 into a random access memory (RAM) 703. The processor 701 may include, for example, a general-purpose microprocessor (e.g., CPU), an instruction set processor, and / or a related chipset, and / or a dedicated microprocessor (e.g., an application specific integrated circuit (ASIC)), etc. The processor 701 may also include on-board memory for caching purposes. The processor 701 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.

[0164] In the RAM 703, various programs and data required for the operation of the electronic device 700 are stored. The processor 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. The processor 701 performs various operations of the method flow according to an embodiment of the present disclosure by executing the program in the ROM 702 and / or the RAM 703. It should be noted that the program may also be stored in one or more memories other than the ROM 702 and the RAM 703. The processor 701 may also perform various operations of the method flow according to an embodiment of the present disclosure by executing the program stored in the one or more memories.

[0165] According to an embodiment of the present disclosure, the electronic device 700 may further include an input / output (I / O) interface 705, and the input / output (I / O) interface 705 is also connected to the bus 704. The electronic device 700 may further include one or more of the following components connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including, for example, a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed so that a computer program read therefrom can be installed into the storage section 708 as needed.

[0166] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium stores one or more programs, and when the above one or more programs are executed, the methods according to the embodiments of the present disclosure are implemented.

[0167] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, it may include but is not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In the present disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program, and the program may be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the above-described ROM 702 and / or RAM 703 and / or one or more memories other than ROM 702 and RAM 703.

[0168] Embodiments of the present disclosure also include a computer program product, which includes a computer program that contains program code for executing the method shown in the flowchart. When the computer program product runs in a computer system, the program code is used to cause the computer system to implement the code file generation method provided by the embodiments of the present disclosure.

[0169] When the computer program is executed by the processor 701, the above functions defined in the system / apparatus of the embodiments of the present disclosure are executed. According to an embodiment of the present disclosure, the above-described systems, apparatuses, modules, units, etc. may be implemented by computer program modules.

[0170] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices and magnetic storage devices. In another embodiment, the computer program may also be transmitted and distributed in the form of a signal on a network medium, and is downloaded and installed through the communication part 709, and / or installed from the removable medium 711. The program code included in the computer program may be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0171] In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the processor 701, the above functions defined in the system of the embodiments of the present disclosure are executed. According to the embodiments of the present disclosure, the above-described systems, devices, apparatuses, modules, units, etc. can be implemented by computer program modules.

[0172] According to the embodiments of the present disclosure, the program code for executing the computer program provided by the embodiments of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level procedures and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, such as Java, C++, Python, the "C" language, or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, by using an Internet service provider to connect through the Internet).

[0173] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the above-mentioned module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and the combination of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0174] Those skilled in the art can understand that the features recited in the various embodiments and / or claims of the present disclosure can be combined or combined in various ways, even if such combinations or combinations are not explicitly recited in the present disclosure. In particular, without departing from the spirit and teachings of the present disclosure, the features recited in the various embodiments and / or claims of the present disclosure can be combined and combined in various ways. All such combinations and / or combinations fall within the scope of the present disclosure.

[0175] The specific embodiments described above further elaborate on the objectives, technical solutions, and beneficial effects of the present disclosure. It should be understood that the above are only specific embodiments of the present disclosure and are not intended to limit the present disclosure. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present disclosure shall be included within the protection scope of the present disclosure.

Claims

1. A method for generating a code file, the code file being used to construct a management system; the method includes: Obtaining a definition file for constructing a management system, where the definition file includes M resource fields, M is greater than or equal to 1, the resource fields correspond to resources to be managed in the management system, and the resources to be managed include business transaction information; Generating N front-end modes and N back-end modes according to the M resource fields and the function information of the management system, N is greater than or equal to M, there is a unique mapping relationship between the front-end mode and the resource field, and there is a unique mapping relationship between the back-end mode and the resource field; And Generating a target code file for constructing the management system by adding the N front-end modes and the N back-end modes to the front-end framework and the back-end framework of the management system respectively; The management functions of the management system include addition, deletion, modification, and query, and the function information includes function execution rules; the generating N front-end modes and N back-end modes according to the M resource fields and the function information of the management system includes: Traversing the M resource fields according to the field names of the M resource fields; and Generating a front-end mode and a back-end mode corresponding to each resource field according to the function execution rules of the management system and the M resource fields, obtaining N front-end modes and N back-end modes, the front-end mode includes a first addition mode, a first deletion mode, a first modification mode, and a first query mode, and the back-end mode includes a second addition mode, a second deletion mode, a second modification mode, and a second query mode, where N ≤ 4*M; The resource field includes a plurality of first fields and a second field for describing the first field, the first field is used to describe the attributes of the resource field, and the second field is used to define the first field; The second field includes an addition flag field and a value range field; The generating a front-end mode and a back-end mode corresponding to each resource field according to the function execution rules of the management system and the M resource fields, obtaining N front-end modes and N back-end modes includes: Determining, according to the primary key name of the addition flag field, K first fields in the m1th resource field that include the addition flag field, K is greater than or equal to 1, and m1 is greater than or equal to 1 and less than or equal to M; Determining P first fields with non-empty key values of the addition flag field from the K first fields, P is greater than or equal to 1 and less than or equal to K; Verifying the parameters corresponding to the P first fields according to the value range fields in the P first fields to obtain a verification result; and Generating a first addition mode and a second addition mode corresponding to the m1th resource field when it is determined that the verification result is passed.

2. The method according to claim 1, wherein, The second field includes a query flag field; the generating a front-end mode and a back-end mode corresponding to each resource field according to the function execution rules of the management system and the M resource fields, obtaining N front-end modes and N back-end modes includes: Determine Q first fields in the m2-th resource field that include the query tag field according to the primary key name of the query tag field, where Q is greater than or equal to 1; and Generate a first query pattern and a second query pattern corresponding to the m2-th resource field when it is determined that the key value of the query tag field is non-empty.

3. The method according to claim 2, wherein, The second query pattern is used to create a database query statement according to the query tag field and store the returned data in the cache database after the database query is completed.

4. The method according to claim 1, wherein Generating a target code file for constructing the management system by adding N of the front-end patterns and N of the back-end patterns to the front-end framework and the back-end framework of the management system respectively, includes: Generate M services corresponding to the M resource fields according to the front-end framework and the back-end framework; Create N function interfaces corresponding to the M services; and Create call relationships between N of the front-end patterns and N of the function interfaces, and between N of the back-end patterns and N of the function interfaces to obtain the target code file.

5. A method for constructing a management system, includes: Invoke the target code file to generate a target management system for managing business transaction information, where the business transaction information includes account information and / or login information, where the target code file is determined according to any one of the methods in claims 1 to 4.

6. A code file generation device, where the code file is used to construct a management system; the device includes: An acquisition module for acquiring a definition file for constructing a management system, where the definition file includes M resource fields, M is greater than or equal to 1, the resource fields correspond to resources to be managed in the management system, and the resources to be managed include business transaction information; A first generation module for generating N front-end patterns and N back-end patterns according to the M resource fields and the function information of the management system, where N is greater than or equal to M, there is a unique mapping relationship between the front-end pattern and the resource field, and there is a unique mapping relationship between the back-end pattern and the resource field; A second generation module for generating a target code file for constructing the management system by adding N of the front-end patterns and N of the back-end patterns to the front-end framework and the back-end framework of the management system respectively; The management functions of the management system include addition, deletion, modification, and query, and the function information includes function execution rules; the first generation module is further used for: Traverse the M resource fields according to the field names of the M resource fields; and Generate a front-end pattern and a back-end pattern corresponding to each resource field according to the function execution rules of the management system and the M resource fields to obtain N front-end patterns and N back-end patterns, where the front-end pattern includes a first addition pattern, a first deletion pattern, a first modification pattern, and a first query pattern, and the back-end pattern includes a second addition pattern, a second deletion pattern, a second modification pattern, and a second query pattern, where N ≤ 4 * M; The resource field includes a plurality of first fields and a second field for describing the first fields. The first fields are used to describe the attributes of the resource field, and the second field is used to define the first fields; The second field includes a new flag field and a value range field; Generating a front-end mode and a back-end mode corresponding to each of the resource fields according to the function execution rules of the management system and the M resource fields, and obtaining N front-end modes and N back-end modes, includes: Determining, according to the primary key name of the new flag field, K first fields in the m1-th resource field that include the new flag field, where K is greater than or equal to 1, and m1 is greater than or equal to 1 and less than or equal to M; Determining P first fields from the K first fields whose key values of the new flag field are non-empty, where P is greater than or equal to 1 and less than or equal to K; Validating the parameters corresponding to the P first fields according to the value range fields in the P first fields to obtain a validation result; and Generating a first new mode and a second new mode corresponding to the m1-th resource field when it is determined that the validation result is passed.

7. An electronic device, comprising: One or more processors; A storage device for storing one or more programs, wherein, when the one or more programs are executed by the one or more processors, the one or more processors are caused to execute the method according to any one of claims 1 to 5.

8. A computer-readable storage medium, having executable instructions stored thereon, which when executed by a processor cause the processor to execute the method according to any one of claims 1 to 5.

9. A computer program product, comprising a computer program, which when executed by a processor implements the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Code file packaging deployment method, continuous integration server and system

    CN109725909A

  • Establishment method, device and equipment of front-end and rear-end development framework and storage medium

    CN111596902A