CN111427561A - Service code generation method and device, computer equipment and storage medium - Google Patents

Service code generation method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN111427561A
CN111427561A CN202010222687.9A CN202010222687A CN111427561A CN 111427561 A CN111427561 A CN 111427561A CN 202010222687 A CN202010222687 A CN 202010222687A CN 111427561 A CN111427561 A CN 111427561A
Authority
CN
China
Prior art keywords
target
code
service
information
flow chart
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010222687.9A
Other languages
Chinese (zh)
Inventor
陈军
王旻锐
程都
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Construction Bank Corp
Original Assignee
China Construction Bank Corp
CCB Finetech Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Construction Bank Corp, CCB Finetech Co Ltd filed Critical China Construction Bank Corp
Priority to CN202010222687.9A priority Critical patent/CN111427561A/en
Publication of CN111427561A publication Critical patent/CN111427561A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/33Intelligent editors

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the invention discloses a method and a device for generating a service code, computer equipment and a storage medium. The method comprises the following steps: acquiring a target service flow chart and a target code template of a target service, wherein the target service flow chart comprises a plurality of target primitive nodes, the target primitive nodes are obtained by packaging language elements in a programming language, and the target code template is obtained by modeling based on a standard service code conforming to a code design specification; determining flow chart information of a target business flow chart; extracting code information of the target service from the flow chart information, wherein the code information comprises structure information and operation information of each target graphic element node in the target service flow chart; and generating a service code of the target service based on the code information and the target code template. By adopting the technical scheme, the embodiment of the invention can realize the automatic generation of the service code, reduce the requirements of software development on developers and improve the coding efficiency of the service code.

Description

