CN112882844A - Network front-end and back-end based joint debugging method and device and storage medium - Google Patents

Network front-end and back-end based joint debugging method and device and storage medium Download PDF

Info

Publication number
CN112882844A
CN112882844A CN202110168032.2A CN202110168032A CN112882844A CN 112882844 A CN112882844 A CN 112882844A CN 202110168032 A CN202110168032 A CN 202110168032A CN 112882844 A CN112882844 A CN 112882844A
Authority
CN
China
Prior art keywords
target
parameter
interface
request
file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110168032.2A
Other languages
Chinese (zh)
Other versions
CN112882844B (en
Inventor
汤凯
冯秋昱
张清林
赵永亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu New Hope Finance Information Co Ltd
Original Assignee
Chengdu New Hope Finance Information 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 Chengdu New Hope Finance Information Co Ltd filed Critical Chengdu New Hope Finance Information Co Ltd
Priority to CN202110168032.2A priority Critical patent/CN112882844B/en
Publication of CN112882844A publication Critical patent/CN112882844A/en
Application granted granted Critical
Publication of CN112882844B publication Critical patent/CN112882844B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • 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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The application provides a network front-end and back-end based joint debugging method, device and storage medium, and relates to the technical field of internet. The method comprises the following steps of obtaining target request parameters, wherein the target request parameters comprise: interface document address, target source code file path; according to the interface document address, requesting to acquire a target interface file corresponding to the interface document address, wherein the target interface file comprises at least one interface parameter; according to the method and the device, the target request function is generated according to the target interface file, the target request function is used for being called to obtain the target data, the parameters of the target request function comprise the identification of the target storage path, the target interface file can be automatically obtained without excessive manual participation, the target request function can be automatically generated according to the target request parameters, and therefore when the target request function is used for achieving joint debugging of the front end and the rear end of the network, joint debugging efficiency can be improved.

Description

Network front-end and back-end based joint debugging method and device and storage medium
Technical Field
The present application relates to the field of internet technologies, and in particular, to a method and an apparatus for joint debugging based on a front end and a back end of a network, and a storage medium.
Background
The Web (network) technology refers to a general technical name for developing internet applications, and generally includes a Web server technology and a Web client technology, where a Web server may also be called a Web backend and a Web client may also be called a Web frontend, and in a development process of the Web technology, joint debugging of the Web backend and the Web backend is often required.
Currently, when the front end and the back end of a web are jointly debugged, the back end needs to sort out an interface needed by the front end and output an interface document address, and the front end copies and pastes interface information to the local according to the interface document address to carry out the joint debugging.
However, the existing joint debugging method is relatively simple, and when the interface information in the interface document corresponding to the interface document address is more, the existing joint debugging method has the problem of low efficiency.
Disclosure of Invention
An object of the present application is to provide a joint debugging method, apparatus and storage medium based on front and back ends of a network, which can improve joint debugging efficiency.
In order to achieve the above purpose, the technical solutions adopted in the embodiments of the present application are as follows:
in a first aspect, the present invention provides a joint debugging method based on front and back ends of a network, including:
obtaining target request parameters, wherein the target request parameters comprise: interface document address, target source code file path;
according to the interface document address, requesting to acquire a target interface file corresponding to the interface document address, wherein the target interface file comprises at least one interface parameter, each interface parameter corresponds to different storage paths, and the identifier of each storage path comprises an interface parameter identifier;
and generating a target request function according to the target interface file, wherein the target request function is used for being called to acquire target data, and the parameter of the target request function comprises the identifier of the target storage path.
In an optional embodiment, if the target interface file further includes a first request parameter and a first request method parameter, and/or the identifier of the storage path further includes a second request parameter;
the parameters of the target request function further include a first transfer parameter and the first request method parameter, and/or a second transfer parameter, where the first transfer parameter is a transfer parameter corresponding to the first request parameter, and the second transfer parameter is a transfer parameter corresponding to the second request parameter.
In an optional embodiment, if the target interface file further includes the first request parameter and the first request method parameter, the generating a target request function according to the target interface file includes:
acquiring a first request parameter and a first request method parameter in the target interface file;
and generating a target request function corresponding to each interface parameter according to the first request parameter, the first request method parameter and the identifier of the storage path corresponding to each interface parameter.
In an optional embodiment, if the identifier of the storage path further includes the second request parameter, the generating, according to the target interface file, a target request function includes:
matching the identifier of the storage path corresponding to the target interface parameter according to a preset matching condition, and acquiring a second request parameter in the identifier of the storage path corresponding to the target interface parameter;
converting the second request parameter by adopting a preset conversion mode to obtain a converted second request parameter;
recombining the identifier of the storage path corresponding to the target interface parameter according to the converted second request parameter;
and taking the identifier of the recombined storage path corresponding to the target interface parameter as the identifier of the target storage path.
In an optional embodiment, the target request parameter further includes: interface filtering conditions, wherein the generating of the target request function according to the target interface file comprises the following steps:
filtering at least one interface parameter according to the interface filtering condition to obtain a filtered target interface file;
and generating a target request function according to the filtered target interface file.
In an optional embodiment, the target interface file further comprises: after generating the target request function according to the target interface file, the annotation information corresponding to each interface parameter further includes:
acquiring annotation information corresponding to the target interface parameters according to the target interface file;
and annotating the target request function according to the annotation information corresponding to the target interface parameters, and acquiring the annotated target request function.
In an optional implementation manner, after generating the target request function according to the target interface file, the joint debugging method further includes:
and outputting the target request function to the target source code file path according to a preset output command.
In an optional embodiment, the obtaining target request parameters includes:
receiving an initial request parameter input by a user according to a preset command input rule;
and analyzing the initial request parameter according to a preset analysis command to obtain the target request parameter.
In a second aspect, the present invention provides a joint debugging device based on front and back ends of a network, including:
an obtaining module, configured to obtain a target request parameter, where the target request parameter includes: interface document address, target source code file path;
the request module is used for requesting to acquire a target interface file corresponding to the interface document address according to the interface document address, wherein the target interface file comprises at least one interface parameter, each interface parameter corresponds to different storage paths, and the identifier of each storage path comprises an interface parameter identifier;
and the generating module is used for generating a target request function according to the target interface file, wherein the target request function is used for being called to acquire target data, and the parameter of the target request function comprises the identifier of the target storage path.
In an optional embodiment, if the target interface file further includes a first request parameter and a first request method parameter, and/or the identifier of the storage path further includes a second request parameter;
the parameters of the target request function further include a first transfer parameter and the first request method parameter, and/or a second transfer parameter, where the first transfer parameter is a transfer parameter corresponding to the first request parameter, and the second transfer parameter is a transfer parameter corresponding to the second request parameter.
In an optional embodiment, if the target interface file further includes the first request parameter and the first request method parameter, the generating module is specifically configured to obtain the first request parameter and the first request method parameter in the target interface file;
and generating a target request function corresponding to each interface parameter according to the first request parameter, the first request method parameter and the identifier of the storage path corresponding to each interface parameter.
In an optional embodiment, if the identifier of the storage path further includes the second request parameter, the generating module is specifically configured to match the identifier of the storage path corresponding to the target interface parameter according to a preset matching condition, and obtain the second request parameter in the identifier of the storage path corresponding to the target interface parameter; converting the second request parameter by adopting a preset conversion mode to obtain a converted second request parameter; recombining the identifier of the storage path corresponding to the target interface parameter according to the converted second request parameter; and taking the identifier of the recombined storage path corresponding to the target interface parameter as the identifier of the target storage path.
In an alternative embodiment, the target request parameter further comprises: an interface filtering condition generating module, specifically configured to filter at least one of the interface parameters according to the interface filtering condition, and obtain a filtered target interface file; and generating a target request function according to the filtered target interface file.
In an alternative embodiment, the target interface file further comprises: the generating module is also used for acquiring annotation information corresponding to the target interface parameters according to the target interface file;
and annotating the target request function according to the annotation information corresponding to the target interface parameters, and acquiring the annotated target request function.
In an optional embodiment, the joint debugging apparatus further includes: and the output module is used for outputting the target request function to the target source code file path according to a preset output command.
In an optional embodiment, the obtaining module is specifically configured to receive an initial request parameter input by a user according to a preset command input rule;
and analyzing the initial request parameter according to a preset analysis command to obtain the target request parameter.
In a third aspect, an embodiment of the present application provides an electronic device, including: the network front-end and back-end based joint debugging method comprises a processor, a storage medium and a bus, wherein the storage medium stores machine readable instructions executable by the processor, when the electronic device runs, the processor and the storage medium communicate through the bus, and the processor executes the machine readable instructions to execute the steps of the network front-end and back-end based joint debugging method of the first aspect.
In a fourth aspect, an embodiment of the present application provides a storage medium, where a computer program is stored on the storage medium, and when the computer program is executed by a processor, the steps of the network front-end and back-end based joint debugging method according to the first aspect are executed.
The beneficial effect of this application is:
in the method, the device and the storage medium for joint debugging based on the front end and the back end of the network provided by the embodiment of the application, the target request parameters are obtained and comprise: interface document address, target source code file path; according to the interface document address, requesting to acquire a target interface file corresponding to the interface document address, wherein the target interface file comprises at least one interface parameter, each interface parameter corresponds to different storage paths, and the identifier of each storage path comprises an interface parameter identifier; according to the method and the device, the target request function is generated according to the target interface file, the target request function is used for being called to obtain the target data, the parameters of the target request function comprise the identification of the target storage path, the target interface file can be automatically obtained without excessive manual participation, the target request function can be automatically generated according to the target request parameters, and therefore when the target request function is used for achieving joint debugging of the front end and the rear end of the network, joint debugging efficiency can be improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a schematic flowchart of a joint debugging method based on front and back ends of a network according to an embodiment of the present application;
fig. 2 is a schematic flowchart of another network front-end and back-end based joint debugging method according to an embodiment of the present application;
fig. 3 is a schematic flowchart of another joint debugging method based on front and back ends of a network according to an embodiment of the present application;
fig. 4 is a schematic flowchart of another network front-end and back-end based joint debugging method according to an embodiment of the present application;
fig. 5 is a schematic flowchart of another joint debugging method based on front and back ends of a network according to an embodiment of the present application;
fig. 6 is a schematic flowchart of another network front-end and back-end based joint debugging method according to an embodiment of the present application;
fig. 7 is a schematic flowchart of another joint debugging method based on front and back ends of a network according to an embodiment of the present application;
fig. 8 is a schematic functional block diagram of a joint debugging device based on front and back ends of a network according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
Before introducing the present application, in order to facilitate better understanding of the present application, an application scenario in the present application will be described first.
In the development of a web page project, the front end and the back end of the web project are generally developed separately, in the development process, a front end engineer and a back end engineer need to define an interface together and write an interface document, and then the development engineer can develop according to the interface document so as to facilitate the project maintenance or the project personnel change, and facilitate the later-stage personnel to check and maintain.
In the existing web development, generally, an interface required by a front end is arranged at a web back end, and an interface document address (for example, swagger document address) is output, and a front end engineer can acquire an interface document according to the interface document address, copy and paste relevant interface information in the interface document from a browser into a local engineering project, and assemble the interface document into a request function that can be called by the front end.
However, the joint debugging method is simple, particularly, as the project is larger and larger, the interface information is increased, the newly added interface and the changed interface are checked in a pure manual document comparison mode, the workload of a front-end engineer is increased undoubtedly, and the development efficiency of the project is reduced; in addition, depending on a manual checking mode, errors are inevitably generated, and particularly, in the case of a large number of interfaces, the interfaces are easy to be mistakenly seen or missed, so that the existing joint debugging mode has the problem of low efficiency.
In view of this, the embodiments of the present application provide a joint debugging method based on front and back ends of a network, which can improve joint debugging efficiency.
Fig. 1 is a schematic flowchart of a joint debugging method based on front and back ends of a network according to an embodiment of the present application, where an execution main body of the method may be a computer, a processor, a terminal device, and other devices capable of performing data processing, as shown in fig. 1, the method includes:
s101, obtaining target request parameters, wherein the target request parameters comprise: interface document address, target source code file path.
The interface document address is used to obtain the interface document, which may be obtained by a web backend server interacting with the interface document address, for example, an obtaining request of the interface document address may be sent to the web backend server, and the web backend server may return the interface document address after receiving the obtaining request. The target source code file path is used for storing the generated request function, and the user may designate any path as the target source code file path, for example, may designate a certain engineering project path as the target source code file path, so as to facilitate calling in the actual joint debugging process, which is not limited herein.
S102, according to the interface document address, requesting to acquire a target interface file corresponding to the interface document address, wherein the target interface file comprises at least one interface parameter, each interface parameter corresponds to different storage paths, and the identifier of each storage path comprises an interface parameter identifier.
Based on the obtained interface document address, the corresponding target interface file may be obtained by entering the address, and the target interface file is stored in a specified path, for example, the target interface file may be the target source code file path, or may be any file path, which is not limited herein.
Optionally, the target interface file may be in any file format, which may include but is not limited to: doc format, xlsx format, XML format, etc., without limitation. The target interface file may include at least one interface parameter, for example, the target interface file may include interface parameters such as api, log, error, and the like, and the storage paths corresponding to the interface parameters may be: xx/api/xx, xx/log/xx, xx/error/xx, and the like, but not limited thereto, the identifier of each storage path may include a corresponding interface parameter identifier, and optionally, the identifier of each storage path may respectively: xx/api, xx/log, xx/error, etc., but not limited thereto.
Optionally, the joint debugging method of the present application may be implemented based on a Node technology, where a Node is used as a server language, and may access other server addresses to perform data interactive transmission, or may perform addition, deletion, modification, and check on a local file through a file system module provided in the Node.
S103, generating a target request function according to the target interface file, wherein the target request function is used for being called to acquire target data, and the parameter of the target request function comprises the identifier of the target storage path.
Based on the above embodiment, a target request function may be automatically generated according to the target interface file, where the target request function may be called to obtain target data, and a parameter of the target request function may include an identifier of a target storage path, where the target storage path is a path identifier corresponding to the identifier of the storage path of the interface parameter.
To sum up, the joint debugging method based on the front end and the back end of the network provided by the embodiment of the application comprises the following steps: acquiring target request parameters, wherein the target request parameters comprise: interface document address, target source code file path; according to the interface document address, requesting to acquire a target interface file corresponding to the interface document address, wherein the target interface file comprises at least one interface parameter, each interface parameter corresponds to different storage paths, and the identifier of each storage path comprises an interface parameter identifier; according to the method and the device, the target request function is generated according to the target interface file, the target request function is used for being called to obtain the target data, the parameters of the target request function comprise the identification of the target storage path, the target interface file can be automatically obtained without excessive manual participation, the target request function can be automatically generated according to the target request parameters, and therefore when the target request function is used for achieving joint debugging of the front end and the rear end of the network, joint debugging efficiency can be improved.
Optionally, according to an actual application scenario, the target interface file may further include some request parameters for transferring the joint debugging parameters in the joint debugging process, where the request parameters may be transferred in the following two ways. If the target interface file further comprises a first request parameter and a first request method parameter, and/or the identifier of the storage path further comprises a second request parameter; the parameters of the target request function further include a first transfer parameter and a first request method parameter, and/or a second transfer parameter, where the first transfer parameter is a transfer parameter corresponding to the first request parameter, and the second transfer parameter is a transfer parameter corresponding to the second request parameter.
Wherein the first request parameter corresponds to a first request method parameter, and the first request method parameter may be used to indicate a request type, which may include but is not limited to: get, post, etc. request types, the first request parameter may be used to indicate a transfer type of the parameter, which may include but is not limited to: body, query, etc. delivery types.
In some embodiments, if the target interface file further includes a first request parameter and a first request method parameter, the parameters of the target request function further include a first transfer parameter and a first request method parameter, where the first transfer parameter in the target request function is a transfer parameter corresponding to the first request parameter, which may include but is not limited to: the parameters of the first request method in the target request function can be the same as the parameters of the first request method in the target interface file, so that the joint debugging parties can interact based on the same request type in the joint debugging process.
In some embodiments, other manners may also be adopted to transmit the request parameter, where the first request parameter may be used to transmit some more complex parameters, and different from the manner of transmitting the first request parameter, optionally, the identifier of the storage path corresponding to each interface parameter may further include a second request parameter, that is, the second request parameter may be carried in the identifier of the storage path corresponding to each interface parameter, and optionally, the parameter transmission method may be used to transmit some more simple parameters, for example: the identifier of the storage path corresponding to a certain interface parameter may be: and/api/log/{ id }/{ key }, where { id }, { key } may be second request parameters, the parameters of the target request function may further include second transfer parameters, and the second transfer parameters may be transfer parameters corresponding to the second request parameters, for example, transfer parameters corresponding to the second request parameters { id }, { key }, and an actual application scenario is not limited thereto.
Of course, it should be noted that any one of the above manners may be selected to transmit the request parameter according to an actual application scenario, or the request parameter may be transmitted in a manner combining the two manners, which is not limited herein.
Fig. 2 is a schematic flow chart of another network front-end and back-end based joint debugging method according to an embodiment of the present application. Optionally, as shown in fig. 2, if the target interface file further includes a first request parameter and a first request method parameter, the generating a target request function according to the target interface file includes:
s201, acquiring a first request parameter and a first request method parameter in the target interface file.
S202, generating a target request function corresponding to each interface parameter according to the first request parameter, the first request method parameter and the identifier of the storage path corresponding to each interface parameter.
Based on the above embodiment, if the target interface file further includes the first request parameter and the first request method parameter, the first request parameter and the first request method parameter may be obtained, the first request parameter, the first request method parameter, and the identifier of the storage path corresponding to each interface parameter are respectively used as the parameter of the target request function corresponding to each interface parameter, and the target request function corresponding to each interface parameter is named according to a preset function naming mode, so that the target request parameter corresponding to each interface parameter may be obtained.
Optionally, when naming the target request function corresponding to each interface parameter, naming may be performed according to a random naming manner, or naming may be performed according to a generation sequence of each interface parameter, or naming may be performed according to an interface parameter identifier corresponding to each interface parameter, so that generation of a rename function may be avoided, and of course, a specific naming manner is not limited thereto. For example, the target request function corresponding to a certain interface parameter may be: 000001(a, B, C), where 000001 represents a function name of the target request function, a represents a first transfer parameter corresponding to a first request parameter, B represents a first request method parameter, and C represents an identifier of a storage path corresponding to the interface parameter, but is not limited thereto.
Fig. 3 is a schematic flowchart of another joint debugging method based on the front and back ends of the network according to the embodiment of the present application. Optionally, as shown in fig. 3, if the identifier of the storage path further includes a second request parameter, the generating the target request function according to the target interface file may include:
s301, matching the identifier of the storage path corresponding to the target interface parameter according to a preset matching condition, and acquiring a second request parameter in the identifier of the storage path corresponding to the target interface parameter.
The preset matching condition may be implemented based on a regular expression, and it may be understood that when the identifier of the storage path further includes the second request parameter, the identifier of the storage path corresponding to the target interface parameter may be matched through the preset matching condition, and the second request parameter may be obtained through matching.
S302, converting the second request parameter by adopting a preset conversion mode, and acquiring the converted second request parameter.
And S303, recombining the identifier of the storage path corresponding to the target interface parameter according to the converted second request parameter.
S304, taking the identifier of the recombined storage path corresponding to the target interface parameter as the identifier of the target storage path.
It can be understood that, since the target interface file corresponding to the interface document address is written by the backend engineer based on the backend development language (e.g., asp, php, jsp, NET, etc.), and the front-end development language (e.g., JavaScript, c #, Java, Python language) is different from the general syntax rule of the backend development language, based on the above embodiment, after the second request parameter in the identifier of the storage path corresponding to the target interface parameter is obtained, it is necessary to convert the second request parameter into the front-end development language that can be recognized by the front end, for example, syntax conversion, character conversion, etc., which is not limited herein. Optionally, during the conversion, the second request parameter may be converted in a template character string manner to obtain the converted second request parameter, the identifier of the storage path corresponding to the target interface parameter is recombined according to the converted second request parameter, and the identifier of the recombined storage path corresponding to the target interface parameter is used as the identifier of the target storage path.
Fig. 4 is a schematic flowchart of another network front-end and back-end based joint debugging method according to an embodiment of the present application. Optionally, in some embodiments, in order to meet the requirements of different application scenarios, the target request parameter further includes: the interface filtering condition, as shown in fig. 4, the generating the target request function according to the target interface file may include:
s401, filtering at least one interface parameter according to the interface filtering condition, and acquiring a filtered target interface file.
S402, generating a target request function according to the filtered target interface file.
The target interface file includes at least one interface parameter, and in actual application, a request function corresponding to a part of the interface parameters may need to be generated, so that interface filtering conditions may be set in advance (the interface filtering conditions may be used to filter parameters including conditions such as preset parameters and preset identifiers, for example, to filter an interface parameter whose interface parameter identifier is M), each interface parameter is traversed according to the interface filtering conditions, each interface parameter is filtered, the filtered target interface file is obtained, and then the target request function may be generated for the filtered target interface file, and a specific generation process may refer to the foregoing related description, which is not described herein again.
Fig. 5 is a schematic flowchart of another joint debugging method based on the front and back ends of the network according to the embodiment of the present application. Optionally, the target interface file further comprises: the annotation information corresponding to each interface parameter can clearly and intuitively understand the meaning indicated by each interface parameter through the annotation information, as shown in fig. 5, after the generating of the target request function according to the target interface file, the method further includes:
s501, obtaining annotation information corresponding to the target interface parameters according to the target interface file.
And S502, annotating the target request function according to the annotation information corresponding to the target interface parameters, and acquiring the annotated target request function.
For the target interface parameter, the annotation information corresponding to the target interface parameter may be obtained according to the target interface file, and then the target request function corresponding to the target interface parameter may be annotated according to the annotation information corresponding to the target interface parameter, for example, the annotation may be annotated above the target request function.
Fig. 6 is a schematic flowchart of another network front-end and back-end based joint debugging method according to an embodiment of the present application. Optionally, as shown in fig. 6, after the target request function is generated according to the target interface file, the joint debugging method further includes:
s601, outputting the target request function to a target source code file path according to a preset output command.
In order to improve joint debugging efficiency, the generated target request function can be further output to a target source code file path according to a preset output command, and optionally, the target source code file path can be a front-end engineering project path, so that front-end calling can be facilitated, and joint debugging efficiency can be improved. Of course, the present application does not limit the specific way of specifying the target source code file path, and can flexibly adjust the path according to the actual application scenario.
Optionally, when the embodiment of the present application is implemented based on a Node technology, the generated target request function may be injected into a target source code file path based on a file system module of the Node, where if the target source code file path does not exist during access, a file may be created according to the target source code file path, and then the target request function is injected into the file, thereby implementing automatic injection of the target request function into the engineering local.
Fig. 7 is a schematic flowchart of another joint debugging method based on front and back ends of a network according to an embodiment of the present application. Optionally, as shown in fig. 7, the obtaining target request parameter may include:
s701, receiving an initial request parameter input by a user according to a preset command input rule.
S702, analyzing the initial request parameter according to a preset analysis command to obtain a target request parameter.
Optionally, the preset command input rule may be implemented based on a commander module in a node. js framework, for example, a command line interface may be implemented based on the commander module, a user may input an initial request parameter based on a grammar rule of the commander module on the command line interface, and after receiving the initial request parameter, the initial request parameter may be analyzed according to a preset analysis command corresponding to the preset command input rule, so as to obtain a target request parameter in the initial request parameter. For example, the initial request parameters may include: -aswagger _ address, wherein-a may indicate a preset command for inputting an interface document address, which may be followed by a specific interface document address swagger _ address. Optionally, when the initial request parameter is parsed according to a preset parsing command, the preset command is filtered out (for example, the above-mentioned: -a), and the obtained target request parameter may include: the swagger _ address, of course, the preset command input rule and the preset parsing mode of the parsing command are not limited thereto, and can be flexibly adjusted according to the actual application scenario.
In some embodiments, when the initial request parameter input by the user is received, if it is determined that the input parameter of the user does not conform to the preset command input rule, the user may be prompted in time and error information may be given, and if the input parameter of the user conforms to the preset command input rule, the target request parameter may be further obtained by referring to the foregoing method, which is not described herein again.
In summary, by applying the embodiment of the application, the target interface file can be locally generated in the front-end project only by inputting the initial request parameter in the command line interface, so that the purpose of automatically acquiring the interface is achieved, the labor time and the error probability are greatly reduced, and the target request function can be generated according to the target interface file, can be used for being called to acquire the target data, and can improve the joint debugging efficiency.
Fig. 8 is a functional module schematic diagram of a joint debugging device based on front and back ends of a network according to an embodiment of the present application, the basic principle and the generated technical effect of the device are the same as those of the corresponding method embodiment, and for brief description, the corresponding contents in the method embodiment may be referred to for parts not mentioned in this embodiment. As shown in fig. 8, the network front-end and back-end based joint debugging apparatus 100 includes:
an obtaining module 110, configured to obtain target request parameters, where the target request parameters include: interface document address, target source code file path;
a request module 120, configured to request to obtain, according to the interface document address, a target interface file corresponding to the interface document address, where the target interface file includes at least one interface parameter, where each interface parameter corresponds to a different storage path, and an identifier of the storage path includes an identifier of the interface parameter;
a generating module 130, configured to generate a target request function according to the target interface file, where the target request function is used to be called to obtain target data, and a parameter of the target request function includes an identifier of a target storage path.
In an optional embodiment, if the target interface file further includes a first request parameter and a first request method parameter, and/or the identifier of the storage path further includes a second request parameter; the parameters of the target request function further include a first transfer parameter and the first request method parameter, and/or a second transfer parameter, where the first transfer parameter is a transfer parameter corresponding to the first request parameter, and the second transfer parameter is a transfer parameter corresponding to the second request parameter.
In an optional embodiment, if the target interface file further includes the first request parameter and the first request method parameter, the generating module 130 is specifically configured to obtain the first request parameter and the first request method parameter in the target interface file; and generating a target request function corresponding to each interface parameter according to the first request parameter, the first request method parameter and the identifier of the storage path corresponding to each interface parameter.
In an optional embodiment, if the identifier of the storage path further includes the second request parameter, the generating module 130 is specifically configured to match the identifier of the storage path corresponding to the target interface parameter according to a preset matching condition, and obtain the second request parameter in the identifier of the storage path corresponding to the target interface parameter; converting the second request parameter by adopting a preset conversion mode to obtain a converted second request parameter; recombining the identifier of the storage path corresponding to the target interface parameter according to the converted second request parameter; and taking the identifier of the recombined storage path corresponding to the target interface parameter as the identifier of the target storage path.
In an alternative embodiment, the target request parameter further comprises: an interface filtering condition generating module 130, configured to filter at least one of the interface parameters according to the interface filtering condition, and obtain a filtered target interface file; and generating a target request function according to the filtered target interface file.
In an alternative embodiment, the target interface file further comprises: the generating module 130 is further configured to obtain annotation information corresponding to the target interface parameter according to the target interface file; and annotating the target request function according to the annotation information corresponding to the target interface parameters, and acquiring the annotated target request function.
In an optional embodiment, the joint debugging apparatus further includes: and the output module is used for outputting the target request function to the target source code file path according to a preset output command.
In an optional embodiment, the obtaining module 110 is specifically configured to receive an initial request parameter input by a user according to a preset command input rule; and analyzing the initial request parameter according to a preset analysis command to obtain the target request parameter.
The above-mentioned apparatus is used for executing the method provided by the foregoing embodiment, and the implementation principle and technical effect are similar, which are not described herein again.
These above modules may be one or more integrated circuits configured to implement the above methods, such as: one or more Application Specific Integrated Circuits (ASICs), or one or more microprocessors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs), among others. For another example, when one of the above modules is implemented in the form of a Processing element scheduler code, the Processing element may be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
Fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application. As shown in fig. 9, the electronic device may include: a processor 210, a storage medium 220, and a bus 230, wherein the storage medium 220 stores machine-readable instructions executable by the processor 210, and when the electronic device is operated, the processor 210 communicates with the storage medium 220 via the bus 230, and the processor 210 executes the machine-readable instructions to perform the steps of the above-mentioned method embodiments. The specific implementation and technical effects are similar, and are not described herein again.
Optionally, the present application further provides a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the computer program performs the steps of the above method embodiments. The specific implementation and technical effects are similar, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present application. And the aforementioned storage medium includes: a U disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (10)

1. A joint debugging method based on the front end and the back end of a network is characterized by comprising the following steps:
obtaining target request parameters, wherein the target request parameters comprise: interface document address, target source code file path;
according to the interface document address, requesting to acquire a target interface file corresponding to the interface document address, wherein the target interface file comprises at least one interface parameter, each interface parameter corresponds to different storage paths, and the identifier of each storage path comprises an interface parameter identifier;
and generating a target request function according to the target interface file, wherein the target request function is used for being called to acquire target data, and the parameter of the target request function comprises the identifier of the target storage path.
2. The method according to claim 1, wherein if the target interface file further comprises a first request parameter and a first request method parameter, and/or the identifier of the storage path further comprises a second request parameter;
the parameters of the target request function further include a first transfer parameter and the first request method parameter, and/or a second transfer parameter, where the first transfer parameter is a transfer parameter corresponding to the first request parameter, and the second transfer parameter is a transfer parameter corresponding to the second request parameter.
3. The method of claim 2, wherein if the target interface file further includes the first request parameter and the first request method parameter, the generating a target request function according to the target interface file comprises:
acquiring a first request parameter and a first request method parameter in the target interface file;
and generating a target request function corresponding to each interface parameter according to the first request parameter, the first request method parameter and the identifier of the storage path corresponding to each interface parameter.
4. The method according to claim 2 or 3, wherein if the identifier of the storage path further includes the second request parameter, the generating a target request function according to the target interface file includes:
matching the identifier of the storage path corresponding to the target interface parameter according to a preset matching condition, and acquiring a second request parameter in the identifier of the storage path corresponding to the target interface parameter;
converting the second request parameter by adopting a preset conversion mode to obtain a converted second request parameter;
recombining the identifier of the storage path corresponding to the target interface parameter according to the converted second request parameter;
and taking the identifier of the recombined storage path corresponding to the target interface parameter as the identifier of the target storage path.
5. The method of claim 1, wherein the target request parameters further comprise: interface filtering conditions, wherein the generating of the target request function according to the target interface file comprises the following steps:
filtering at least one interface parameter according to the interface filtering condition to obtain a filtered target interface file;
and generating a target request function according to the filtered target interface file.
6. The method of claim 4, wherein the target interface file further comprises: after generating the target request function according to the target interface file, the annotation information corresponding to each interface parameter further includes:
acquiring annotation information corresponding to the target interface parameters according to the target interface file;
and annotating the target request function according to the annotation information corresponding to the target interface parameters, and acquiring the annotated target request function.
7. The method according to claim 1, wherein after generating the target request function according to the target interface file, the joint debugging method further comprises:
and outputting the target request function to the target source code file path according to a preset output command.
8. The method of claim 1, wherein obtaining target request parameters comprises:
receiving an initial request parameter input by a user according to a preset command input rule;
and analyzing the initial request parameter according to a preset analysis command to obtain the target request parameter.
9. The utility model provides a ally oneself with accent device based on network front and back end which characterized in that includes:
an obtaining module, configured to obtain a target request parameter, where the target request parameter includes: interface document address, target source code file path;
the request module is used for requesting to acquire a target interface file corresponding to the interface document address according to the interface document address, wherein the target interface file comprises at least one interface parameter, each interface parameter corresponds to different storage paths, and the identifier of each storage path comprises an interface parameter identifier;
and the generating module is used for generating a target request function according to the target interface file, wherein the target request function is used for being called to acquire target data, and the parameter of the target request function comprises the identifier of the target storage path.
10. A storage medium having stored thereon a computer program for performing the steps of the network front-end based joint debugging method according to any one of claims 1-9 when executed by a processor.
CN202110168032.2A 2021-02-07 2021-02-07 Joint debugging method, device and storage medium based on network front end and network back end Active CN112882844B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110168032.2A CN112882844B (en) 2021-02-07 2021-02-07 Joint debugging method, device and storage medium based on network front end and network back end

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110168032.2A CN112882844B (en) 2021-02-07 2021-02-07 Joint debugging method, device and storage medium based on network front end and network back end

Publications (2)

Publication Number Publication Date
CN112882844A true CN112882844A (en) 2021-06-01
CN112882844B CN112882844B (en) 2024-01-26

Family

ID=76056016

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110168032.2A Active CN112882844B (en) 2021-02-07 2021-02-07 Joint debugging method, device and storage medium based on network front end and network back end

Country Status (1)

Country Link
CN (1) CN112882844B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113362111A (en) * 2021-06-04 2021-09-07 北京百度网讯科技有限公司 Content sending method and device and electronic equipment
CN113490256A (en) * 2021-07-01 2021-10-08 建信金融科技有限责任公司 Front-end and back-end joint debugging method, device, medium and equipment
CN113641589A (en) * 2021-09-01 2021-11-12 中国银行股份有限公司 Data processing method and device

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080201610A1 (en) * 2007-02-20 2008-08-21 Inventec Corporation Integrated test method on multi-operating system platform
CN101470737A (en) * 2007-12-27 2009-07-01 英业达股份有限公司 File type conversion system and method for changing file format
CN103473045A (en) * 2013-08-27 2013-12-25 广州华多网络科技有限公司 Method and device for generating interface documents
CN104954363A (en) * 2015-04-30 2015-09-30 北京嘀嘀无限科技发展有限公司 Method and device for generating interface document
CN106227742A (en) * 2016-07-12 2016-12-14 乐视控股(北京)有限公司 Dynamic web page based on B/S pattern generates method, server and system
CN106933741A (en) * 2017-03-16 2017-07-07 东软集团股份有限公司 The method and device of joint debugging test
CN107463376A (en) * 2017-07-21 2017-12-12 珠海牛角科技有限公司 The method and device for automatically generating back end interface document based on Javadoc
CN108304321A (en) * 2018-01-10 2018-07-20 链家网(北京)科技有限公司 A kind of method, system and device creating front and back end exploitation joint debugging environment
CN110502238A (en) * 2019-07-29 2019-11-26 贝壳技术有限公司 A kind of method and device of front and back end joint debugging
CN111190596A (en) * 2019-12-24 2020-05-22 平安普惠企业管理有限公司 Joint debugging method and device, computer equipment and readable storage medium
CN111651408A (en) * 2020-06-08 2020-09-11 Oppo广东移动通信有限公司 Method, device, terminal and storage medium for acquiring data
CN112256595A (en) * 2020-12-22 2021-01-22 成都新希望金融信息有限公司 Heterogeneous system testing method and device and electronic equipment

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080201610A1 (en) * 2007-02-20 2008-08-21 Inventec Corporation Integrated test method on multi-operating system platform
CN101470737A (en) * 2007-12-27 2009-07-01 英业达股份有限公司 File type conversion system and method for changing file format
CN103473045A (en) * 2013-08-27 2013-12-25 广州华多网络科技有限公司 Method and device for generating interface documents
CN104954363A (en) * 2015-04-30 2015-09-30 北京嘀嘀无限科技发展有限公司 Method and device for generating interface document
CN106227742A (en) * 2016-07-12 2016-12-14 乐视控股(北京)有限公司 Dynamic web page based on B/S pattern generates method, server and system
CN106933741A (en) * 2017-03-16 2017-07-07 东软集团股份有限公司 The method and device of joint debugging test
CN107463376A (en) * 2017-07-21 2017-12-12 珠海牛角科技有限公司 The method and device for automatically generating back end interface document based on Javadoc
CN108304321A (en) * 2018-01-10 2018-07-20 链家网(北京)科技有限公司 A kind of method, system and device creating front and back end exploitation joint debugging environment
CN110502238A (en) * 2019-07-29 2019-11-26 贝壳技术有限公司 A kind of method and device of front and back end joint debugging
CN111190596A (en) * 2019-12-24 2020-05-22 平安普惠企业管理有限公司 Joint debugging method and device, computer equipment and readable storage medium
CN111651408A (en) * 2020-06-08 2020-09-11 Oppo广东移动通信有限公司 Method, device, terminal and storage medium for acquiring data
CN112256595A (en) * 2020-12-22 2021-01-22 成都新希望金融信息有限公司 Heterogeneous system testing method and device and electronic equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
YIFEI GONG 等: "The Architecture of Micro-services and the Separation of Frond-end and Back-end Applied in a Campus Information System", 《2020 IEEE INTERNATIONAL CONFERENCE ON ADVANCES IN ELECTRICAL ENGINEERING AND COMPUTER APPLICATIONS( AEECA)》, pages 321 - 324 *
迟殿委: "一种基于前后端分离架构风格的设计和实现", 《新一代信息技术》, pages 25 - 29 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113362111A (en) * 2021-06-04 2021-09-07 北京百度网讯科技有限公司 Content sending method and device and electronic equipment
CN113362111B (en) * 2021-06-04 2023-07-28 北京百度网讯科技有限公司 Content sending method and device and electronic equipment
CN113490256A (en) * 2021-07-01 2021-10-08 建信金融科技有限责任公司 Front-end and back-end joint debugging method, device, medium and equipment
CN113641589A (en) * 2021-09-01 2021-11-12 中国银行股份有限公司 Data processing method and device

Also Published As

Publication number Publication date
CN112882844B (en) 2024-01-26

Similar Documents

Publication Publication Date Title
CN112882844B (en) Joint debugging method, device and storage medium based on network front end and network back end
US8959477B2 (en) Scripting language for business applications
US9239709B2 (en) Method and system for an interface certification and design tool
US9965300B2 (en) Message matching for opaque service virtualization
CN103744891A (en) Method and system for data query
CN111026634A (en) Interface automation test system, method, device and storage medium
US11797271B2 (en) Dynamic web-based integrated development environment
CN115016784B (en) Low code application multiplexing method, application analysis system, equipment and storage medium
CN114489622A (en) Js application, electronic device, and storage medium
CN114490889A (en) Configuration information processing method, device, equipment, medium and program product
US10606569B2 (en) Declarative configuration elements
CN111259286A (en) Universal WEB page layout generation device and method
Rademacher et al. Design of a domain-specific language based on a technology-independent web service framework
Ornelas et al. Provenance data discovery through Semantic Web resources
US20140013155A1 (en) System and method for facilitating recovery from a document creation error
CN114490892A (en) Data transmission method and device based on datax
CN115022312A (en) Method and device for realizing multiple intelligent contract engines, electronic equipment and storage medium
CN112363699A (en) Interaction method and device applied to multi-language development platform
Wang et al. Improving API Documentation Comprehensibility via Continuous Optimization and Multilingual SDK
Cubo et al. A model to design and verify context-aware adaptive service composition
Ding et al. From textual use cases to service component models
EP3588298B1 (en) Enabling synchronous editable signals in process modeling
Cheney Provenance, XML and the scientific web
Andriescu et al. Dynamic Connector Synthesis: Principles, Methods, Tools and Assessment
CN115827417A (en) Interface testing method, related equipment, storage medium and program product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant