CN117931155A - Code generation method, device, equipment and medium - Google Patents

Code generation method, device, equipment and medium Download PDF

Info

Publication number
CN117931155A
CN117931155A CN202410109356.2A CN202410109356A CN117931155A CN 117931155 A CN117931155 A CN 117931155A CN 202410109356 A CN202410109356 A CN 202410109356A CN 117931155 A CN117931155 A CN 117931155A
Authority
CN
China
Prior art keywords
code
communication
service system
target service
interface
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
CN202410109356.2A
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.)
Agricultural Bank of China
Original Assignee
Agricultural Bank of China
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 Agricultural Bank of China filed Critical Agricultural Bank of China
Priority to CN202410109356.2A priority Critical patent/CN117931155A/en
Publication of CN117931155A publication Critical patent/CN117931155A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a code generation method, a code generation device, code generation equipment and a code generation medium. The method comprises the following steps: acquiring an interface document corresponding to a target service system; determining a message processing code statement corresponding to the target service system according to the interface document; determining component parameters of a communication component corresponding to the target service system according to the interface type in the interface document; and generating the communication code of the target service system according to the message processing code statement, the component parameters of the communication component and the communication code template. The embodiment of the invention can automatically generate the communication code of the target service system according to the interface document and the communication code template, thereby reducing the labor cost and the time cost in the code generation process and improving the code generation efficiency.

Description

