CN113515271A - Service code generation method and device, electronic equipment and readable storage medium - Google Patents

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

Info

Publication number
CN113515271A
CN113515271A CN202110537063.0A CN202110537063A CN113515271A CN 113515271 A CN113515271 A CN 113515271A CN 202110537063 A CN202110537063 A CN 202110537063A CN 113515271 A CN113515271 A CN 113515271A
Authority
CN
China
Prior art keywords
service
template
process configuration
file
code generation
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.)
Granted
Application number
CN202110537063.0A
Other languages
Chinese (zh)
Other versions
CN113515271B (en
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202110537063.0A priority Critical patent/CN113515271B/en
Publication of CN113515271A publication Critical patent/CN113515271A/en
Application granted granted Critical
Publication of CN113515271B publication Critical patent/CN113515271B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Stored Programmes (AREA)

Abstract

The disclosed embodiment provides a service code generation method, which can be applied to the financial field, the computer technical field or other fields. The method comprises the steps of obtaining a code generation request, wherein the code generation request comprises a service type identifier and a flow configuration file identifier of a target distributed service; responding to the code generation request, and determining a template file corresponding to the service type identifier and a process configuration file corresponding to the process configuration file identifier; respectively carrying out data structure conversion on the template file and the process configuration file to obtain template data corresponding to the template file and process configuration data corresponding to the process configuration file; and generating a distributed service code corresponding to the target distributed service according to the template data and the process configuration data. The embodiment of the disclosure also provides a service code generation device, an electronic device, a computer readable storage medium and a computer program product.

Description

Service code generation method and device, electronic equipment and readable storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a service code generation method, a service code generation apparatus, an electronic device, a computer-readable storage medium, and a computer program product.
Background
The distributed service development comprises the operations of demand analysis, overall scheme writing, detailed scheme writing, coding and the like. In the encoding operation, a developer needs to manually write the distributed service code of the distributed service.
In the course of implementing the disclosed concept, the inventors found that there are at least the following problems in the related art, and the development efficiency and the error rate are high with the related art.
Disclosure of Invention
In view of this, the disclosed embodiments provide a service code generation method, a service code generation apparatus, an electronic device, a computer-readable storage medium, and a computer program product.
One aspect of the embodiments of the present disclosure provides a service code generation method, including:
acquiring a code generation request, wherein the code generation request comprises a service type identifier and a flow configuration file identifier of a target distributed service;
responding to the code generation request, and determining a template file corresponding to the service type identifier and a process configuration file corresponding to the process configuration file identifier;
respectively carrying out data structure conversion on the template file and the process configuration file to obtain template data corresponding to the template file and process configuration data corresponding to the process configuration file; and
and generating a distributed service code corresponding to the target distributed service according to the template data and the process configuration data.
According to an embodiment of the present disclosure, a file format of the template file includes an extensible markup language;
wherein, data structure conversion is carried out on the template file to obtain template data corresponding to the template file, and the method comprises the following steps:
and calling a target class library to perform data structure conversion on the template file to obtain template data corresponding to the template file, wherein the target class library is a class library used for analyzing the extensible markup language file.
According to an embodiment of the present disclosure, the template file includes a tag identifier and tag content corresponding to the tag identifier, where the tag content includes fixed information and variable information;
the calling of the target class library is used for carrying out data structure conversion on the template file to obtain template data corresponding to the template file, and the method comprises the following steps:
calling the target class library to identify the label identification; and
and under the condition that the label identification is identified, performing data structure conversion on the label content corresponding to the label identification to obtain template data corresponding to the template file.
According to an embodiment of the present disclosure, the process configuration data includes a call relationship and a process parameter;
generating a distributed service code corresponding to the target distributed service according to the template data and the process configuration data, including:
and adding the flow parameters to the corresponding positions of the template data according to the calling relation, and generating a distributed service code corresponding to the target distributed service.
According to an embodiment of the present disclosure, the service code generation method further includes:
acquiring a coding specification of a service type, wherein the service type comprises an interface layer service, a service processing assembly layer service or a service object layer service; and
and generating a template file corresponding to the service type according to the coding specification, wherein the service type is characterized by the service type identifier.
According to an embodiment of the present disclosure, the service code generation method further includes:
acquiring a service requirement; and
and generating a process configuration file corresponding to the service requirement according to the service requirement, wherein the process configuration file is represented by the process configuration file identifier.
According to an embodiment of the present disclosure, the acquiring a code generation request includes:
determining the service type identification in response to a service type selection operation;
responding to the selection operation of the process configuration file, and determining the process configuration file identifier; and
and responding to the code generation determination operation, and generating the code generation request according to the service type identifier and the flow configuration file identifier.
According to an embodiment of the present disclosure, the service code generation method further includes:
responding to the storage path selection operation, and acquiring a storage path; and
and storing the distributed service code according to the storage path.
Another aspect of the embodiments of the present disclosure provides a service code generation apparatus, including:
the system comprises a first acquisition module, a first processing module and a second acquisition module, wherein the first acquisition module is used for acquiring a code generation request, and the code generation request comprises a service type identifier and a flow configuration file identifier of a target distributed service;
the determining module is used for responding to the code generation request, and determining a template file corresponding to the service type identifier and a process configuration file corresponding to the process configuration file identifier;
the conversion module is used for respectively carrying out data structure conversion on the template file and the process configuration file to obtain template data corresponding to the template file and process configuration data corresponding to the process configuration file; and
and the first generation module is used for generating a distributed service code corresponding to the target distributed service according to the template data and the process configuration data.
Another aspect of an embodiment of the present disclosure provides an electronic device including: one or more processors; memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method as described above.
Another aspect of embodiments of the present disclosure provides a computer-readable storage medium storing computer-executable instructions for implementing the method as described above when executed.
Another aspect of an embodiment of the present disclosure provides a computer program product comprising computer executable instructions for implementing the method as described above when executed.
According to the embodiment of the disclosure, the template file and the process configuration file are determined in response to the code generation request, data structure conversion is respectively performed on the template file and the process configuration file to obtain the template data corresponding to the template file and the process configuration data corresponding to the process configuration file, and the distributed service code corresponding to the target distributed service is generated according to the template data and the process configuration data, so that the distributed service code is automatically compiled, the development efficiency is improved, the error rate is reduced, and the problems of low development efficiency and high error rate in the related technology are solved.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent from the following description of embodiments of the present disclosure with reference to the accompanying drawings, in which:
fig. 1 schematically shows an exemplary system architecture to which a service code generation method may be applied according to an embodiment of the present disclosure.
Fig. 2 schematically shows a flow chart of a service code generation method according to an embodiment of the present disclosure.
FIG. 3 schematically shows a schematic diagram of a code generation interface according to an embodiment of the present disclosure.
Fig. 4 schematically shows a block diagram of a service code generation apparatus according to an embodiment of the present disclosure.
Fig. 5 schematically shows a block diagram of an electronic device adapted to implement the above described method according to an embodiment of the present disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is illustrative only and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Where a convention analogous to "at least one of A, B and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B and C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.). Where a convention analogous to "A, B or at least one of C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B or C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
The existing distributed service development process generally comprises operations of demand analysis, overall scheme writing, detailed scheme writing and coding and the like. Wherein, in the encoding step, the developer, when analyzing the refinement scheme, typically refers to the old code before, and creates a new service according to the flow within the refinement scheme. A service may contain multiple service types, such as interface layer services, business process assembly layer services, and business object layer services, each of which includes a JavaBean (reusable Java component) for input and output. At present, the above work is manually completed by developers.
In the process of implementing the concept of the present disclosure, the inventor finds that in the related art, at least the following problem exists, in the existing development process, if a new service is added, each service layer and the javabeans of each service layer need to be written, and meanwhile, more contents need to be written under each service layer. Due to the fact that more processing contents are needed, time consumption and high cost are caused by a manual writing mode, and errors are prone to occurring.
Embodiments of the present disclosure provide a service code generation method, a service code generation apparatus, an electronic device, a computer-readable storage medium, and a computer program product. The service code generation method, the service code generation apparatus, the electronic device, the computer-readable storage medium, and the computer program product provided in the embodiments of the present disclosure may be applied to the financial field and the computer technology field, and may also be applied to any field other than the financial field and the computer technology field.
The service code generation method comprises the steps of obtaining a code generation request, wherein the code generation request comprises a service type identifier and a flow configuration file identifier of a target distributed service; responding to the code generation request, and determining a template file corresponding to the service type identifier and a process configuration file corresponding to the process configuration file identifier; respectively carrying out data structure conversion on the template file and the process configuration file to obtain template data corresponding to the template file and process configuration data corresponding to the process configuration file; and generating a distributed service code corresponding to the target distributed service according to the template data and the process configuration data.
Fig. 1 schematically illustrates an exemplary system architecture 100 to which a service code generation method may be applied, according to an embodiment of the disclosure. It should be noted that fig. 1 is only an example of a system architecture to which the embodiments of the present disclosure may be applied to help those skilled in the art understand the technical content of the present disclosure, and does not mean that the embodiments of the present disclosure may not be applied to other devices, systems, environments or scenarios.
As shown in fig. 1, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired and/or wireless communication links, and so forth.
The account may use the terminal devices 101, 102, 103 to interact with the server 105 over the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have installed thereon various communication client applications, such as a shopping-like application, a web browser application, a search-like application, an instant messaging tool, a mailbox client, and/or social platform software, etc. (by way of example only).
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 105 may be a server providing various services, such as a background management server (for example only) providing support for websites browsed by the accounts using the terminal devices 101, 102, 103. The background management server may analyze and perform other processing on the received data such as the account request, and feed back a processing result (e.g., a webpage, information, or data obtained or generated according to the account request) to the terminal device.
It should be noted that the service code generation method provided by the embodiment of the present disclosure may be generally executed by the server 105. Accordingly, the service code generation apparatus provided by the embodiment of the present disclosure may be generally disposed in the server 105. The service code generation method provided by the embodiment of the present disclosure may also be executed by a server or a server cluster that is different from the server 105 and is capable of communicating with the terminal devices 101, 102, 103 and/or the server 105. Accordingly, the service code generation apparatus provided by the embodiment of the present disclosure may also be disposed in a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, 103 and/or the server 105. Alternatively, the service code generation method provided by the embodiment of the present disclosure may also be executed by the terminal device 101, 102, or 103, or may also be executed by another terminal device different from the terminal device 101, 102, or 103. Accordingly, the service code generation apparatus provided by the embodiment of the present disclosure may also be disposed in the terminal device 101, 102, or 103, or in another terminal device different from the terminal device 101, 102, or 103.
For example, the code generation request may be originally received by any one of the terminal devices 101, 102, or 103 (for example, the terminal device 101 is not limited thereto), and then the terminal device 101 may locally execute the service code generation method provided by the embodiment of the present disclosure, or transmit the code generation request to another terminal device, server, or server cluster, and execute the service code generation method provided by the embodiment of the present disclosure by another terminal device, server, or server cluster that receives the code generation request.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Fig. 2 schematically shows a flow chart of a service code generation method according to an embodiment of the present disclosure.
As shown in fig. 2, the method includes operations S201 to S204.
In operation S201, a code generation request is obtained, where the code generation request includes a service type identifier and a flow profile identifier of a target distributed service.
According to an embodiment of the present disclosure, the code generation request may be obtained by an electronic device, and the electronic device may include a terminal device, and the terminal device may include a smartphone, a tablet computer, a portable computer, a desktop computer, or the like. The service type identification can comprise an interface layer service identification, a business processing assembly layer service identification and a business object layer service identification. The process profile identification may include an identification of the process configuration corresponding to each service type, respectively.
In operation S202, in response to the code generation request, a template file corresponding to the service type identification and a flow profile corresponding to the flow profile identification are determined.
According to an embodiment of the present disclosure, a template file may include, for example, a first portion and a second portion. The first part may for example comprise a fixed value and the second part may for example comprise a variable value. The process configuration file may include, for example, a service process parameter document established in the development process, and the service process parameter may include, for example, a call relationship between services.
In operation S203, data structure conversion is performed on the template file and the process configuration file, respectively, to obtain template data corresponding to the template file and process configuration data corresponding to the process configuration file.
According to the embodiment of the disclosure, the template file and the process configuration file need to be identified before being used, so as to perform data structure conversion on the template file and the process configuration file.
For example, the development tool cannot work directly with the template file, and first identifies the template file, and establishes an entity class CodePattern (code pattern) used when the system automatically encodes according to each tag in the file.
In operation S204, a distributed service code corresponding to the target distributed service is generated according to the template data and the flow configuration data.
According to the embodiment of the disclosure, the template file and the process configuration file are determined in response to the code generation request, data structure conversion is respectively performed on the template file and the process configuration file to obtain the template data corresponding to the template file and the process configuration data corresponding to the process configuration file, and the distributed service code corresponding to the target distributed service is generated according to the template data and the process configuration data, so that the distributed service code is automatically compiled, the development efficiency is improved, the error rate is reduced, and the problems of low development efficiency and high error rate in the related technology are solved.
According to an embodiment of the present disclosure, the file format of the template file includes an extensible markup language. The template file in the extensible markup language format can be more convenient for the identification of development tools. Further, the file format of the template file may further include other file formats such as CVS (comma separated value file format), and the file format of the template file is not limited in the embodiment of the present disclosure.
According to the embodiment of the present disclosure, performing data structure conversion on a template file to obtain template data corresponding to the template file includes:
and calling a target class library to perform data structure conversion on the template file to obtain template data corresponding to the template file, wherein the target class library can be used for analyzing the extensible markup language file.
According to embodiments of the present disclosure, a target class library may include, for example, a collection of comprehensive object-oriented reusable types, which may include, for example, interfaces, abstract classes, and concrete classes.
For example, taking Java (computer programming language) as an example of a development tool, a template file is subjected to data structure conversion by a target class library corresponding to Java, and the contents of the template file are converted into contents that can be recognized by the Java file.
According to an embodiment of the present disclosure, a template file includes a tag identifier and tag content corresponding to the tag identifier, and the tag content includes fixed information and variable information.
According to an embodiment of the present disclosure, the fixed information may include, for example, reference contents, definitions of classes, and the like, and the variable information may include, for example, class names, method names, and the like.
According to the embodiment of the disclosure, calling a target class library to perform data structure conversion on a template file to obtain template data corresponding to the template file, including:
calling a target class library identification label; and
and under the condition that the label identification is identified, performing data structure conversion on the label content corresponding to the label identification to obtain template data corresponding to the template file.
According to the embodiment of the disclosure, firstly, the tag identification of the template file is identified through the target class library, after the content of the tag identification in the template file is determined, the tag content corresponding to the tag identification is identified and data structure conversion is carried out, and finally, the template data corresponding to the template file is obtained.
According to an embodiment of the present disclosure, the flow configuration data includes a call relationship and a flow parameter.
According to an embodiment of the present disclosure, the call relation may include, for example, a call situation between the respective services. The process parameters may include, for example, the parameter content at the runtime of the respective service.
According to the embodiment of the disclosure, generating a distributed service code corresponding to a target distributed service according to template data and process configuration data includes:
and adding the flow parameters to the corresponding positions of the template data according to the calling relation, and generating a distributed service code corresponding to the target distributed service.
According to the embodiment of the disclosure, the required code can be automatically generated through the template data and the process configuration data, and the development efficiency and the code development accuracy are improved.
According to an embodiment of the present disclosure, the service code generation method further includes:
acquiring a coding specification of a service type, wherein the service type comprises an interface layer service, a service processing assembly layer service or a service object layer service; and
and generating a template file corresponding to the service type according to the coding specification, wherein the service type is characterized by a service type identifier.
According to the embodiment of the disclosure, the template file generated according to the coding specifications of different service types can enable the data content to be more accurate, and the target class library can be conveniently identified.
According to an embodiment of the present disclosure, the service code generation method further includes:
acquiring a service requirement; and
and generating a process configuration file corresponding to the service requirement according to the service requirement, wherein the process configuration file is represented by a process configuration file identifier.
According to the embodiment of the disclosure, the process configuration file generated according to different business requirements can enable the data content to be more accurate, and the target class library can be conveniently identified.
According to an embodiment of the present disclosure, obtaining a code generation request includes:
responding to the service type selection operation, and determining a service type identifier;
responding to the selection operation of the process configuration file, and determining a process configuration file identifier; and
and responding to the code generation determination operation, and generating a code generation request according to the service type identifier and the flow configuration file identifier.
According to embodiments of the present disclosure, the selecting operation and the determining operation may include, for example, clicking or sliding.
According to an embodiment of the present disclosure, the distributed service code may be generated, for example, by exposing a code generation interface. Specifically, the code generation interface may include, for example, a data selection box, a type selection box, and a code generation selection box. The data selection box may include, for example, a template data selection box and a process configuration data selection box. The type selection box may include, for example, a service type selection box, which may include, for example, an interface layer service selection box, a business process assembly layer service selection box, and a business object layer service selection box. The code generation selection box may include, for example, a generate code button.
FIG. 3 schematically shows a schematic diagram of a code generation interface according to an embodiment of the present disclosure.
As shown in fig. 3, the code generation interface sequentially includes a template selection, a flow selection, an ATS service (interface layer service), an ACS service (business process assembly layer service), a BOS service (business object layer service), and a code generation button.
In the development process, template data and process configuration data are selected through a template selection option and a process selection option, then corresponding service types are selected, and finally a code generation button is clicked, so that codes can be generated according to the service code generation method of the embodiment of the disclosure.
It should be noted that the foregoing embodiments are only exemplary embodiments, and the code generation interface may also be in other display forms capable of achieving the same technical effect according to specific implementation needs. Meanwhile, the codes can be generated in other operation forms besides the display code generation interface.
According to an embodiment of the present disclosure, the service code generation method further includes:
responding to the storage path selection operation, and acquiring a storage path; and storing the distributed service codes according to the storage paths.
According to the embodiment of the disclosure, the generated distributed service code can be stored to the target path, so that the subsequent use is facilitated.
Fig. 4 schematically shows a block diagram of a service code generation apparatus according to an embodiment of the present disclosure.
As shown in fig. 4, the service code generation apparatus 400 includes a first acquisition module 401, a determination module 402, a conversion module 403, and a first generation module 404.
The first obtaining module 401 is configured to obtain a code generation request, where the code generation request includes a service type identifier and a process configuration file identifier of a target distributed service.
A determining module 402, configured to determine, in response to the code generation request, a template file corresponding to the service type identifier and a process configuration file corresponding to the process configuration file identifier.
A conversion module 403, configured to perform data structure conversion on the template file and the process configuration file, respectively, to obtain template data corresponding to the template file and process configuration data corresponding to the process configuration file.
A first generating module 404, configured to generate a distributed service code corresponding to the target distributed service according to the template data and the flow configuration data.
According to the embodiment of the disclosure, the template file and the process configuration file are determined in response to the code generation request, data structure conversion is respectively performed on the template file and the process configuration file to obtain the template data corresponding to the template file and the process configuration data corresponding to the process configuration file, and the distributed service code corresponding to the target distributed service is generated according to the template data and the process configuration data, so that the distributed service code is automatically compiled, the development efficiency is improved, the error rate is reduced, and the problems of low development efficiency and high error rate in the related technology are solved.
According to an embodiment of the present disclosure, the file format of the template file includes an extensible markup language.
The conversion module 403 includes a calling unit.
And the calling unit is used for calling a target class library to perform data structure conversion on the template file to obtain template data corresponding to the template file, wherein the target class library is a class library used for analyzing the extensible markup language file.
According to an embodiment of the present disclosure, a template file includes a tag identifier and tag content corresponding to the tag identifier, and the tag content includes fixed information and variable information.
The calling unit comprises a calling subunit and a converting subunit.
And the calling subunit is used for calling the identification label identifier of the target class library.
And the conversion subunit is used for performing data structure conversion on the label content corresponding to the label identifier under the condition that the label identifier is identified to obtain the template data corresponding to the template file.
According to an embodiment of the present disclosure, the flow configuration data includes a call relationship and a flow parameter.
Wherein the first generating module 404 includes an adding unit.
And the adding unit is used for adding the flow parameters to the corresponding positions of the template data according to the calling relation and generating distributed service codes corresponding to the target distributed services.
According to an embodiment of the present disclosure, the service code generation apparatus 400 further includes a second obtaining module and a second generating module.
And the second acquisition module is used for acquiring the coding specification of the service type, wherein the service type comprises an interface layer service, a business processing assembly layer service or a business object layer service.
And the second generation module is used for generating a template file corresponding to the service type according to the coding specification, wherein the service type is represented by the service type identifier.
According to an embodiment of the present disclosure, the service code generation apparatus 400 further includes a third obtaining module and a third generating module.
And the third acquisition module is used for acquiring the service requirement.
And the third generation module is used for generating a process configuration file corresponding to the business requirement according to the business requirement, wherein the process configuration file is represented by a process configuration file identifier.
According to an embodiment of the present disclosure, the first obtaining module 401 includes a first response unit, a second corresponding unit and a third corresponding unit.
And the first response unit is used for responding to the service type selection operation and determining the service type identification.
And the second response unit is used for responding to the selection operation of the process configuration file and determining the process configuration file identifier.
And the third response unit is used for responding to the code generation determination operation and generating a code generation request according to the service type identifier and the flow configuration file identifier.
According to an embodiment of the present disclosure, the service code generation apparatus 400 further includes a response module and a storage module.
And the response module is used for responding to the storage path selection operation and acquiring the storage path.
And the storage module is used for storing the distributed service codes according to the storage path.
Any number of modules, sub-modules, units, sub-units, or at least part of the functionality of any number thereof according to embodiments of the present disclosure may be implemented in one module. Any one or more of the modules, sub-modules, units, and sub-units according to the embodiments of the present disclosure may be implemented by being split into a plurality of modules. Any one or more of the modules, sub-modules, units, and sub-units according to the embodiments of the present disclosure may be implemented at least partially as a hardware Circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented by hardware or firmware in any other reasonable manner of integrating or packaging a Circuit, or implemented by any one of three implementations of software, hardware, and firmware, or any suitable combination of any of them. Alternatively, one or more of the modules, sub-modules, units, sub-units according to embodiments of the disclosure may be at least partially implemented as a computer program module, which when executed may perform the corresponding functions.
For example, any plurality of the first obtaining module 401, the determining module 402, the converting module 403 and the first generating module 404 may be combined and implemented in one module/unit/sub-unit, or any one of the modules/units/sub-units may be split into a plurality of modules/units/sub-units. Alternatively, at least part of the functionality of one or more of these modules/units/sub-units may be combined with at least part of the functionality of other modules/units/sub-units and implemented in one module/unit/sub-unit. According to an embodiment of the present disclosure, at least one of the first obtaining module 401, the determining module 402, the converting module 403, and the first generating module 404 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 a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented by hardware or firmware in any other reasonable manner of integrating or packaging a circuit, or implemented by any one of three implementations of software, hardware, and firmware, or implemented by a suitable combination of any of them. Alternatively, at least one of the first obtaining module 401, the determining module 402, the converting module 403 and the first generating module 404 may be at least partly implemented as a computer program module, which when executed may perform a corresponding function.
It should be noted that the service code generation apparatus part in the embodiment of the present disclosure corresponds to the service code generation method part in the embodiment of the present disclosure, and the description of the service code generation apparatus part specifically refers to the service code generation method part, which is not described herein again.
Fig. 5 schematically shows a block diagram of an electronic device adapted to implement the above described method according to an embodiment of the present disclosure. The electronic device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 5, an electronic device 500 according to an embodiment of the present disclosure includes a processor 501, which can perform various appropriate actions and processes according to a program stored in a Read-Only Memory (ROM) 502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. The processor 501 may comprise, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or associated chipset, and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), among others. The processor 501 may also include onboard memory for caching purposes. Processor 501 may include a single processing unit or multiple processing units for performing different actions of a method flow according to embodiments of the disclosure.
In the RAM 503, various programs and data necessary for the operation of the electronic apparatus 500 are stored. The processor 501, the ROM 502, and the RAM 503 are connected to each other by a bus 504. The processor 501 performs various operations of the method flows according to the embodiments of the present disclosure by executing programs in the ROM 502 and/or the RAM 503. Note that the programs may also be stored in one or more memories other than the ROM 502 and the RAM 503. The processor 501 may also perform various operations of method flows according to embodiments of the present disclosure by executing programs stored in the one or more memories.
According to an embodiment of the present disclosure, electronic device 500 may also include an input/output (I/O) interface 505, input/output (I/O) interface 505 also being connected to bus 504. The electronic device 500 may also include one or more of the following components connected to the I/O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output portion 507 including a Display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and a speaker; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The driver 510 is also connected to the I/O interface 505 as necessary. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
According to embodiments of the present disclosure, method flows according to embodiments of the present disclosure may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable storage medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511. The computer program, when executed by the processor 501, performs the above-described functions defined in the system of the embodiments of the present disclosure. The systems, devices, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
The present disclosure also provides a computer-readable storage medium, which may be contained in the apparatus/device/system described in the above embodiments; or may exist separately and not be assembled into the device/apparatus/system. The computer-readable storage medium carries one or more programs which, when executed, implement the method according to an embodiment of the disclosure.
According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. Examples may include, but are not limited to: a portable Computer diskette, a hard disk, a Random Access Memory (RAM), a Read-Only Memory (ROM), an Erasable Programmable Read-Only Memory (EPROM) or flash Memory), a portable compact Disc Read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the preceding. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
For example, according to embodiments of the present disclosure, a computer-readable storage medium may include ROM 502 and/or RAM 503 and/or one or more memories other than ROM 502 and RAM 503 described above.
Embodiments of the present disclosure also include a computer program product comprising a computer program containing program code for performing the method provided by the embodiments of the present disclosure, when the computer program product is run on an electronic device, the program code being adapted to cause the electronic device to implement the service code generation method provided by the embodiments of the present disclosure.
The computer program, when executed by the processor 501, performs the above-described functions defined in the system/apparatus of the embodiments of the present disclosure. The systems, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
In one embodiment, the computer program may be hosted on a tangible storage medium such as an optical storage device, a magnetic storage device, or the like. In another embodiment, the computer program may also be transmitted, distributed in the form of a signal on a network medium, downloaded and installed through the communication section 509, and/or installed from the removable medium 511. The computer program containing program code may be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
In accordance with embodiments of the present disclosure, program code for executing computer programs provided by embodiments of the present disclosure may be written in any combination of one or more programming languages, and in particular, these computer programs may be implemented using high level procedural and/or object oriented programming languages, and/or assembly/machine languages. The programming language includes, but is not limited to, programming languages such as Java, C + +, python, the "C" language, or the like. The program code may execute entirely on the account computing device, partly on the account device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the account computing device through any kind of Network, including a Local Area Network (LAN) or Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations 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 diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. Those skilled in the art will appreciate that various combinations and/or combinations of features recited in the various embodiments and/or claims of the present disclosure can be made, even if such combinations or combinations are not expressly recited in the present disclosure. In particular, various combinations and/or combinations of the features recited in the various embodiments and/or claims of the present disclosure may be made without departing from the spirit or teaching of the present disclosure. All such combinations and/or associations are within the scope of the present disclosure.
The embodiments of the present disclosure have been described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described separately above, this does not mean that the measures in the embodiments cannot be used in advantageous combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the present disclosure, and such alternatives and modifications are intended to be within the scope of the present disclosure.

