CN111694561A - Interface management method, device, equipment and storage medium - Google Patents

Interface management method, device, equipment and storage medium Download PDF

Info

Publication number
CN111694561A
CN111694561A CN202010522353.3A CN202010522353A CN111694561A CN 111694561 A CN111694561 A CN 111694561A CN 202010522353 A CN202010522353 A CN 202010522353A CN 111694561 A CN111694561 A CN 111694561A
Authority
CN
China
Prior art keywords
interface
information
request
interface definition
definition
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
CN202010522353.3A
Other languages
Chinese (zh)
Inventor
林福炎
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Construction Bank Corp
Original Assignee
China Construction Bank Corp
CCB Finetech Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Construction Bank Corp, CCB Finetech Co Ltd filed Critical China Construction Bank Corp
Priority to CN202010522353.3A priority Critical patent/CN111694561A/en
Publication of CN111694561A publication Critical patent/CN111694561A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Abstract

The embodiment of the invention discloses an interface management method, an interface management device, interface management equipment and a storage medium. The method comprises the following steps: when an interface definition instruction input by a user is received, displaying an interface definition interactive interface; collecting interface definition information based on the interface definition interactive interface, and generating an interface document based on the interface definition information; and receiving request information input from the outside, and generating test data corresponding to the request information according to the request information and the interface document. According to the embodiment of the invention, the interface definition information is acquired by setting the interface definition interactive interface, and the interface document is generated, so that the problem of low cooperation efficiency of the front end and the back end is solved, the front end technical personnel and the back end technical personnel can simultaneously develop development work, the requirement of the front end technical personnel on test data is met, and the back end technical personnel can be prevented from repeatedly revising the interface code in the later period.

Description