Code generation method, device, equipment and medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a code generating method, apparatus, device, and medium.
Background
Enterprises typically deploy multiple business systems. Each service system is used for realizing different service functions. Communication codes of the respective service systems need to be generated in the process of deploying the respective service systems. The communication code of the service system is a code for calling an input interface and an output interface of the service system to realize communication between the service system and other service systems.
In the related art, a common code generation scheme is: the communication codes of the various business systems are written by technicians. The communication code of the service system comprises a plurality of repeated parts, and the code writing quantity is large. The code generation scheme in the related art needs to write communication codes of a service system manually, so that the labor cost and the time cost are high, and the code generation efficiency is low.
Disclosure of Invention
The invention provides a code generation method, a device, equipment and a medium, which are used for solving the problems that the code generation scheme in the related technology needs to write communication codes of a service system manually, the labor cost and the time cost are high, and the code generation efficiency is low.
According to an aspect of the present invention, there is provided a code generation method including:
Acquiring an interface document corresponding to a target service system;
determining a message processing code statement corresponding to the target service system according to the interface document;
determining component parameters of a communication component corresponding to the target service system according to the interface type in the interface document;
and generating the communication code of the target service system according to the message processing code statement, the component parameters of the communication component and the communication code template.
According to another aspect of the present invention, there is provided a code generating apparatus including:
The document acquisition module is used for acquiring an interface document corresponding to the target service system;
the code statement determining module is used for determining a message processing code statement corresponding to the target service system according to the interface document;
the component parameter determining module is used for determining component parameters of the communication component corresponding to the target service system according to the interface type in the interface document;
And the code generation module is used for generating the communication code of the target service system according to the message processing code statement, the component parameters of the communication component and the communication code template.
According to another aspect of the present invention, there is provided an electronic apparatus including:
At least one processor;
And a memory communicatively coupled to the at least one processor;
Wherein the memory stores a computer program for execution by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the code generation method of any one of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to execute a code generation method according to any one of the embodiments of the present invention.
According to the technical scheme, the interface document corresponding to the target service system is acquired; then, according to the interface file, determining a message processing code statement corresponding to the target service system; determining component parameters of a communication component corresponding to the target service system according to the interface type in the interface document; finally, according to the message processing code statement, the component parameters of the communication component and the communication code template, the communication code of the target service system is generated, the problem that the code generation scheme in the related technology needs to write the communication code of the service system manually, the labor cost and the time cost are high, and the code generation efficiency is low is solved, the communication code of the target service system can be automatically generated according to the interface document and the communication code template, the labor cost and the time cost in the code generation process are reduced, and the code generation efficiency is improved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a code generation method according to a first embodiment of the present invention.
Fig. 2 is a flowchart of a code generating method according to a second embodiment of the present invention.
Fig. 3 is a schematic structural diagram of a code generating device according to a third embodiment of the present invention.
Fig. 4 is a schematic structural diagram of an electronic device implementing a code generation method according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "object," "first," "second," and the like in the description and the claims of the present invention and the above drawings are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
Fig. 1 is a flowchart of a code generation method according to a first embodiment of the present invention. The embodiment can be applied to the situation of generating the communication code of the service system in the process of deploying the service system. The method may be performed by code generating means, which may be implemented in hardware and/or software, the code generating means being configurable in an electronic device. The electronic equipment is used for generating communication codes of the service system in the process of deploying the service system. As shown in fig. 1, the method includes:
Step 101, obtaining an interface document corresponding to a target service system.
Alternatively, the business system may be a server provided in the enterprise for implementing specified business functions. Enterprises typically deploy multiple business systems. Different service systems are used to implement different service functions. Communication codes of the respective service systems need to be generated in the process of deploying the respective service systems. The communication code of the service system is a code for calling an input interface and an output interface of the service system to realize communication between the service system and other service systems.
Optionally, the service system may receive the input message sent by the other service system by calling the input interface of the service system through the communication code of the service system, analyze the input message sent by the other service system, assemble the output message to be sent to the other service system, and call the output interface of the service system to send the output message to be sent to the other service system.
Optionally, the communication codes of the service systems may include the same code content and different code content. The different code content contained in the communication code of each service system may be a message processing code statement and a component parameter of a communication component in the communication code of each service system.
Optionally, the message handling code statements comprise an input message handling code statement and an output message handling code statement. The input message processing code statement is a code statement which is used for analyzing input sent by other service systems after operation. The output message processing code statement is a code statement used for assembling the output message which needs to be sent to other service systems after operation.
Optionally, the communication component is a component set in the service system for calling an input interface and an output interface of the service system. The component parameter of the communication component may be a component identification of the communication component. The component identification of the communication component may be a string or a numerical number for uniquely identifying the communication component.
Alternatively, the target service system is a service system that needs to generate a communication code. The target business system is in the deployment phase. The interface document corresponding to the target service system may be a document for storing interface parameters of the input interface and the output interface of the target service system and identification information of the interface parameters. Interface parameters include, but are not limited to, interface identification, interface type, calling mode of the interface, and interface use. The identification information of the interface parameter may be a character string or a numerical number for uniquely identifying the interface parameter.
Optionally, obtaining an interface document corresponding to the target service system includes: and acquiring an interface document which is sent by the target user and corresponds to the target service system.
Optionally, the target user may send an interface document corresponding to the target service system to the electronic device through the terminal device. The electronic equipment acquires an interface document which is sent by a target user and corresponds to the target service system. The target user may be a technician responsible for deploying the business system.
And 102, determining a message processing code statement corresponding to the target service system according to the interface document.
Optionally, the message processing code statement corresponding to the target service system is a message processing code statement that needs to be included in the communication code of the target service system.
Optionally, determining, according to the interface document, a message processing code statement corresponding to the target service system, including: generating an interface data model according to the interface document; and determining a message processing code statement corresponding to the target service system according to the interface data model.
Alternatively, the interface data model generated from the interface document may be a dictionary data structure for storing identification information of each interface parameter and each interface parameter in the interface document. Generating an interface data model according to the interface document, wherein the interface data model comprises the following steps: creating a dictionary; and storing the identification information of each interface parameter and each interface parameter in the interface document as key value pairs into the created dictionary to obtain an interface data model.
Optionally, determining, according to the interface data model, a message processing code statement corresponding to the target service system, including: and determining the message processing code statement corresponding to the target service system according to the interface data model and the corresponding relation between the preset interface data model and the message processing code statement.
Optionally, the electronic device stores a correspondence between a preset interface data model and a message processing code statement. The corresponding relation between the preset interface data model and the message processing code statement comprises each interface data model and the message processing code statement corresponding to each interface data model. Each interface data model is an interface data model generated from interface documents of each business system. The message processing code statement corresponding to the interface data model is a message processing code statement which needs to be contained in the communication code of the service system to which the interface data model belongs.
Optionally, determining the message processing code statement corresponding to the target service system according to the interface data model and the corresponding relation between the preset interface data model and the message processing code statement, including: inquiring a target interface data model which is the same as an interface data model generated according to an interface document corresponding to a target service system in each interface data model in the corresponding relation between a preset interface data model and message processing code sentences; acquiring a message processing code statement corresponding to a target interface data model from a corresponding relation between a preset interface data model and the message processing code statement; and determining the message processing code statement corresponding to the target interface data model as the message processing code statement corresponding to the target service system. The target interface data model is the same as the interface data model generated from the interface document corresponding to the target business system. The message processing code statement corresponding to the target interface data model is the message processing code statement needed to be contained in the communication code of the target service system.
Optionally, if the target interface data model which is the same as the interface data model generated according to the interface document corresponding to the target service system is not queried, the model abnormality prompt information is sent to the terminal equipment of the target user. The model abnormality prompting information is information set in advance for prompting that the same target interface data model as the interface data model generated from the interface document corresponding to the target business system is not queried. The terminal device of the target user is a terminal device used by the target user.
Optionally, the corresponding relationship between the preset interface data model and the message processing code statement may be stored in a local database of the electronic device. And uploading the corresponding relation between the preset interface data model and the message processing code statement to a local database of the electronic equipment by the target user.
And step 103, determining component parameters of the communication component corresponding to the target service system according to the interface type in the interface document.
Optionally, the component parameters of the communication component corresponding to the target service system are component parameters of the communication component to be included in the communication code of the target service system.
Optionally, determining, according to the interface type in the interface document, component parameters of a communication component corresponding to the target service system includes: and determining the component parameters of the communication component corresponding to the target service system according to the interface type in the interface document and the corresponding relation between the preset interface type and the component parameters. The electronic equipment stores the corresponding relation between the preset interface type and the component parameters. The corresponding relation between the preset interface types and the component parameters comprises each interface type and the component parameters corresponding to each interface type. The respective interface types are interface types of input interfaces and output interfaces of the respective service systems. The component parameters corresponding to the interface type are component parameters of the communication component which needs to be contained in the communication code of the service system to which the interface type belongs.
Optionally, determining the component parameter of the communication component corresponding to the target service system according to the interface type in the interface document and the corresponding relation between the preset interface type and the component parameter, including: extracting the interface type of the target service system from the interface document; the interface type of the target service system comprises the interface types of an input interface and an output interface of the target service system; inquiring a target interface type which is the same as the interface type of the target service system in each interface type in the corresponding relation between the preset interface type and the component parameters; acquiring a component parameter corresponding to the target interface type from a corresponding relation between a preset interface type and the component parameter; and determining the component parameters corresponding to the target interface type as the component parameters of the communication component corresponding to the target service system. The target interface type is the same as the interface type of the target business system. The component parameters corresponding to the target interface type are component parameters of the communication component needed to be contained in the communication code of the target service system.
Optionally, if the target interface type identical to the interface type of the target service system is not queried, sending the type abnormality prompt information to the terminal equipment of the target user. The type abnormality prompting information is preset information for prompting that the target interface type identical to the interface type of the target service system is not queried.
Optionally, the correspondence between the preset interface type and the component parameter may be stored in a local database of the electronic device. And uploading the corresponding relation between the preset interface type and the component parameters to a local database of the electronic equipment by the target user.
And 104, generating the communication code of the target service system according to the message processing code statement, the component parameters of the communication component and the communication code template.
Optionally, generating the communication code of the target service system according to the message processing code statement, the component parameters of the communication component and the communication code template includes: and filling the message processing code statement and the component parameters of the communication component into a communication code template to obtain the communication code of the target service system.
Alternatively, the communication code template may be a communication code written by a technician that does not include the message handling code statements and component parameters of the communication component. And uploading the communication code template to a local database of the electronic equipment by the target user. The communication code template comprises message processing code sentences and filling positions of component parameters of the communication component. And filling the message processing code statement and the component parameters of the communication component into the communication code template according to the filling positions of the message processing code statement and the component parameters of the communication component, and then obtaining the complete communication code.
Optionally, filling the message processing code statement and the component parameters of the communication component into a communication code template to obtain a communication code of the target service system, including: acquiring a communication code template; filling the message processing code statement to a first filling position in the communication code template; and filling the component parameters of the communication component to a second filling position in the communication code template to obtain the communication code of the target service system.
Optionally, a communication code template is stored in a local database of the electronic device. Obtaining a communication code template, comprising: and acquiring a communication code template from the local database.
Optionally, the first filling location in the communication code template is a location in the communication code template for filling the message handling code statement. The second fill location in the communication code template is a location in the communication code template for filling component parameters of the communication component. And filling the message processing code statement corresponding to the target service system to a first filling position in the communication code template, and filling the component parameters of the communication component corresponding to the target service system to a second filling position in the communication code template, so that the complete communication code of the target service system can be obtained.
Optionally, the electronic device acquires a communication code template, then fills the message processing code statement corresponding to the target service system into a first filling position in the communication code template, and fills the component parameters of the communication component corresponding to the target service system into a second filling position in the communication code template, so as to obtain the complete communication code of the target service system.
Optionally, after generating the communication code of the target service system according to the message processing code statement, the component parameters of the communication component and the communication code template, the method further includes: storing the communication code of the target service system into a preset code file; and providing the preset code file for a target user.
Optionally, the preset code file may be a file set in the electronic device and used for storing a communication code of the target service system. Providing the preset code file to a target user, including: and sending the preset code file to terminal equipment of the target user.
Optionally, the method further comprises: acquiring a code name sent by a target user; and setting the code name as the code name of the communication code corresponding to the target service system.
According to the technical scheme, the interface document corresponding to the target service system is acquired; then, according to the interface file, determining a message processing code statement corresponding to the target service system; determining component parameters of a communication component corresponding to the target service system according to the interface type in the interface document; finally, according to the message processing code statement, the component parameters of the communication component and the communication code template, the communication code of the target service system is generated, the problem that the code generation scheme in the related technology needs to write the communication code of the service system manually, the labor cost and the time cost are high, and the code generation efficiency is low is solved, the communication code of the target service system can be automatically generated according to the interface document and the communication code template, the labor cost and the time cost in the code generation process are reduced, and the code generation efficiency is improved.
Example two
Fig. 2 is a flowchart of a code generating method according to a second embodiment of the present invention. Embodiments of the invention may be combined with various alternatives to one or more of the embodiments described above. As shown in fig. 2, the method includes:
Step 201, obtaining an interface document corresponding to a target service system.
And 202, generating an interface data model according to the interface document.
And 203, determining a message processing code statement corresponding to the target service system according to the interface data model.
And 204, determining component parameters of the communication component corresponding to the target service system according to the interface type in the interface document.
And 205, filling the message processing code statement and the component parameters of the communication component into a communication code template to obtain the communication code of the target service system.
According to the technical scheme of the embodiment of the invention, the message processing code statement corresponding to the service system and the component parameters of the communication component can be automatically determined according to the interface document, then the communication code of the target service system is generated according to the message processing code statement, the component parameters of the communication component and the communication code template, so that the labor cost and the time cost in the code generation process are reduced, and the code generation efficiency is improved.
Example III
Fig. 3 is a schematic structural diagram of a code generating device according to a third embodiment of the present invention. The apparatus may be configured in an electronic device. As shown in fig. 3, the apparatus includes: a document acquisition module 301, a code statement determination module 302, a component parameter determination module 303, and a code generation module 304.
The document acquisition module 301 is configured to acquire an interface document corresponding to the target service system; a code statement determining module 302, configured to determine, according to the interface document, a message processing code statement corresponding to the target service system; a component parameter determining module 303, configured to determine component parameters of a communication component corresponding to the target service system according to an interface type in the interface document; the code generating module 304 is configured to generate a communication code of the target service system according to the message processing code statement, the component parameters of the communication component, and the communication code template.
According to the technical scheme, the interface document corresponding to the target service system is acquired; then, according to the interface file, determining a message processing code statement corresponding to the target service system; determining component parameters of a communication component corresponding to the target service system according to the interface type in the interface document; finally, according to the message processing code statement, the component parameters of the communication component and the communication code template, the communication code of the target service system is generated, the problem that the code generation scheme in the related technology needs to write the communication code of the service system manually, the labor cost and the time cost are high, and the code generation efficiency is low is solved, the communication code of the target service system can be automatically generated according to the interface document and the communication code template, the labor cost and the time cost in the code generation process are reduced, and the code generation efficiency is improved.
In an optional implementation of the embodiment of the present invention, optionally, the document acquisition module 301 is specifically configured to: and acquiring an interface document which is sent by the target user and corresponds to the target service system.
In an optional implementation manner of the embodiment of the present invention, optionally, the code statement determining module 302 is specifically configured to: generating an interface data model according to the interface document; and determining a message processing code statement corresponding to the target service system according to the interface data model.
In an optional implementation manner of the embodiment of the present invention, optionally, the component parameter determining module 303 is specifically configured to: and determining the component parameters of the communication component corresponding to the target service system according to the interface type in the interface document and the corresponding relation between the preset interface type and the component parameters.
In an optional implementation manner of the embodiment of the present invention, optionally, the code generating module 304 is specifically configured to: and filling the message processing code statement and the component parameters of the communication component into a communication code template to obtain the communication code of the target service system.
In an optional implementation manner of the embodiment of the present invention, optionally, when executing the operation of filling the message processing code statement and the component parameters of the communication component into the communication code template to obtain the communication code of the target service system, the code generation module 304 is specifically configured to: acquiring a communication code template; filling the message processing code statement to a first filling position in the communication code template; and filling the component parameters of the communication component to a second filling position in the communication code template to obtain the communication code of the target service system.
In an optional implementation manner of the embodiment of the present invention, optionally, the code generating device further includes: the code storage module is used for storing the communication code of the target service system into a preset code file; and the file providing module is used for providing the preset code file for the target user.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
The code generating device can execute the code generating method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of executing the code generating method.
Example IV
Fig. 4 shows a schematic diagram of the architecture of an electronic device 10 that may be used to implement the code generation method of an embodiment of the present invention. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 4, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program to be executed by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program built into the Random Access Memory (RAM) 13 from the storage unit 18. In the Random Access Memory (RAM) 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, read Only Memory (ROM) 12 and Random Access Memory (RAM) 13 are connected to each other by a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
The various components in the electronic device 10 are connected to an input/output (I/O) interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the respective methods and processes described above, for example, a code generation method.
In some embodiments, the code generation method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via Read Only Memory (ROM) 12 and/or communication unit 19. One or more steps of the code generation method described above may be performed when a computer program is built into Random Access Memory (RAM) 13 and executed by processor 11. Alternatively, in other embodiments, the processor 11 may be configured to perform the code generation method in any other suitable way (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for implementing the code generation methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, 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), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. A code generation method, comprising:
Acquiring an interface document corresponding to a target service system;
determining a message processing code statement corresponding to the target service system according to the interface document;
determining component parameters of a communication component corresponding to the target service system according to the interface type in the interface document;
and generating the communication code of the target service system according to the message processing code statement, the component parameters of the communication component and the communication code template.
2. The code generation method according to claim 1, wherein acquiring an interface document corresponding to a target business system comprises:
and acquiring an interface document which is sent by the target user and corresponds to the target service system.
3. The code generation method of claim 1, wherein determining a message processing code statement corresponding to the target business system based on the interface document comprises:
Generating an interface data model according to the interface document;
and determining a message processing code statement corresponding to the target service system according to the interface data model.
4. The code generation method according to claim 1, wherein determining component parameters of a communication component corresponding to the target service system according to an interface type in the interface document comprises:
and determining the component parameters of the communication component corresponding to the target service system according to the interface type in the interface document and the corresponding relation between the preset interface type and the component parameters.
5. The code generation method according to claim 1, wherein generating the communication code of the target service system according to the message processing code statement, the component parameters of the communication component, and the communication code template includes:
and filling the message processing code statement and the component parameters of the communication component into a communication code template to obtain the communication code of the target service system.
6. The code generation method according to claim 5, wherein the step of filling the message processing code statement and the component parameters of the communication component into a communication code template to obtain the communication code of the target service system includes:
Acquiring a communication code template;
Filling the message processing code statement to a first filling position in the communication code template;
And filling the component parameters of the communication component to a second filling position in the communication code template to obtain the communication code of the target service system.
7. The code generation method according to claim 1, further comprising, after generating the communication code of the target service system according to the message processing code statement, the component parameters of the communication component, and the communication code template:
storing the communication code of the target service system into a preset code file;
and providing the preset code file for a target user.
8. A code generating apparatus, comprising:
The document acquisition module is used for acquiring an interface document corresponding to the target service system;
the code statement determining module is used for determining a message processing code statement corresponding to the target service system according to the interface document;
the component parameter determining module is used for determining component parameters of the communication component corresponding to the target service system according to the interface type in the interface document;
And the code generation module is used for generating the communication code of the target service system according to the message processing code statement, the component parameters of the communication component and the communication code template.
9. An electronic device, the electronic device comprising:
At least one processor;
And a memory communicatively coupled to the at least one processor;
wherein the memory stores a computer program for execution by the at least one processor to enable the at least one processor to perform the code generation method of any one of claims 1-7.
10. A computer readable storage medium storing computer instructions for causing a processor to implement the code generation method of any one of claims 1-7 when executed.
CN202410109356.2A 2024-01-25 2024-01-25 Code generation method, device, equipment and medium Pending CN117931155A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410109356.2A CN117931155A (en) 2024-01-25 2024-01-25 Code generation method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410109356.2A CN117931155A (en) 2024-01-25 2024-01-25 Code generation method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN117931155A true CN117931155A (en) 2024-04-26