Service code generation method and device, computer equipment and storage medium
Technical Field
The present invention relates to the field of software development technologies, and in particular, to a method and an apparatus for generating a service code, a computer device, and a storage medium.
Background
With the development of computer technology and the increasing degree of informatization of various industries, the software system has larger scale and higher complexity, and the software development industry faces more and more serious challenges.
At present, software development is carried out in a manual coding mode by developers. In the software development process, a developer firstly designs software based on business functions in the field and coupling calling relations between components and services in different business fields, and then codes the designed software according to the coding specification of a bottom technical framework to obtain a software code.
However, the conventional encoding method has high requirements on developers, the developers are required to be skilled in mastering the language characteristics and the encoding specifications of the programming language, the encoding efficiency is low, a large amount of repeated labor exists, and the method is difficult to be applied to the development of complex enterprise applications.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for generating a service code, a computer device, and a storage medium, so as to reduce requirements of software development on developers and improve coding efficiency.
In a first aspect, an embodiment of the present invention provides a method for generating a service code, where the method includes:
acquiring a target service flow chart and a target code template of a target service, wherein the target service flow chart comprises a plurality of target primitive nodes, the target primitive nodes are obtained by packaging language elements in a programming language, and the target code template is obtained by modeling based on a standard service code conforming to a code design specification;
determining the flow chart information of the target business flow chart;
extracting code information of the target service from the flow chart information, wherein the code information comprises structure information and operation information of each target graphic element node in the target service flow chart;
and generating a service code of the target service based on the code information and the target code template.
In a second aspect, an embodiment of the present invention provides a device for generating a service code, where the device includes:
the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring a target service flow chart and a target code template of a target service, the target service flow chart comprises a plurality of target primitive nodes, the target primitive nodes are obtained by packaging language elements in a programming language, and the target code template is obtained by modeling based on a standard service code which accords with code design specifications;
the information determining module is used for determining the flow chart information of the target business flow chart;
the information extraction module is used for extracting code information of the target service from the flow chart information, wherein the code information comprises structural information and operation information of each target graphic element node in the target service flow chart;
and the code generation module is used for generating the service code of the target service based on the code information and the target code template.
In a third aspect, an embodiment of the present invention provides a computer device, including:
one or more processors;
a memory 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 service code generation method according to the embodiment of the present invention.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a method for generating a service code according to an embodiment of the present invention.
In the technical scheme for generating the service code, a target service flow chart and a target code template of the target service are obtained, flow chart information of the target service flow chart is determined, code information of the target service is extracted from the flow chart information, the code information comprises structure information and operation information of each target primitive node in the target service flow chart, and the service code of the target service is generated according to the code information and the target code template. By adopting the technical scheme, the embodiment of the invention can realize the automatic generation of the service code, reduce the requirements of software development on developers and improve the coding efficiency of the service code.
Drawings
Other features, objects and advantages of the invention will become more apparent upon reading of the detailed description of non-limiting embodiments made with reference to the following drawings:
fig. 1 is a schematic flowchart of a method for generating a service code according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a method for generating a service code according to a second embodiment of the present invention;
fig. 3 is a development interface of a visual design platform according to a second embodiment of the present invention;
fig. 4 is a diagrammatic interface of a data transfer primitive node according to a second embodiment of the present invention;
fig. 5 is an architecture diagram of a visualization software design platform according to a second embodiment of the present invention;
fig. 6 is a block diagram of a service code generation apparatus according to a third embodiment of the present invention;
fig. 7 is a schematic structural diagram of a computer device according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some but not all of the relevant aspects of the present invention are shown in the drawings. In addition, the embodiments and features of the embodiments of the present invention may be combined with each other without conflict
Example one
The embodiment of the invention provides a method for generating a service code. The method can be executed by a device for generating the service code, wherein the device can be realized by software and/or hardware, can be integrated in computer equipment with the service code generation function, and is suitable for a software development scene. Fig. 1 is a flowchart illustrating a method for generating a service code according to an embodiment of the present invention. As shown in fig. 1, the method for generating a service code provided in this embodiment includes:
s110, a target business flow chart and a target code template of a target business are obtained, wherein the target business flow chart comprises a plurality of target primitive nodes, the target primitive nodes are obtained by packaging language elements in a programming language, and the target code template is obtained by modeling based on a standard business code which accords with code design specifications.
In this step, the target business flowchart may be obtained from the device or other devices, and the target code template may be obtained from a code template library. The target service can be understood as a service currently being developed, i.e., a service whose code needs to be generated. The target business flow chart is a flow chart describing the business flow of the target business by the developer, and can be obtained by importing or constructed in a development interface of the software development platform by the developer, and correspondingly, the development platform can obtain the business flow chart imported by the developer from other equipment, determine the business flow chart as the target business flow chart and display the business flow chart on the development interface of the software development platform; or determining a business flowchart constructed by a developer on a development interface of a software development platform as a target business flowchart, and acquiring the target business flowchart, which is not limited in this embodiment.
In consideration of the normative of the business flow diagram, the target business flow diagram can be preferably constructed on a development interface of the software development platform by a developer. At this time, before the obtaining of the target service flowchart and the target code template of the target service, the method may further include: and constructing a target business flow chart of the target business according to the editing operation of the developer in the development interface. For example, each primitive node obtained by encapsulating a language element in a programming language in advance may be displayed in a development interface of software development, and a target service flowchart of a target service may be constructed based on operations such as selection, dragging, and/or clicking of a developer on the corresponding primitive node. The programming language can be any type of programming language, such as Java and the like; the language elements in the programming language may be elements of operations or functions in the programming language, such as assignment operations, call functions, and the like, and accordingly, the primitive nodes may be understood as graphic elements obtained by encapsulating the language elements in the programming language, for forming the business process flow diagram and displaying the business process flow diagram in a graphic manner.
In this embodiment, the target code template may be understood as a template used when generating code of a target service, and may be obtained from a code template library configured by the software development platform. For example, code templates suitable for services with different service attributes may be constructed in advance for each programming language, and stored in a code template library, so that, when a service code is generated, a code template matching the service attribute of the target service may be obtained from the code template library as a target code template of the target service. At this time, preferably, before the obtaining the target service flowchart and the target code template of the target service, the method further includes: and determining the target code template of the target service according to the service attribute of the target service.
The construction mode of the code template can be flexibly selected according to needs, for example, a large number of standard service codes which are suitable for services with different service attributes and meet the code design specification of the current programming language can be obtained, the standard service codes are modeled, and the code template suitable for the services with different service attributes is extracted; a plurality of code templates which are in accordance with the code design specification can also be written in advance by developers for services with different service attributes. The service attribute of the target service may include a programming language of an environment in which the target service operates, a service requirement of the target service, and the like, and the service requirement of the target service may be determined by parsing a service requirement file of the target service or input to the software development platform by a developer. Illustratively, when programmed in the Java language, the code template may be a Jet code template.
And S120, determining the flow chart information of the target business flow chart.
Illustratively, after the target business flowchart of the target business is obtained, description information of the target business flowchart, such as structure information of the target business flowchart, information of a Unified Modeling L (UM L) diagram, node data, a domain-specific language (DS L) definition, and the like, of the target business flowchart or a computer device carrying the software development platform, may be further obtained as the flowchart information of the target business flowchart.
S130, extracting code information of the target service from the flow chart information, wherein the code information comprises structure information and operation information of each target graphic element node in the target service flow chart.
In this embodiment, since the flow chart information of the target service flow chart includes some information, which describes the display manner of the target service flow chart and is useless for the service code of the target service that needs to be generated, such as information of fonts, shapes, sizes, positions, and the like when each target primitive node in the target service flow chart is displayed, after the flow chart information of the target service flow chart is determined, the structure information and the operation information of each target primitive node can be further extracted from the determined flow chart information, so as to generate the service code of the target service based on the structure information and the operation information of each target primitive node. The structural information of the target primitive node may be connection relation information of the target primitive node, that is, connection relations between the current target primitive node and other primitive nodes in the target business process diagram; the operation information of the target primitive node may be understood as information describing an operation corresponding to the target primitive node, such as an expression of the operation corresponding to the target primitive node. In this step, the mode of extracting the structure information and the operation information of each target primitive node from the flow chart information can be selected as required, and if the determined flow chart information is not operated, the structure information and the operation information of each target primitive node can be directly obtained from the flow chart information; or deleting non-code information in the flow chart information, namely deleting other information except the structural information and the operation information of each target primitive node in the flow chart information, thereby obtaining the structural information and the operation information of each target primitive node.
S140, generating a service code of the target service based on the code information and the target code template.
In this step, the service code of the target service can be generated based on the code information of the target service and the target code template, thereby ensuring that the generated service code strictly follows the relevant coding specification and further improving the quality of the generated service code. Specifically, the extracted structural information and operation information of each target primitive node can be linked with a target code template to obtain a service code of a target service; or, the operation relationship between the target nodes is determined according to the code information of the target service, and the operation terms, operation expressions, and the like in the determined operation relationship are respectively added to the corresponding positions of the target code template to obtain the service code of the target service, which may be determined according to the requirement of the target code template on the linked or added information, and this embodiment does not limit this.
The method for generating the service code, provided by the embodiment of the present invention, includes obtaining a target service flowchart and a target code template of a target service, determining flowchart information of the target service flowchart, extracting code information of the target service from the flowchart information, where the code information includes structure information and operation information of each target primitive node in the target service flowchart, and further generating the service code of the target service according to the code information and the target code template. By adopting the technical scheme, the embodiment can realize automatic generation of the service code, reduce the requirements of software development on developers and improve the coding efficiency of the service code.
Example two
Fig. 2 is a schematic flow chart of a method for generating a service code according to a second embodiment of the present invention. Based on the above embodiments, the present embodiment further optimizes "a target service flowchart for constructing a target service according to an editing operation of a developer in a development interface" as follows: when detecting that a developer triggers a template selection operation, displaying an original flow chart template selected by the developer in a design area of a development interface; and updating the original primitive nodes in the original flow chart template based on the editing operation of a developer to obtain a target service flow chart of the target service.
Further, after extracting the code information of the target service from the flowchart information, the method further includes: and generating a target design document of the target service according to the code information.
Correspondingly, as shown in fig. 2, the method for generating a service code provided in this embodiment includes:
s210, when detecting that the developer triggers the template selection operation, displaying the original flow chart template selected by the developer in a design area of a development interface.
In this step, when it is detected that the visual software design platform obtained by packaging in this embodiment is triggered, a template selection interface may be displayed to the developer, and when it is detected that the developer selects a certain flow chart template in the template interface, the flow chart template selected by the developer is determined as an original flow chart template of a target business flow chart of the target business generated at this time, and is switched to the development interface, and the flow chart template is displayed in a design area of the development interface, so that a subsequent developer edits the original flow chart template in the design area, and thus, the developer is guided to design and implement the business flow according to the design specification by means of the flow chart template, and the enterprise-level design specification is promoted to fall to the ground.
In this embodiment, one or more flowchart templates in the flowchart template library may be displayed in the template selection interface, and a template imported by a developer may be further displayed, that is, in this embodiment, an Entity-relationship diagram (ERD) model of a database and an interface design document may also be directly imported into the visualization software design platform, so that the visualization software design platform may generate a flowchart template suitable for the visualization software design platform according to the imported EMR model of the database and the interface design document. Wherein, the flow chart template in the flow chart template library can be obtained by modeling in advance; the database ERD model and the interface design document are results formed by developers in a previous summary design stage and a detailed design stage, and the developers can build the business process diagram in a direct importing mode, so that repetitive labor is avoided, and the error probability is reduced.
In the present embodiment, the development interface (as shown in fig. 3) provided by the visualization software design platform may include a project list area 31, an information area 32, a design area 33, a primitive toolbox area 34, and a component library area 35. The project list area 31 is used for displaying projects which are currently imported into a working interval of the visualization software design platform or projects which are currently processed; the information area 32 is used for displaying the input and output interfaces of the current component and temporary variables defined by a developer; the design area 33 is an editing area of the business flowchart (or the original flowchart template); the primitive toolbox area 34 is used for displaying the primitive nodes obtained by the visual design platform encapsulation; the component library area 35 is used for displaying all components of the visual software design platform which are developed and uploaded to the component library. Wherein, a component can be understood as a flow chart capable of implementing a function, and it can be composed of a plurality of primitive nodes; the component library may include not only application components but also components packaged by the underlying platform for implementing common functions, such as access components and character code conversion components of a database.
And S220, updating the original primitive nodes in the original flow chart template based on the editing operation of a developer to obtain a target service flow chart of the target service.
In this step, after the developer selects the original flowchart template, the developer may edit the original primitive nodes included in the original flowchart template, such as changing the original primitive nodes in the original flowchart template, deleting the original primitive nodes in the original flowchart template, and/or adding new primitive nodes to the original flowchart template. The original flowchart template is a flowchart template selected by a user, and it can be understood that the editing operation of the original flowchart template by the user when generating the target business flowchart does not affect the corresponding flowchart template in the flowchart template library, that is, the editing operation of the user only updates the original flowchart template displayed in the development interface at this time, and does not change any template in the flowchart template library. When the original primitive nodes contained in the original flow chart template are edited, a single original primitive node contained in the original flow chart template can be edited by taking the primitive node as a unit, for example, the primitive node in the primitive toolbox displayed in the right primitive toolbox area can be dragged to a design area, and the primitive node is connected with at least one other primitive node in the editing area by a connecting line; the method can also be used for editing the original primitive nodes contained in the original flow chart template in batches by taking the components as units, for example, the construction in the construction library displayed in the component library area can be dragged to the design area so as to be called by other components/primitive nodes in the design area, and the method can be flexibly selected according to actual needs. Therefore, through the graphical interface, developers unfamiliar with the host development language can also develop executable program codes meeting the design specifications, and the requirements on the developers are reduced.
In a specific implementation manner of this embodiment, the editing of the data item in the primitive node displayed in the design area may be performed based on an editing operation of a developer, and at this time, the updating of the original primitive node in the original flowchart template based on the editing operation of the developer may optimally include: when detecting that a developer clicks an original primitive node in the original flow chart template, displaying a graphical interface of the original primitive node so that the developer edits data items in the original primitive node based on a data dictionary, wherein the data dictionary is recorded with definition specifications of various types of data items.
In the foregoing specific embodiment, a developer may click (e.g., double click) on a flow graph node in the development area, open a graphical interface of the flow graph node, and edit the contents of the primitive node (e.g., data items in the primitive node) in the graphical interface. Taking the primitive node as the data transfer primitive node for performing assignment transfer as an example, after the developer double-clicks the data transfer primitive node, the graphical interface of the data transfer primitive node is opened, as shown in fig. 4, the data transfer primitive node may be composed of source data and target data shown in a process data operation area 42, and data items under the source data and the target data may be dragged from a process data area 41 on the left side of the graphical interface. The data structure of the primitive node can be represented by data items, the data items are basic units forming the data structure, the data items can be defined based on a data dictionary in the industry and are uniformly controlled by a visual software design platform, and the data items can be defined by attributes such as standard ID, English name, Chinese name and data type (namely the length of data); each data item constructed by the constructed input/output interface, the bottom technical platform and the visual software design platform is displayed in the process data area 41, and when a developer defines a new data item by himself, the data item defined by the developer can be displayed in the process data area 41; the process data operation area 42 is an area for displaying the contents of primitive nodes, and the developer can edit the contents of the primitive nodes in the process data operation area 42.
S230, obtaining a service flow chart and a code template of the target service, wherein the target service flow chart comprises a plurality of primitive nodes, the primitive nodes are obtained by packaging language elements in a programming language, and the code template is obtained by modeling based on a standard service code which accords with a code design specification.
S240, determining the flow chart information of the business flow chart.
And S250, extracting code information of the target service from the flow chart information, wherein the code information comprises structure information and operation information of each target graphic element node in the target service flow chart.
And S260, determining that the code information passes verification.
In this embodiment, after the code information of the target service is extracted, the extracted code information may be verified according to a preset verification rule, so as to reduce errors generated by a program developer in a programming stage. The check rule may be set as required, for example, it may include a check on whether the service start information and the service end information exist in the code information, a check on whether the setting of the data item in each target primitive node conforms to a definition specification specified by the data dictionary, and the like.
S270, generating a business code of the target business based on the code information and the target code template.
S280, generating a target design document of the target service according to the code information.
In this embodiment, the target design document is a design document that the target business needs to generate, which may include, but is not limited to, a database design document, a correlation document, a component design document, and/or an interface design document. Wherein, the database design document is a document describing data table design information in the target service; the correlation document is a document describing the mutual calling relationship between target graphic element nodes and/or components in the target service; the component design document is a document describing the composition of components in the target service, such as a document describing the flow and input/output interfaces of the components; an interface design document is a document that describes data items contained in an interface.
For example, the requirement information of the target design document may be determined according to the type of the target design document, the requirement information is extracted from the code information of the target service, and the requirement information is added to a corresponding position of a file template of the target design document to obtain the target design document of the target service, so that the generated target design document is exported for viewing by related personnel. Therefore, the consistency and the synchronism between the design document and the service code are ensured, and the problem of difficult later maintenance caused by disjointing of the design document and the service code is avoided. The requirement information of a certain type of design document can be understood as information which needs to be extracted from code information of a target service when the design document of the type is generated, and the requirement information can be set by a developer in advance according to requirements of related personnel, for example, the requirement information of a database design document can include fields, main keys, indexes, sub-configurations and the like contained in a data table; the requirement information of the correlation document can comprise the structure information of each target primitive node and the information of the member to which the target primitive node belongs in the target business flow chart, so that the calling relationship between the target primitive node and the member is determined according to the structure information of each target primitive node and the information of the member to which the target primitive node belongs, and the calling relationship is added into the correlation document template to obtain the correlation document of the target business; the requirement information of the component design document can comprise input and output interface information of the component and interface information of each primitive node in the component; the requirement information of the interface design document may include operation information of data items included in each input/output interface.
It should be noted that the present embodiment may generate or cause the target design document based on the range specified by the developer when generating or exporting the target design document, for example, the target design document may be generated or exported in units of business, components or assemblies. Here, a component may be understood as a module divided by business dimensions in a business system, and in the case of a business system being a bank system, its components may include components for public deposit, private deposit, debit card, and financial accounting.
In an optional embodiment, the method for generating the service code provided by this embodiment may be packaged and deployed in an Eclipse Integrated Development Environment in the form of an Eclipse plug-in, and finally provided to developers in the form of an Integrated Development Environment (IDE) for downloading and use, for example, in a banking system, the Eclipse plug-in obtained by packaging the method for generating the service code provided by this embodiment may be named as a Visual Module Development platform (VMD), an architecture diagram of which is shown in fig. 5, in this embodiment, a Java language is used for syntax semantic analysis, a primitive node of the VMD is abstracted according to a core platform application Development specification of a bank (as shown in table 1), and a Graphical Modeling Framework (GMF) and UM L technology provided by the Eclipse is used for visually presenting and editing the primitive node, so as to implement visualization Development of an application component, the software Development platform may use a service 2EE of a Graphical Modeling Framework (GMF) provided by the Eclipse, and the VMD may be used for establishing a Web management system, and for creating a Web management platform for managing and sharing resources, thereby implementing a virtual resource sharing platform.
TABLE 1
Figure BDA0002426631260000131
Figure BDA0002426631260000141
In the method for generating a service code provided in the second embodiment of the present invention, when it is detected that a developer triggers a template selection operation, an original flowchart template selected by the developer is displayed in a design area of a development interface, an original primitive node in the original flowchart template is updated based on an editing operation of the developer, a target service flowchart of a target service is obtained, code information included in the flowchart information of the target service flowchart is extracted and a code template of the target service is obtained, and then, when the code information passes a verification, a service code of the target service is generated based on the code information and the code template, and a target design document of the target service is generated based on the code information. By adopting the technical scheme, the business code can be visually generated, and the requirements of a business code generation process on developers are reduced; the accuracy and the standardability of the generated service codes can be improved, the consistency of the service codes and design documents is ensured, and the later change and the maintenance of the system are facilitated.
EXAMPLE III
The third embodiment of the present invention provides a device for generating a service code, which may be implemented by software and/or hardware, and may be integrated in a computer device having a service code generation function, and generate a service code of a target service by executing a method for generating a service code, and is suitable for a scenario of software development. Fig. 6 is a block diagram of a service code generation apparatus according to a third embodiment of the present invention. As shown in fig. 6, the apparatus for generating a service code provided in this embodiment includes: an acquisition module 601, an information determination module 602, an information extraction module 603, and a code generation module 604, wherein,
an obtaining module 601, configured to obtain a target service flow chart and a target code template of a target service, where the target service flow chart includes multiple target primitive nodes, the target primitive nodes are obtained by encapsulating language elements in a programming language, and the target code template is obtained by modeling based on a standard service code that meets a code design specification;
an information determining module 602, configured to determine flow chart information of the target business flow chart;
an information extraction module 603, configured to extract code information of the target service from the flowchart information, where the code information includes structure information and operation information of each target primitive node in the target service flowchart;
a code generating module 604, configured to generate a service code of the target service based on the code information and the target code template.
In the device for generating a service code provided by the third embodiment of the present invention, the target service flowchart and the target code template of the target service are acquired by the acquisition module, the flowchart information of the target service flowchart is determined by the information determination module, the code information of the target service is extracted from the flowchart information by the information extraction module, the code information includes structure information and operation information of each target primitive node in the target service flowchart, and the service code of the target service is generated by the code generation module according to the code information and the target code template. By adopting the technical scheme, the embodiment can realize automatic generation of the service code, reduce the requirements of software development on developers and improve the coding efficiency of the service code.
Further, the apparatus for generating a service code may further include: and the flow chart construction module is used for constructing the target business flow chart of the target business according to the editing operation of a developer in a development interface before the target business flow chart and the target code template of the target business are obtained.
In the foregoing solution, the flowchart building module may include: the template display unit is used for displaying an original flow chart template selected by a developer in a design area of a development interface when detecting that the developer triggers a template selection operation; and the node updating unit is used for updating the original primitive nodes in the original flow chart template based on the editing operation of a developer to obtain a target service flow chart of the target service.
In the above solution, the node updating unit may be configured to, when it is detected that a developer clicks an original primitive node in the original flowchart template, display a graphical interface of the original primitive node, so that the developer edits data items in the original primitive node based on a data dictionary, where the data dictionary records definition specifications of various types of data items.
Further, the apparatus for generating a service code may further include: and the template determining module is used for determining the target code template of the target service according to the service attribute of the target service before the target service flow chart and the target code template of the target service are obtained.
Further, the apparatus for generating a service code may further include: and the verification determining module is used for determining that the code information passes verification before the code information is added to the corresponding position of the target code template.
Further, the apparatus for generating a service code may further include: and the document generating module is used for generating a target design document of the target service according to the code information after extracting the code information of the target service from the flow chart information.
The service code generation device provided by the third embodiment of the present invention can execute the service code generation method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the service code generation method. For the technical details that are not described in detail in this embodiment, reference may be made to a method for generating a service code provided in any embodiment of the present invention.
Example four
Fig. 7 is a schematic structural diagram of a computer device according to a fourth embodiment of the present invention, as shown in fig. 7, the computer device includes a processor 70 and a memory 71, and may further include an input device 72 and an output device 73; the number of the processors 70 in the computer device may be one or more, and one processor 70 is taken as an example in fig. 7; the processor 70, the memory 71, the input device 72 and the output device 73 in the computer apparatus may be connected by a bus or other means, and the connection by the bus is exemplified in fig. 7.
The memory 71 is a computer-readable storage medium, and can be used for storing software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the service code generation method in the embodiment of the present invention (for example, the acquisition module 301, the information determination module 302, the information extraction module 303, and the code generation module 304 in the service code generation apparatus). The processor 70 executes various functional applications and data processing of the computer device by executing software programs, instructions and modules stored in the memory 71, that is, implements the above-described service code generation method.
The memory 71 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. Further, the memory 71 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, the memory 71 may further include memory located remotely from the processor 70, which may be connected to a computer device over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 72 may be used to receive input numeric or character information and generate key signal inputs relating to user settings and function controls of the computer apparatus. The output device 73 may include a display device such as a display screen.
An embodiment of the present invention further provides a storage medium containing computer-executable instructions, where the computer-executable instructions are executed by a computer processor to perform a method for generating a service code, and the method includes:
acquiring a target service flow chart and a target code template of a target service, wherein the target service flow chart comprises a plurality of target primitive nodes, the target primitive nodes are obtained by packaging language elements in a programming language, and the target code template is obtained by modeling based on a standard service code conforming to a code design specification;
determining the flow chart information of the target business flow chart;
extracting code information of the target service from the flow chart information, wherein the code information comprises structure information and operation information of each target graphic element node in the target service flow chart;
and generating a service code of the target service based on the code information and the target code template.
Of course, the storage medium provided by the embodiment of the present invention contains computer-executable instructions, and the computer-executable instructions are not limited to the method operations described above, and may also perform related operations in the service code generation method provided by any embodiment of the present invention.
Based on the understanding that the technical solutions of the present invention can be embodied in the form of software products, such as floppy disks, Read-Only memories (ROMs), Random Access Memories (RAMs), flash memories (F L ASHs), hard disks or optical disks of a computer, etc., and include instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods according to the embodiments of the present invention.
It should be noted that, in the embodiment of the apparatus for generating a service code, each unit and each module included in the embodiment are only divided according to functional logic, but are not limited to the above division, as long as the corresponding function can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A method for generating a service code, comprising:
acquiring a target service flow chart and a target code template of a target service, wherein the target service flow chart comprises a plurality of target primitive nodes, the target primitive nodes are obtained by packaging language elements in a programming language, and the target code template is obtained by modeling based on a standard service code conforming to a code design specification;
determining the flow chart information of the target business flow chart;
extracting code information of the target service from the flow chart information, wherein the code information comprises structure information and operation information of each target graphic element node in the target service flow chart;
and generating a service code of the target service based on the code information and the target code template.
2. The method of claim 1, wherein before the obtaining the target business flow diagram and the target code template of the target business, further comprising:
and constructing a target business flow chart of the target business according to the editing operation of the developer in the development interface.
3. The method of claim 2, wherein constructing a target business flow diagram of a target business according to editing operations of a developer in a development interface comprises:
when detecting that a developer triggers a template selection operation, displaying an original flow chart template selected by the developer in a design area of a development interface;
and updating the original primitive nodes in the original flow chart template based on the editing operation of a developer to obtain a target service flow chart of the target service.
4. The method of claim 3, wherein the updating the original primitive nodes in the original flowchart template based on the editing operation of the developer comprises:
when detecting that a developer clicks an original primitive node in the original flow chart template, displaying a graphical interface of the original primitive node so that the developer edits data items in the original primitive node based on a data dictionary, wherein the data dictionary is recorded with definition specifications of various types of data items.
5. The method of claim 1, wherein before the obtaining the target business flow diagram and the target code template of the target business, further comprising:
and determining the target code template of the target service according to the service attribute of the target service.
6. The method of claim 1, further comprising, prior to adding the code information to the respective location of the target code template:
and determining that the code information passes the verification.
7. The method according to any one of claims 1 to 6, further comprising, after extracting the code information of the target service from the flowchart information:
and generating a target design document of the target service according to the code information.
8. An apparatus for generating a service code, comprising:
the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring a target service flow chart and a target code template of a target service, the target service flow chart comprises a plurality of target primitive nodes, the target primitive nodes are obtained by packaging language elements in a programming language, and the target code template is obtained by modeling based on a standard service code which accords with code design specifications;
the information determining module is used for determining the flow chart information of the target business flow chart;
the information extraction module is used for extracting code information of the target service from the flow chart information, wherein the code information comprises structural information and operation information of each target graphic element node in the target service flow chart;
and the code generation module is used for generating the service code of the target service based on the code information and the target code template.
9. A computer device, comprising:
one or more processors;
a memory for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement a method of generating a service code as claimed in any of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, is adapted to carry out the method of generating a service code according to any one of claims 1 to 7.
CN202010222687.9A 2020-03-26 2020-03-26 Service code generation method and device, computer equipment and storage medium Pending CN111427561A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010222687.9A CN111427561A (en) 2020-03-26 2020-03-26 Service code generation method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010222687.9A CN111427561A (en) 2020-03-26 2020-03-26 Service code generation method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111427561A true CN111427561A (en) 2020-07-17