Claims (12)

1. A service code generation method, comprising:
acquiring a code generation request, wherein the code generation request comprises a service type identifier and a flow configuration file identifier of a target distributed service;
responding to the code generation request, and determining a template file corresponding to the service type identifier and a process configuration file corresponding to the process configuration file identifier;
respectively carrying out data structure conversion on the template file and the process configuration file to obtain template data corresponding to the template file and process configuration data corresponding to the process configuration file; and
and generating a distributed service code corresponding to the target distributed service according to the template data and the process configuration data.
2. The method of claim 1, wherein the file format of the template file comprises an extensible markup language;
wherein, data structure conversion is carried out on the template file to obtain template data corresponding to the template file, and the method comprises the following steps:
and calling a target class library to perform data structure conversion on the template file to obtain template data corresponding to the template file, wherein the target class library is a class library used for analyzing the extensible markup language file.
3. The method of claim 2, wherein the template file comprises a tag identification and tag content corresponding to the tag identification, the tag content comprising fixed information and variable information;
the calling of the target class library is used for carrying out data structure conversion on the template file to obtain template data corresponding to the template file, and the method comprises the following steps:
calling the target class library to identify the label identification; and
and under the condition that the label identification is identified, performing data structure conversion on the label content corresponding to the label identification to obtain template data corresponding to the template file.
4. The method of any of claims 1-3, wherein the process configuration data includes call relationships and process parameters;
generating a distributed service code corresponding to the target distributed service according to the template data and the process configuration data, including:
and adding the flow parameters to the corresponding positions of the template data according to the calling relation, and generating a distributed service code corresponding to the target distributed service.
5. The method of any of claims 1-3, further comprising:
acquiring a coding specification of a service type, wherein the service type comprises an interface layer service, a service processing assembly layer service or a service object layer service; and
and generating a template file corresponding to the service type according to the coding specification, wherein the service type is characterized by the service type identifier.
6. The method of any of claims 1-3, further comprising:
acquiring a service requirement; and
and generating a process configuration file corresponding to the service requirement according to the service requirement, wherein the process configuration file is represented by the process configuration file identifier.
7. The method of any of claims 1-3, wherein the obtaining a code generation request comprises:
determining the service type identification in response to a service type selection operation;
responding to the selection operation of the process configuration file, and determining the process configuration file identifier; and
and responding to the code generation determination operation, and generating the code generation request according to the service type identifier and the flow configuration file identifier.
8. The method of any of claims 1-3, further comprising:
responding to the storage path selection operation, and acquiring a storage path; and
and storing the distributed service code according to the storage path.
9. A service code generation apparatus comprising:
the system comprises a first acquisition module, a first processing module and a second acquisition module, wherein the first acquisition module is used for acquiring a code generation request, and the code generation request comprises a service type identifier and a flow configuration file identifier of a target distributed service;
the determining module is used for responding to the code generation request, and determining a template file corresponding to the service type identifier and a process configuration file corresponding to the process configuration file identifier;
the conversion module is used for respectively carrying out data structure conversion on the template file and the process configuration file to obtain template data corresponding to the template file and process configuration data corresponding to the process configuration file; and
and the first generation module is used for generating a distributed service code corresponding to the target distributed service according to the template data and the process configuration data.
10. An electronic device, comprising:
one or more processors;
a memory for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-8.
11. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to carry out the method of any one of claims 1 to 8.
12. A computer program product comprising a computer program which, when executed by a processor, is adapted to carry out the method of any one of claims 1 to 8.
CN202110537063.0A 2021-05-17 2021-05-17 Service code generation method and device, electronic equipment and readable storage medium Active CN113515271B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110537063.0A CN113515271B (en) 2021-05-17 2021-05-17 Service code generation method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110537063.0A CN113515271B (en) 2021-05-17 2021-05-17 Service code generation method and device, electronic equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN113515271A true CN113515271A (en) 2021-10-19
CN113515271B CN113515271B (en) 2024-02-23