Family

ID=90764239

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410109356.2A Pending CN117931155A (en) 2024-01-25 2024-01-25 Code generation method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN117931155A (en)

Similar Documents

Publication Publication Date Title
CN116009847A (en) Code generation method, device, electronic equipment and storage medium
CN116303013A (en) Source code analysis method, device, electronic equipment and storage medium
CN116089739A (en) Message pushing method, device, electronic equipment and storage medium
CN115934550A (en) Test method, test device, electronic equipment and storage medium
CN115860877A (en) Product marketing method, device, equipment and medium
CN115269431A (en) Interface testing method and device, electronic equipment and storage medium
CN115618777A (en) File generation method, device, equipment and storage medium
CN117931155A (en) Code generation method, device, equipment and medium
CN115017047A (en) Test method, system, equipment and medium based on B/S architecture
CN114389969A (en) Client test method and device, electronic equipment and storage medium
CN113835893B (en) Data processing method, device, equipment, storage medium and program product
CN113515462B (en) Method, apparatus, device and storage medium for testing
CN113836291B (en) Data processing method, device, equipment and storage medium
CN117632120A (en) Processing system, method, equipment and storage medium for report data
CN117609064A (en) Unit test method and device, electronic equipment and storage medium
CN114238149A (en) Batch testing method of accounting system, electronic device and storage medium
CN117938909A (en) Data transmission method, device, equipment and medium
CN117056222A (en) Interface test file generation method and device, electronic equipment and storage medium
CN117493203A (en) Method, device, equipment and storage medium for testing server software
CN117271303A (en) Test case management method, device, equipment and medium
CN117632138A (en) Attendance application form analysis method and device, electronic equipment and storage medium
CN115567624A (en) Message processing method and device, electronic equipment and medium
CN115686479A (en) File creation method and related device
CN116974940A (en) Interface testing method, device, equipment and storage medium
CN117632874A (en) Automatic drawing storage method, device, equipment and medium for CAD software

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