Interface management method, device, equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of application development, in particular to an interface management method, device, equipment and storage medium.
Background
In the development process of the application product, the back-end technician is responsible for logic and provides data to the front-end technician, and the front-end technician is responsible for receiving the back-end data for display and interaction. The development mode of front-end separation and back-end separation allows technicians to concentrate on improving development efficiency in respective fields. However, there are some problems with this way of cooperation, such as: because the front-end technician and the back-end technician lack technical communication, the front-end technician can judge whether the interface meets the front-end requirement according to the generated test data only when joint debugging is carried out according to the interface document provided by the back-end technician. If the requirements are not met, the back-end technician is required to perform rework. The serial working mode can prolong the product development time, reduce the product development efficiency and increase the workload of front-end and back-end technicians.
In the prior art, an interface document is generated mainly by analyzing information of code data written by a back-end technician, but the technical means can be realized only by waiting for the back-end technician to write the code. And the same problems of repeated interface modifications due to lack of front-end technician involvement. Moreover, the existing interface management tool, such as Swagger, does not have the function of dynamically generating test data, so that the requirement of the front-end development process on the test data cannot be met.
Disclosure of Invention
The embodiment of the invention provides an interface management method, device, equipment and storage medium, which are used for improving the cooperation efficiency of a front end and a back end and dynamically generating test data required by front-end technicians.
In a first aspect, an embodiment of the present invention provides an interface management method, where the method includes:
when an interface definition instruction input by a user is received, displaying an interface definition interactive interface;
collecting interface definition information based on the interface definition interactive interface, and generating an interface document based on the interface definition information;
and receiving request information input from the outside, and generating test data corresponding to the request information according to the request information and the interface document.
In a second aspect, an embodiment of the present invention further provides an interface management apparatus, where the apparatus includes:
the interface definition module is used for displaying an interface definition interactive interface when receiving an interface definition instruction input by a user, acquiring interface definition information input by the user based on the interface definition interactive interface, and generating an interface document based on the interface definition information;
the information transmission module is used for receiving request information input by a user;
and the response simulation module is used for generating test data corresponding to the request information according to the request information and the interface document.
In a third aspect, an embodiment of the present invention further provides an apparatus, where the apparatus includes:
one or more processors;
a memory for storing one or more programs;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement any of the interface management methods referred to above.
In a fourth aspect, embodiments of the present invention also provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are configured to perform any of the above-mentioned interface management methods.
According to the embodiment of the invention, the interface definition information is acquired by setting the interface definition interactive interface, and the interface document is generated, so that the problem of low cooperation efficiency of the front end and the back end is solved, the front end technical personnel and the back end technical personnel can simultaneously develop development work, the requirement of the front end technical personnel on test data is met, and the back end technical personnel can be prevented from repeatedly revising the interface code in the later period.
Drawings
Fig. 1 is a flowchart of an interface management method according to an embodiment of the present invention.
Fig. 2A is a schematic diagram of a heads parameter collection module in an interface definition interaction interface according to an embodiment of the present invention.
Fig. 2B is a schematic diagram of a Query parameter collection module in an interface definition interaction interface according to an embodiment of the present invention.
Fig. 2C is a schematic diagram of a Body parameter collection module in the interface definition interaction interface according to an embodiment of the present invention.
Fig. 3A is a schematic diagram of an interface definition interaction interface according to an embodiment of the present invention.
Fig. 3B is a schematic diagram of interface definition information according to an embodiment of the present invention.
Fig. 4 is a flowchart of an interface management method according to a second embodiment of the present invention.
Fig. 5 is a flowchart of a response method of test data according to a second embodiment of the present invention.
Fig. 6 is a flowchart of importing and exporting an interface document according to a second embodiment of the present invention.
Fig. 7 is a schematic diagram of an interface management apparatus according to a third embodiment of the present invention.
Fig. 8 is a schematic structural diagram of an apparatus according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of an interface management method according to an embodiment of the present invention, where the embodiment is applicable to a product development situation based on a front-end mode and a back-end mode, the method may be executed by an interface management apparatus, the apparatus may be implemented in a software and/or hardware manner, and the apparatus may be configured in a terminal device. The method specifically comprises the following steps:
and S110, displaying an interface definition interactive interface when receiving an interface definition instruction input by a user.
In one embodiment, optionally, the manner in which the user input interface defines the instruction includes at least one of a shortcut key, a page option, and a code. In an exemplary embodiment, when a user inputs an interface definition instruction through a shortcut key, a corresponding relationship between the interface definition instruction and the shortcut key is established, and the shortcut key may be "shift + T" for example. The specific definition of the shortcut key is not limited here, and the user can customize the shortcut key. For example, when a user inputs an interface definition instruction through a page option, specifically, the user may input the interface definition instruction by clicking a page option corresponding to an interface definition function on a display interface of the terminal device, and specifically, the page option may also be an icon. In an exemplary embodiment, when a user inputs an interface definition instruction through a code, a corresponding relationship between the interface definition instruction and the code is established, and the user can input the interface definition instruction by writing the code. Specifically, the user may enter a code corresponding to the interface definition instruction in the "running" program of the terminal device.
The interface definition instruction is used for triggering the display interface to define the interactive interface. The interface definition interactive interface can enable a user to collect interface definition information input by the user.
And S120, collecting interface definition information based on the interface definition interactive interface, and generating an interface document based on the interface definition information.
In the example, the user inputs interface definition information in the interface definition interactive interface based on the content displayed by the interface definition interactive interface and the related operation method.
In one embodiment, optionally, the interface definition information includes basic information, request parameter information, and response data information.
In one embodiment, optionally, the basic information includes interface name, interface method, and interface path information. In an exemplary embodiment, the interface names are used to distinguish interfaces with different functions, and the user can customize the setting. In practical application, a front-end technician and a back-end technician negotiate to determine a required interface function and a naming mode of each functional interface. The interface method includes, for example, a method supported by an HTTP request (HyperText transfer Protocol). Illustratively, interface methods include, but are not limited to, GET, POST, PUT, DELETE, HEAD, OPTIONS, PATCH, TRACE, and the like. The GET is used for acquiring the specified resource and returning to the request body; the POST is used for submitting data to the specified resources for request processing, such as uploading files; the PUT is used for uploading the latest content to the specified resource; DELETE is used to DELETE a specified resource; HEAD is used to obtain the specified resource but not return to the requestor; the OPTIONS is used for returning the HTTP request method provided by the server for the specified resource; PATCH is used for updating partial content of the specified resource, such as updating a certain field; the TRACE echos the request received by the server end and is mainly used for testing or diagnosis. Illustratively, the interface path includes an interface URI (Uniform resource Identifier), illustratively, the interface path supports a Restful style, such as/api/users/: id.
In one embodiment, optionally, the request parameter information includes heads parameter information, Query parameter information, and Body parameter information. The HTTP request message comprises a request line, a request body, an empty line and request data. Wherein, the request head is composed of a key/value pair, and the key and the value are divided into a following part by': "separate. The request header is used for informing the server side of the request information of the client side. The Headers parameter includes the request header in the HTTP request message. Specifically, the Headers parameter information includes information such as a parameter name, a parameter value, an example, and a remark, where the example of the Headers parameter information may be Content-Type: application/json. Fig. 2A is a schematic diagram of a heads parameter collection module in an interface definition interaction interface according to an embodiment of the present invention. As shown in FIG. 2A, the Headers parameter acquisition interface includes an "Add Header" option, which a user may click to generate a new Headers parameter acquisition Unit. In fig. 2A, 3 heads parameter acquisition units are shown, each including a parameter name text box, a parameter value text box, and a remark information text box. The user can also click on the icon of the garbage can style behind the Headers parameter acquisition unit to delete the corresponding Headers parameter acquisition unit.
Wherein, Query parameter information is a parameter in a URL (Uniform Resource Locator) in the HTTP request message, and is located in "? "behind". The Query parameters are composed of key word/value pairs, and a plurality of Query parameters adopt "&" connection. Specifically, the Query parameter information includes information such as a parameter name, whether it is necessary to fill, examples, and remarks, where examples of the Query parameter information may be http:// example. and a, xxx and b, yyy, wherein a and b represent Query parameters, and xxx and yyy are the values of a and b, respectively. Fig. 2B is a schematic diagram of a Query parameter collection module in an interface definition interaction interface according to an embodiment of the present invention. As shown in fig. 2B, the Query parameter collection interface includes an option of "add Query parameter", and the user can generate a new Query parameter collection unit by clicking the option. Fig. 2B shows 3 Query parameter collection units, each of which includes a parameter name text box, a parameter value text box, and a remark information text box. The 'box' in each Query parameter acquisition unit represents 'whether the box needs to be filled up', and a user clicks the box to generate 'square root' in the box. The user can click a garbage can icon behind the Query parameter acquisition unit to delete the corresponding Query parameter acquisition unit.
The Body parameter comprises a request Body in the HTTP request message and supports the JSON format. In one embodiment, optionally, the Body parameter information is collected using a JSON property editor. Specifically, the Body parameter information includes information such as an attribute name, whether padding is necessary, an attribute type, a simulation rule, and remarks. Fig. 2C is a schematic diagram of a Body parameter collection module in the interface definition interaction interface according to an embodiment of the present invention. As shown in fig. 2C, "root" represents an attribute name, "box" represents "whether or not to fill up", "object" represents "attribute type", and "mock" represents "simulation rule". The user may add a new sub-Body parameter corresponding to the Body parameter by clicking the "+" icon behind the Body parameter collecting unit, as shown in fig. 2C, sub-Body parameters for "field _ 1", "field _ 2", and "field _ 3" being "root", and sub-Body parameters for "field _ 4" being "field _ 1". And the user can delete the corresponding Body parameter acquisition unit by clicking an 'x' icon behind the Body parameter acquisition unit.
In one embodiment, optionally, the response data information includes data in JSON format. Where, illustratively, the response data information is used to define constraints and rules for generating the test data. The schematic diagram of the response data information acquisition module in the interface definition interactive interface is similar to that in fig. 4, and the description is not repeated here.
Fig. 3A is a schematic diagram of an interface definition interaction interface according to an embodiment of the present invention. The interface definition interactive interface shown in fig. 3 includes a basic information acquisition module, a request parameter acquisition module and a response data acquisition module. And the two text boxes after the interface path are respectively an interface method text box and an interface path text box. After the user finishes editing the definition information of the current interface, clicking a 'save' button in the interface to save the definition information of the interface. The interface definition interactive interface also comprises an interface list used for displaying all collected interfaces. Specifically, the interfaces may be sorted, and the corresponding interfaces are displayed in different sorting lists, which include, for example, test interfaces.
In one embodiment, optionally, the interface definition information further includes an interface status, an interface creator, and an interface update time. The interface status is used to indicate the defined status of the current interface, and the interface status may be, for example, incomplete, completed, updated, and the like. Wherein the interface creator comprises the user who created the current interface. Specifically, before the interface definition interactive interface is displayed, an account number input prompt box is displayed, and when the input account number is the same as the stored account number, the interface definition interactive interface is displayed, so that interface definition information which is used for inputting the account number is allowed to be used. The interface update time is used for recording the edited time of the current interface, and specifically, the interface update time is recorded when the storage instruction is received.
Fig. 3B is a schematic diagram of interface definition information according to an embodiment of the present invention. The interface definition information of the interface shown in fig. 3B includes basic information, request parameter information, response data information, remarks, and modification records. Wherein the basic information includes name, creator, status, update time, method, and path. The request parameter information includes heads parameter information, Query parameter information, and Body parameter information. Each Headers parameter acquisition unit in the Header list comprises a parameter name, a parameter value, an example and a remark, each Query parameter acquisition unit in the Query list comprises a parameter name, whether the parameter name is necessary to be filled, an example and a remark, and each Body parameter acquisition unit in the Body list comprises an attribute name, whether the parameter name is necessary to be filled, an attribute type, a simulation rule and a remark, wherein the attribute type comprises a text type and a file type. the text type means that the parameter contains a key/value pair, and the file type means that the parameter contains a file. The data type of the response data information is mainly in a JSON format, each acquisition unit in the parameter list comprises an attribute name, whether the data needs to be filled, an attribute type, a simulation rule and remarks, wherein the attribute type comprises string, number, array, object, coolan and integer, and the attribute types respectively represent a character string data type, a numerical data type, an array data type, a reference type, a Boolean type and an integer data type.
And S130, receiving externally input request information, and generating test data corresponding to the request information according to the request information and the interface document.
Illustratively, the type of request information includes HTTP request information. Specifically, test data corresponding to the request information is generated according to request parameter data in the request information and response data information defined in the interface document.
According to the technical scheme, the interface definition information is collected through the interface definition interaction interface, the interface document is generated, and the problem of low cooperation efficiency of the front end and the rear end is solved, so that development work can be carried out by front-end technicians and rear-end technicians simultaneously, the requirement of the front-end technicians on test data is met, and the rear-end technicians can be prevented from revising the interface codes repeatedly in the later period.
Example two
Fig. 4 is a flowchart of an interface management method according to a second embodiment of the present invention, and the technical solution of the present embodiment is further detailed based on the foregoing embodiment. Optionally, the generating test data corresponding to the request information according to the request information and the interface document includes: matching the request information with request parameter information in the interface document to obtain target request parameter information and response data information corresponding to the target request parameter information; and generating test data corresponding to the request information according to the target request parameter information and the response data information.
The specific implementation steps of this embodiment include:
and S210, displaying an interface definition interactive interface when receiving an interface definition instruction input by a user.
S220, collecting interface definition information based on the interface definition interactive interface, and generating an interface document based on the interface definition information.
And S230, receiving externally input request information, and matching the request information with the request parameter information in the interface document to obtain target request parameter information and response data information corresponding to the target request parameter information.
Illustratively, the type of request information includes HTTP request information. Specifically, matching is performed based on the basic information in the request information and the basic information in the interface document, for example, the basic information includes information such as an interface name, an interface method, an interface path, and the like, and after matching is successful, a definition interface corresponding to the request information, target request parameter information corresponding to the definition interface, and response data information corresponding to the target request parameter can be obtained.
And S240, generating test data corresponding to the request information according to the target request parameter information and the response data information.
In one embodiment, optionally, the request information is verified according to the target request parameter information; and if the verification is successful, generating test data corresponding to the request information according to the response data information. In an exemplary embodiment, the parameter type in the request information is verified according to the parameter type in the target request parameter information, if the parameter type in the request information is different from the parameter type in the target request parameter information, the verification fails, and if the parameter type in the request information is the same as the parameter type in the target request parameter information, the verification succeeds. Generating test data corresponding to the request information according to the response data information, wherein the generating of the test data comprises: and generating test data according to the simulation rule in the response data information and the request parameter data in the request information. Wherein the simulation rule is used for identifying a generation rule of the test data. In one embodiment, the simulation rules include data types that define test data, such as @ integer data and @ string data. In one embodiment, the simulation rules include data types and data lengths that define test data, such as @ integer (1-10) for integer data having a value of 1-10 and @ string (1-10) for string data having a value of 1-10. In one embodiment, the simulation rules include regular expression rules, such as @ regex ^ a-zA-Z0-9 +$, where "^" denotes a matching input word line head, "[ a-zA-Z0-9 ]" denotes 26 capital letters, 26 lowercase letters, and 0 to 9 digits, and "$" denotes a matching input line end.
In one embodiment, optionally, the verification results and the generated test data are returned to the user; and the verification result comprises a verification failure identifier and remark information corresponding to the verification failure identifier. The verification failure identification is used for representing different verification failure reasons, and the remark information is used for explaining the reasons of the verification failure. For example, if the parameter type in the request information of the request parameter is different from the parameter type in the target request parameter information, the verification failure flag is a, and the remark information is that the parameter type does not meet the requirement. And if the request information of the request parameters lacks the necessary filling parameters, the verification failure mark is B, and the remark information is the lack of the necessary filling parameters. The check failure flag and the remark information are not specifically limited, and can be set by a user in a self-defined manner.
Fig. 5 is a flowchart of a response method of test data according to a second embodiment of the present invention. The dotted line in fig. 5 indicates the server side, the request information is input to the server side through the client side, and the server side returns the generated response to the client side. The same gateway is used for the request information receiving entry and the response entry shown in fig. 5, and the gateway receives the request information input by the client and also receives the response data input by the server. When the gateway receives the request information, the basic information of the request information is matched with the basic information of the interface in the interface document, and the matched definition interface, the target request parameter information of the definition interface and the response data information corresponding to the target request parameter information are determined. And checking the request information based on the target request parameter information, and sending checking response data to the response entrance gateway. And if the verification is successful, generating test data based on the parameter data in the response data information and the request information and sending the test data to the response entry gateway. And the response entrance gateway returns the received verification response data and the test data to the client.
On the basis of the above embodiment, optionally, the interface document to be migrated input by the user is received, and the interface definition information in the interface document to be migrated is analyzed to obtain the interface definition information meeting the requirement of the preset format. The interface document to be migrated includes interface documents generated by other interface management platforms, for example, the other interface management platforms may be swagger platforms, and the data format of the interface document to be migrated may be a JSON format. The interface definition information in the interface documents generated by different interface management platforms has different definition modes, for example, in this embodiment, "name" is used to represent the parameter name, and other interface management platforms "name" is used to represent the parameter name. Specifically, analyzing the interface definition information in the interface document to be migrated includes: and converting the interface definition information in the interface document to be migrated into target interface definition information according to the preset format requirement. Illustratively, "definition" in the interface definition information in the migration interface document is replaced with "name".
The method has the advantages that the swagger platform can generate the interface document but does not have the function of dynamically generating the test data, on one hand, the step of re-entering the interface definition information by technicians is simplified, on the other hand, the compatibility of interface management is improved, and the use requirements of users are better met.
On the basis of the foregoing embodiment, optionally, the target export template and the export interface definition information are obtained, and the export interface definition information is filled in the target export template to generate the export interface document. The target export template comprises interfaces needing to be exported and logic relations among the interfaces. Specifically, the user may edit the default export template to generate a target export template, and obtain export interface definition information corresponding to an export interface based on the export interface in the target export template.
The advantage of this arrangement is that different user requirements correspond to different interface documents, and if only the default interface document can be derived, different user requirements cannot be met. According to the method and the device for exporting the interface document, the step of repeatedly modifying the exported interface document is avoided by setting the export template, the workload of exporting the interface document is reduced, and the working efficiency is improved.
Fig. 6 is a flowchart of importing and exporting an interface document according to a second embodiment of the present invention. Receiving the interface document to be migrated provided by the JSON format or swagger interface, and analyzing the interface document to be migrated through the import module to obtain interface definition information meeting the requirement of a preset format. And filling interface definition information corresponding to the export template into the export template through the export template defined in the export module, generating an interface document and exporting the interface document.
According to the technical scheme, the problem of low testing work efficiency is solved by matching and checking the request information based on the target request parameter information, and technicians can correct the input request information in time according to the output checking result, so that the testing work efficiency is improved.
EXAMPLE III
Fig. 7 is a schematic diagram of an interface management apparatus according to a third embodiment of the present invention. The embodiment can be applied to the case of product development based on a front-end and back-end mode, the device can be implemented in a software and/or hardware manner, and the device can be configured in a terminal device. The interface management apparatus includes: an interface definition module 310, an information transmission module 320, and a response simulation module 330.
The interface definition module 310 is configured to, when an interface definition instruction input by a user is received, display an interface definition interactive interface, collect interface definition information input by the user based on the interface definition interactive interface, and generate an interface document based on the interface definition information;
an information transmission module 320 for receiving request information input by a user;
and the response simulation module 330 is used for generating test data corresponding to the request information according to the request information and the interface document.
According to the technical scheme, the interface definition information is collected through the interface definition interaction interface, the interface document is generated, and the problem of low cooperation efficiency of the front end and the rear end is solved, so that development work can be carried out by front-end technicians and rear-end technicians simultaneously, the requirement of the front-end technicians on test data is met, and the rear-end technicians can be prevented from revising the interface codes repeatedly in the later period.
On the basis of the above technical solution, optionally, the interface definition information includes basic information, request parameter information, and response data information, where the request parameter information includes heads parameter information, Query parameter information, and Body parameter information.
On the basis of the above technical solution, optionally, the response simulation module 330 includes:
the target request parameter information determining unit is used for matching the request information with the request parameter information in the interface document to obtain target request parameter information and response data information corresponding to the target request parameter information;
and the test data generating unit is used for generating test data corresponding to the request information according to the target request parameter information and the response data information.
On the basis of the above technical solution, optionally, the test data generating unit is specifically configured to:
checking the request information according to the target request parameter information;
and if the verification is successful, generating test data corresponding to the request information according to the response data information.
On the basis of the above technical solution, optionally, the apparatus further includes:
the test data returning module is used for returning the verification result and the generated test data to the user; and the verification result comprises a verification failure identifier and remark information corresponding to the verification failure identifier.
On the basis of the above technical solution, optionally, the apparatus further includes:
and the import module is used for receiving the interface document to be migrated input by the user, and analyzing the interface definition information in the interface document to be migrated to obtain the interface definition information meeting the preset format requirement.
On the basis of the above technical solution, optionally, the apparatus further includes:
and the export module is used for acquiring the target export template and the export interface definition information, and filling the export interface definition information into the target export template to generate an export interface document.
The interface management device provided by the embodiment of the invention can be used for executing the interface management method provided by the embodiment of the invention, and has corresponding functions and beneficial effects of the execution method.
It should be noted that, in the embodiment of the interface management apparatus, each included unit and module are only divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
Example four
Fig. 8 is a schematic structural diagram of an apparatus according to a fourth embodiment of the present invention, where the embodiment of the present invention provides a service for implementing the interface management method according to the foregoing embodiment of the present invention, and the interface management device in the foregoing embodiment may be configured. FIG. 8 illustrates a block diagram of an exemplary device 12 suitable for use in implementing embodiments of the present invention. The device 12 shown in fig. 8 is only an example and should not bring any limitation to the function and scope of use of the embodiments of the present invention.
As shown in FIG. 8, device 12 is in the form of a general purpose computing device. The components of device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)30 and/or cache memory 32. Device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 8, and commonly referred to as a "hard drive"). Although not shown in FIG. 8, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
Device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with device 12, and/or with any devices (e.g., network card, modem, etc.) that enable device 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Also, the device 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet) via the network adapter 20. As shown in FIG. 8, the network adapter 20 communicates with the other modules of the device 12 via the bus 18. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 16 executes various functional applications and data processing, for example, implementing an interface management method provided by an embodiment of the present invention, by executing a program stored in the system memory 28.
Through the equipment, the problem of low front-end and back-end cooperation efficiency is solved, so that the front-end technical personnel and the back-end technical personnel can simultaneously develop development work, the requirements of the front-end technical personnel on test data are met, and the back-end technical personnel can be prevented from revising interface codes repeatedly in the later stage.
EXAMPLE five
An embodiment of the present invention further provides a storage medium containing computer-executable instructions, which when executed by a computer processor, are configured to perform an interface management method, where the method includes:
when an interface definition instruction input by a user is received, displaying an interface definition interactive interface;
collecting interface definition information based on the interface definition interactive interface, and generating an interface document based on the interface definition information;
and receiving externally input request information, and generating test data corresponding to the request information according to the request information and the interface document.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having 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. In the context of this document, 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.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, or the like, as well as conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
Of course, the storage medium provided by the embodiment of the present invention contains computer-executable instructions, and the computer-executable instructions are not limited to the above method operations, and may also perform related operations in the interface management method provided by any embodiment of the present invention.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. An interface management method, comprising:
when an interface definition instruction input by a user is received, displaying an interface definition interactive interface;
collecting interface definition information based on the interface definition interactive interface, and generating an interface document based on the interface definition information;
and receiving request information input from the outside, and generating test data corresponding to the request information according to the request information and the interface document.
2. The method of claim 1, wherein the interface definition information comprises basic information, request parameter information, and response data information, wherein the request parameter information comprises heads parameter information, Query parameter information, and Body parameter information.
3. The method of claim 2, wherein generating test data corresponding to the request information from the request information and the interface document comprises:
matching the request information with request parameter information in the interface document to obtain target request parameter information and response data information corresponding to the target request parameter information;
and generating test data corresponding to the request information according to the target request parameter information and the response data information.
4. The method of claim 3, wherein generating test data corresponding to the request information according to the target request parameter information and the response data information comprises:
checking the request information according to the target request parameter information;
and if the verification is successful, generating test data corresponding to the request information according to the response data information.
5. The method of claim 4, further comprising:
returning the verification result and the generated test data to the user; and the verification result comprises a verification failure identifier and remark information corresponding to the verification failure identifier.
6. The method of claim 1, further comprising:
receiving an interface document to be migrated, which is input by a user, and analyzing interface definition information in the interface document to be migrated to obtain interface definition information meeting the requirement of a preset format.
7. The method of claim 1, further comprising:
and acquiring a target export template and export interface definition information, and filling the export interface definition information into the target export template to generate an export interface document.
8. An interface management apparatus, comprising:
the interface definition module is used for displaying an interface definition interactive interface when receiving an interface definition instruction input by a user, acquiring interface definition information input by the user based on the interface definition interactive interface, and generating an interface document based on the interface definition information;
the information transmission module is used for receiving request information input by a user;
and the response simulation module is used for generating test data corresponding to the request information according to the request information and the interface document.
9. An apparatus, comprising:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the interface management method of any of claims 1-7.
10. A storage medium containing computer-executable instructions for performing the interface management method of any one of claims 1-7 when executed by a computer processor.
CN202010522353.3A 2020-06-10 2020-06-10 Interface management method, device, equipment and storage medium Pending CN111694561A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010522353.3A CN111694561A (en) 2020-06-10 2020-06-10 Interface management method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010522353.3A CN111694561A (en) 2020-06-10 2020-06-10 Interface management method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111694561A true CN111694561A (en) 2020-09-22