Family

ID=78064345

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110537063.0A Active CN113515271B (en) 2021-05-17 2021-05-17 Service code generation method and device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN113515271B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116048480A (en) * 2023-04-04 2023-05-02 青岛普瑞盛医药科技有限公司 Method and device for automatically generating chart based on code tool

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110265061A1 (en) * 2010-04-27 2011-10-27 Verizon Patent And Licensing Inc. Code generation
CN108563435A (en) * 2018-04-19 2018-09-21 北京百度网讯科技有限公司 The method and device of code building
CN111258567A (en) * 2018-12-01 2020-06-09 阿里巴巴集团控股有限公司 Service code development processing method and device
CN112558946A (en) * 2020-12-16 2021-03-26 中国平安人寿保险股份有限公司 Method, device and equipment for generating code and computer readable storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110265061A1 (en) * 2010-04-27 2011-10-27 Verizon Patent And Licensing Inc. Code generation
CN108563435A (en) * 2018-04-19 2018-09-21 北京百度网讯科技有限公司 The method and device of code building
CN111258567A (en) * 2018-12-01 2020-06-09 阿里巴巴集团控股有限公司 Service code development processing method and device
CN112558946A (en) * 2020-12-16 2021-03-26 中国平安人寿保险股份有限公司 Method, device and equipment for generating code and computer readable storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116048480A (en) * 2023-04-04 2023-05-02 青岛普瑞盛医药科技有限公司 Method and device for automatically generating chart based on code tool