Family

ID=71548866

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010222687.9A Pending CN111427561A (en) 2020-03-26 2020-03-26 Service code generation method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111427561A (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111930344A (en) * 2020-07-20 2020-11-13 哈尔滨工大峻煊科技有限公司 Real-time embedded system software and hardware coupling-oriented top-down visual modeling method
CN112015426A (en) * 2020-08-18 2020-12-01 上海高德威智能交通系统有限公司 Code management method, device and equipment
CN112130849A (en) * 2020-09-27 2020-12-25 建信金融科技有限责任公司 Automatic code generation method and device
CN112199086A (en) * 2020-09-18 2021-01-08 北京达佳互联信息技术有限公司 Automatic programming control system, method, device, electronic device and storage medium
CN112631699A (en) * 2020-12-21 2021-04-09 平安普惠企业管理有限公司 Application program display method, device, equipment and computer storage medium
CN113296789A (en) * 2021-06-16 2021-08-24 北京有竹居网络技术有限公司 Code generation method, device, equipment and storage medium
CN113296760A (en) * 2021-05-25 2021-08-24 深信服科技股份有限公司 Method for generating model code, computer device and readable storage medium
CN113626644A (en) * 2021-08-31 2021-11-09 北京中电普华信息技术有限公司 Method and device for converting formats of business process data
CN113703765A (en) * 2021-08-23 2021-11-26 风变科技(深圳)有限公司 Course data generation method and device, computer equipment and storage medium
CN114035803A (en) * 2022-01-10 2022-02-11 深圳市明源云科技有限公司 Code automatic generation method, device, equipment and computer readable storage medium
CN114115835A (en) * 2022-01-27 2022-03-01 广州庚亿信息科技有限公司 Automatic coding execution flow construction method and device, storage medium and intelligent terminal
CN115562641A (en) * 2022-10-27 2023-01-03 中电金信软件有限公司 Data processing method and device, electronic equipment and computer readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2404973A1 (en) * 2001-02-23 2002-09-06 Complementsoft Llc System and method for generating and maintaining software code
CN102591654A (en) * 2011-12-28 2012-07-18 方正国际软件有限公司 Code generator based on SSH (secure shell) architecture and method
CN104360859A (en) * 2014-11-14 2015-02-18 中国建设银行股份有限公司 Visual service development method and system
JP2018055389A (en) * 2016-09-28 2018-04-05 本田技研工業株式会社 Program creation support method
CN109408112A (en) * 2018-09-25 2019-03-01 平安科技(深圳)有限公司 In line development document structure tree method, apparatus, terminal and readable storage medium storing program for executing

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2404973A1 (en) * 2001-02-23 2002-09-06 Complementsoft Llc System and method for generating and maintaining software code
CN102591654A (en) * 2011-12-28 2012-07-18 方正国际软件有限公司 Code generator based on SSH (secure shell) architecture and method
CN104360859A (en) * 2014-11-14 2015-02-18 中国建设银行股份有限公司 Visual service development method and system
JP2018055389A (en) * 2016-09-28 2018-04-05 本田技研工業株式会社 Program creation support method
CN109408112A (en) * 2018-09-25 2019-03-01 平安科技(深圳)有限公司 In line development document structure tree method, apparatus, terminal and readable storage medium storing program for executing

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
罗嗣卿: "《软件工程导论》", 东北林业大学出版社, pages: 1 - 10 *
郭冬阳: "基于模板技术的UML状态图代码框架生成", 《中国优秀硕士学位论文全文数据库 (信息科技辑)》, no. 2, 15 December 2013 (2013-12-15), pages 138 - 487 *

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111930344A (en) * 2020-07-20 2020-11-13 哈尔滨工大峻煊科技有限公司 Real-time embedded system software and hardware coupling-oriented top-down visual modeling method
CN112015426A (en) * 2020-08-18 2020-12-01 上海高德威智能交通系统有限公司 Code management method, device and equipment
CN112015426B (en) * 2020-08-18 2023-12-26 上海高德威智能交通系统有限公司 Code management method, device and equipment
CN112199086A (en) * 2020-09-18 2021-01-08 北京达佳互联信息技术有限公司 Automatic programming control system, method, device, electronic device and storage medium
CN112130849B (en) * 2020-09-27 2023-08-22 建信金融科技有限责任公司 Code automatic generation method and device
CN112130849A (en) * 2020-09-27 2020-12-25 建信金融科技有限责任公司 Automatic code generation method and device
CN112631699A (en) * 2020-12-21 2021-04-09 平安普惠企业管理有限公司 Application program display method, device, equipment and computer storage medium
CN113296760A (en) * 2021-05-25 2021-08-24 深信服科技股份有限公司 Method for generating model code, computer device and readable storage medium
CN113296789A (en) * 2021-06-16 2021-08-24 北京有竹居网络技术有限公司 Code generation method, device, equipment and storage medium
CN113703765A (en) * 2021-08-23 2021-11-26 风变科技(深圳)有限公司 Course data generation method and device, computer equipment and storage medium
CN113703765B (en) * 2021-08-23 2023-10-17 风变科技(深圳)有限公司 Course data generation method, course data generation device, computer equipment and storage medium
CN113626644A (en) * 2021-08-31 2021-11-09 北京中电普华信息技术有限公司 Method and device for converting formats of business process data
CN113626644B (en) * 2021-08-31 2024-03-15 北京中电普华信息技术有限公司 Format conversion method and device for business process data
CN114035803A (en) * 2022-01-10 2022-02-11 深圳市明源云科技有限公司 Code automatic generation method, device, equipment and computer readable storage medium
CN114115835A (en) * 2022-01-27 2022-03-01 广州庚亿信息科技有限公司 Automatic coding execution flow construction method and device, storage medium and intelligent terminal
CN115562641A (en) * 2022-10-27 2023-01-03 中电金信软件有限公司 Data processing method and device, electronic equipment and computer readable storage medium
CN115562641B (en) * 2022-10-27 2024-05-10 中电金信软件有限公司 Data processing method, device, electronic equipment and computer readable storage medium

Similar Documents

Publication Publication Date Title
CN111427561A (en) Service code generation method and device, computer equipment and storage medium
Chen et al. Storydroid: Automated generation of storyboard for Android apps
WO2018201895A1 (en) Interface code generation method, apparatus, terminal device and medium
CN110244942B (en) Page generation method, device and system
CN112199086A (en) Automatic programming control system, method, device, electronic device and storage medium
CN111694565A (en) Data visualization application development method and system
CN113238740B (en) Code generation method, code generation device, storage medium and electronic device
CN112860247B (en) Custom generation method, device, equipment and medium of model component
CN112947914A (en) Code generation method and device based on model, computer equipment and medium
CN108268615B (en) Data processing method, device and system
CN113407284A (en) Navigation interface generation method and device, storage medium and electronic equipment
CN116360766A (en) Low-code system and device based on DDD visual designer
CN115857886A (en) Low code development platform for basic government affair application
CN113094776B (en) Method and system for constructing visual component model data and electronic equipment
CN110928995B (en) Interactive information processing method, device, equipment and storage medium
CN109063059A (en) User behaviors log processing method, device and electronic equipment
CN110889013B (en) Data association method, device, server and storage medium based on XML
CN115469849B (en) Service processing system, method, electronic equipment and storage medium
CN115543428A (en) Simulated data generation method and device based on strategy template
US20230161945A1 (en) Automatic two-way generation and synchronization of notebook and pipeline
CN114449063A (en) Message processing method, device and equipment
CN114625372A (en) Automatic component compiling method and device, computer equipment and storage medium
CN114281797A (en) Method for quickly creating basic level data aggregation warehouse based on agile low-code platform
CN114610309A (en) Object configuration method, device, equipment and storage medium
CN112363700A (en) Cooperative creation method and device of intelligent contract, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20220920

Address after: 25 Financial Street, Xicheng District, Beijing 100033

Applicant after: CHINA CONSTRUCTION BANK Corp.

Address before: 25 Financial Street, Xicheng District, Beijing 100033

Applicant before: CHINA CONSTRUCTION BANK Corp.

Applicant before: Jianxin Financial Science and Technology Co.,Ltd.

TA01 Transfer of patent application right