Family

ID=72480128

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010522353.3A Pending CN111694561A (en) 2020-06-10 2020-06-10 Interface management method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111694561A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112380281A (en) * 2020-10-30 2021-02-19 中国人寿保险股份有限公司 Platform layer code generation method and device, electronic equipment and storage medium
CN112685014A (en) * 2020-12-25 2021-04-20 中孚安全技术有限公司 Method, system and equipment for quickly simulating interface
CN113741893A (en) * 2021-08-02 2021-12-03 重庆长安汽车股份有限公司 JSON (Java Server object notation) -analysis-based open platform interface document automatic generation method and system
CN113836460A (en) * 2021-08-13 2021-12-24 深圳市明源云空间电子商务有限公司 mock data control method, equipment terminal and computer readable storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2000023925A2 (en) * 1998-10-16 2000-04-27 Commerce One, Inc. Documents for commerce in trading partner networks and interface definitions based on the documents
US20050060317A1 (en) * 2003-09-12 2005-03-17 Lott Christopher Martin Method and system for the specification of interface definitions and business rules and automatic generation of message validation and transformation software
CN107463409A (en) * 2017-08-11 2017-12-12 深圳乐信软件技术有限公司 A kind of interface conversion method, interface convertor, storage medium and electric terminal
CN107977308A (en) * 2016-10-25 2018-05-01 传化物流集团有限公司 interface test method and device
CN109408375A (en) * 2018-09-27 2019-03-01 深圳壹账通智能科技有限公司 The generation method and device of interface document
CN110287109A (en) * 2019-06-18 2019-09-27 广州华多网络科技有限公司 Test method, device, computer equipment and its storage medium of protocol interface
CN110727580A (en) * 2019-09-03 2020-01-24 深圳壹账通智能科技有限公司 Response data generation method, full-flow interface data processing method and related equipment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2000023925A2 (en) * 1998-10-16 2000-04-27 Commerce One, Inc. Documents for commerce in trading partner networks and interface definitions based on the documents
US20050060317A1 (en) * 2003-09-12 2005-03-17 Lott Christopher Martin Method and system for the specification of interface definitions and business rules and automatic generation of message validation and transformation software
CN107977308A (en) * 2016-10-25 2018-05-01 传化物流集团有限公司 interface test method and device
CN107463409A (en) * 2017-08-11 2017-12-12 深圳乐信软件技术有限公司 A kind of interface conversion method, interface convertor, storage medium and electric terminal
CN109408375A (en) * 2018-09-27 2019-03-01 深圳壹账通智能科技有限公司 The generation method and device of interface document
CN110287109A (en) * 2019-06-18 2019-09-27 广州华多网络科技有限公司 Test method, device, computer equipment and its storage medium of protocol interface
CN110727580A (en) * 2019-09-03 2020-01-24 深圳壹账通智能科技有限公司 Response data generation method, full-flow interface data processing method and related equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
QQ_38188999: "利用ApiPost一键、快速生成接口文档!女猿也过38节!", pages 1 - 4, Retrieved from the Internet <URL:https://blog.csdn.net/qq_38188999/article/details/88321989?> *
仰望银河系: "接口文档编写工具", 《CSDN HTTPS://BLOG.CSDN.NET/WEIXIN_44185837/ARTICLE/DETAILS/105933792》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112380281A (en) * 2020-10-30 2021-02-19 中国人寿保险股份有限公司 Platform layer code generation method and device, electronic equipment and storage medium
CN112685014A (en) * 2020-12-25 2021-04-20 中孚安全技术有限公司 Method, system and equipment for quickly simulating interface
CN113741893A (en) * 2021-08-02 2021-12-03 重庆长安汽车股份有限公司 JSON (Java Server object notation) -analysis-based open platform interface document automatic generation method and system
CN113836460A (en) * 2021-08-13 2021-12-24 深圳市明源云空间电子商务有限公司 mock data control method, equipment terminal and computer readable storage medium