Also Published As

Publication number Publication date
CN113515271B (en) 2024-02-23

Similar Documents

Publication Publication Date Title
CN113515271B (en) Service code generation method and device, electronic equipment and readable storage medium
CN112965916A (en) Page testing method, page testing device, electronic equipment and readable storage medium
CN110717992B (en) Method, apparatus, computer system and readable storage medium for scheduling model
CN113535565B (en) Interface use case generation method, device, equipment and medium
CN112506781B (en) Test monitoring method, device, electronic equipment, storage medium and program product
CN113448578A (en) Page data processing method, processing system, electronic device and readable storage medium
CN114035864A (en) Interface processing method, interface processing device, electronic device, and storage medium
CN113656041A (en) Data processing method, device, equipment and storage medium
CN111949259A (en) Risk decision configuration method, system, electronic equipment and storage medium
CN113032256A (en) Automatic test method, device, computer system and readable storage medium
CN113176907A (en) Interface data calling method and device, computer system and readable storage medium
CN109376023B (en) Method and equipment for generating calling information and issuing return code group
CN116821158A (en) Structured query statement generation method and device, electronic equipment and storage medium
CN116737160A (en) Code generation method and device, electronic equipment and computer readable storage medium
CN117395314A (en) Request processing method, request processing device, electronic equipment and storage medium
CN114266547A (en) Method, device, equipment, medium and program product for identifying business processing strategy
CN111026666A (en) Test data processing method, device, computer system and medium
CN115421738A (en) Version deployment method and device, electronic equipment and storage medium
CN115098391A (en) Page detection method, device, equipment and medium
CN115309404A (en) File generation method and device, electronic equipment and storage medium
CN114237624A (en) Go language-based error processing method, device, equipment, medium and product
CN114817073A (en) Automated testing method, apparatus, device, medium, and program product
CN113778350A (en) Log printing method and device
CN117472410A (en) Method, device and equipment for updating development tool in componentized development project
CN115934041A (en) Policy information generation method, device, 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
GR01 Patent grant
GR01 Patent grant