Similar Documents

Publication Publication Date Title
CN111694561A (en) Interface management method, device, equipment and storage medium
CN109558525B (en) Test data set generation method, device, equipment and storage medium
CN111488174A (en) Method and device for generating application program interface document, computer equipment and medium
CN111782117B (en) Interface display method and device, storage medium and electronic device
CN111309317A (en) Code automation method and device for realizing data visualization
US6763360B2 (en) Automated language and interface independent software testing tool
CN114201615B (en) Scientific research data change review method and server based on data snapshot
CN114090671A (en) Data import method and device, electronic equipment and storage medium
CN111913922B (en) Binary structured log generation method, device, equipment and storage medium
CN115599386A (en) Code generation method, device, equipment and storage medium
CN113836014A (en) Interface testing method and device, electronic equipment and storage medium
CN113094776B (en) Method and system for constructing visual component model data and electronic equipment
CN113792138B (en) Report generation method and device, electronic equipment and storage medium
CN115408358B (en) Network disk online file management method and device, network disk and storage medium
CN111666201A (en) Regression testing method, device, medium and electronic equipment
CN113688134B (en) Visual variable management method, system and equipment based on multidimensional data
CN115544950A (en) Constraint file importing method, device, equipment and storage medium
CN113010208B (en) Version information generation method, device, equipment and storage medium
CN111399843B (en) Method, system and electronic equipment for mapping SQL running information to SQL file
CN113961835A (en) Data processing method and device, electronic equipment and storage medium
CN111400623A (en) Method and apparatus for searching information
CN112445790B (en) Report data storage method, device, equipment and medium
CN114443498A (en) Data processing method and device, electronic equipment and storage medium
CN113761844A (en) Method and device for determining target corpus, electronic equipment and storage medium
CN116842241A (en) Buried point data acquisition method and device and related equipment

Legal Events

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

Effective date of registration: 20220930

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

Applicant after: CHINA CONSTRUCTION BANK Corp.

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

Applicant before: CHINA CONSTRUCTION BANK Corp.

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

TA01 Transfer of patent application right