CN114942855A - Interface calling method and device, electronic equipment and storage medium - Google Patents

Interface calling method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114942855A
CN114942855A CN202210700373.4A CN202210700373A CN114942855A CN 114942855 A CN114942855 A CN 114942855A CN 202210700373 A CN202210700373 A CN 202210700373A CN 114942855 A CN114942855 A CN 114942855A
Authority
CN
China
Prior art keywords
interface
field
annotation
request
data
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
CN202210700373.4A
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.)
Ping An Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management 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 Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN202210700373.4A priority Critical patent/CN114942855A/en
Publication of CN114942855A publication Critical patent/CN114942855A/en
Pending legal-status Critical Current

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
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Library & Information Science (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The invention relates to a data processing technology, and discloses an interface calling method, which comprises the following steps: carrying out field analysis on the interface annotation to obtain field parameters corresponding to preset annotation fields in the interface analysis; determining an interface field corresponding to each annotation field according to preset mapping relation data of the annotation fields and the interface fields; carrying out data replacement on the interface request template according to the interface field and the field parameter corresponding to the annotation field to obtain an interface calling request; calling an interface to be called according to the interface calling request, and receiving returned request return data after the interface to be called is called; format conversion is carried out on the request return data to obtain interface query data; and sending the interface query data to preset terminal equipment. The invention also relates to a blockchain technology, and the fragment file can be stored in a blockchain node. The invention also provides an interface calling device, equipment and a medium. The invention can improve the convenience of interface calling.

Description

Interface calling method and device, electronic equipment and storage medium
Technical Field
The present invention relates to data processing technologies, and in particular, to an interface calling method and apparatus, an electronic device, and a storage medium.
Background
With the development of the internet, the industry has many HTTP interface automatic tests realized based on Java codes, and corresponding interfaces need to be called.
However, most of the current interface calling methods realize the calling of the interface by calling a third-party http packet, and the realization of the calling needs to encapsulate a request header, request parameters and the like through java codes and realize the conversion of the request parameters and the return worthiness types. The implementation mode has certain development cost and certain difficulty in maintenance, so that the convenience of interface calling is poor.
Disclosure of Invention
The invention provides an interface calling method, an interface calling device, electronic equipment and a storage medium, and mainly aims to improve the convenience of interface calling.
Acquiring an interface annotation of an interface to be called and an interface calling test request;
performing field analysis on the interface annotation to obtain field parameters corresponding to preset annotation fields in the interface analysis;
determining an interface field corresponding to each annotation field according to preset mapping relation data of the annotation fields and the interface fields;
acquiring a preset interface request template containing the interface field, and performing data replacement on the interface request template according to the interface field corresponding to the annotation field and the field parameter to obtain an interface calling request;
calling the interface to be called according to the interface calling request, and receiving returned request return data after the interface to be called is called;
carrying out format conversion on the request return data to obtain interface query data;
and sending the interface query data to the terminal equipment which sends the interface call test request and/or predetermined terminal equipment.
Optionally, the performing field parsing on the interface annotation to obtain a field parameter corresponding to a preset annotation field in the interface parsing includes:
segmenting the interface annotation by taking a preset annotation symbol as a segmentation node to obtain a plurality of segmentation annotation texts;
traversing all the segmentation annotation texts to screen segmentation annotation texts containing preset annotation fields to obtain target annotation texts;
extracting a character string containing a preset annotation field in the target annotation text;
and removing the extracted preset annotation field and the preset symbol in the character string to obtain the field parameters corresponding to the preset annotation field in the character string.
Optionally, the performing field parsing on the interface annotation to obtain a field parameter corresponding to a preset annotation field in the interface parsing includes:
extracting all character strings in the interface annotation;
traversing all the character strings to screen the character strings containing the annotation fields to obtain target character strings;
and removing the annotation field and the preset symbol contained in the target character string to obtain the field parameters corresponding to the annotation field contained in the character string.
Optionally, the performing data replacement on the interface request template according to the interface field corresponding to the annotation field and the field parameter to obtain an interface call request includes:
and replacing the field value of the interface field corresponding to the comment field in the interface request template by using the field parameter corresponding to the comment field to obtain the interface call request.
Optionally, the converting the format of the request return data to obtain interface query data includes:
extracting field return values corresponding to each interface field in the request return data;
acquiring a return field value format of the interface field;
and converting each field return value in the request return data into a return field value format of an interface field corresponding to the field return value to obtain interface query data.
Optionally, the sending the interface query data to the terminal device that sends the interface call test request and/or a predetermined terminal device includes:
calculating a data signature of the interface query data;
identifying the interface query data using the data signature;
and sending the interface query data identified by the data signature to the terminal equipment sending the interface call test request and/or predetermined terminal equipment.
In order to solve the above problem, the present invention further provides an interface calling apparatus, including:
the annotation analysis module is used for acquiring the interface annotation of the interface to be called and the interface calling test request; performing field analysis on the interface annotation to obtain field parameters corresponding to preset annotation fields in the interface analysis;
the request construction module is used for determining an interface field corresponding to each annotation field according to preset mapping relation data of the annotation fields and the interface fields; acquiring a preset interface request template containing the interface field, and performing data replacement on the interface request template according to the interface field corresponding to the annotation field and the field parameter to obtain an interface calling request;
the interface calling module is used for calling the interface to be called according to the interface calling request and receiving returned request return data after the interface to be called is called; carrying out format conversion on the request return data to obtain interface query data; and sending the interface query data to the terminal equipment which sends the interface call test request and/or predetermined terminal equipment.
Optionally, the performing field parsing on the interface annotation to obtain a field parameter corresponding to a preset annotation field in the interface parsing includes:
segmenting the interface annotation by taking a preset annotation symbol as a segmentation node to obtain a plurality of segmentation annotation texts;
traversing all the segmentation annotation texts to screen segmentation annotation texts containing preset annotation fields to obtain target annotation texts;
extracting a character string containing a preset annotation field in the target annotation text;
and removing the extracted preset annotation field and the preset symbol in the character string to obtain the field parameters corresponding to the preset annotation field in the character string.
In order to solve the above problem, the present invention also provides an electronic device, including:
a memory storing at least one computer program; and
and the processor executes the computer program stored in the memory to realize the interface calling method.
In order to solve the above problem, the present invention also provides a computer-readable storage medium, in which at least one computer program is stored, the at least one computer program being executed by a processor in an electronic device to implement the interface calling method described above.
The embodiment of the invention carries out field analysis on the interface annotation to obtain field parameters corresponding to preset annotation fields in the interface analysis; determining an interface field corresponding to each annotation field according to preset mapping relation data of the annotation fields and the interface fields; performing data replacement on the interface request template according to the interface field corresponding to the annotation field and the field parameter to obtain an interface calling request; the interface annotation is analyzed, the request template is subjected to data replacement by utilizing the analysis result to realize the construction of the interface calling request, the interface calling request does not need to be directly compiled by utilizing codes, and then the threshold for constructing the interface calling request is realized, so that the convenience of interface calling is improved. Therefore, the interface calling method, the interface calling device, the electronic equipment and the readable storage medium provided by the embodiment of the invention improve the convenience of interface calling.
Drawings
Fig. 1 is a schematic flowchart of an interface calling method according to an embodiment of the present invention;
fig. 2 is a block diagram of an interface calling apparatus according to an embodiment of the present invention;
fig. 3 is a schematic diagram of an internal structure of an electronic device implementing an interface calling method according to an embodiment of the present invention;
the implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The embodiment of the invention provides an interface calling method. The execution subject of the interface calling method includes, but is not limited to, at least one of electronic devices, such as a server and a terminal, which can be configured to execute the method provided by the embodiment of the present application. In other words, the interface calling method may be executed by software or hardware installed in the terminal device or the server device, and the software may be a block chain platform. The server includes but is not limited to: the cloud server can be an independent server, or can be a cloud server providing basic cloud computing services such as cloud service, a cloud database, cloud computing, a cloud function, cloud storage, Network service, cloud communication, middleware service, domain name service, security service, a Content Delivery Network (CDN), a big data and artificial intelligence platform, and the like.
Referring to fig. 1, which is a schematic flow diagram of an interface calling method according to an embodiment of the present invention, in an embodiment of the present invention, the interface calling method includes:
s1, acquiring an interface annotation of the interface to be called and an interface calling test request;
in the embodiment of the invention, the interface to be called is an http interface, the interface annotation is the annotation with the calling interface, and the interface calling test request is a request for carrying out interface calling test on the interface to be called.
Specifically, in the embodiment of the present invention, the interface class of the HTTP interface is scanned by using a sprinboot; and obtaining the annotation with the calling interface by using the interface class to obtain the interface annotation.
S2, performing field analysis on the interface annotation to obtain field parameters corresponding to preset annotation fields in the interface analysis;
in the embodiment of the present invention, performing field parsing on the interface annotation to obtain a field parameter corresponding to a preset annotation field in the interface parsing includes:
segmenting the interface annotation by taking a preset annotation symbol as a segmentation node to obtain a plurality of segmentation annotation texts;
specifically, the annotation symbols in the embodiments of the present invention are "@" and "//".
Traversing all the segmentation annotation texts to screen segmentation annotation texts containing preset annotation fields to obtain target annotation texts;
extracting a character string containing a preset annotation field in the target annotation text;
and removing the extracted preset annotation field and the preset symbol in the character string to obtain the field parameters corresponding to the preset annotation field in the character string.
In another embodiment of the present invention, performing field parsing on the interface annotation to obtain field parameters corresponding to a preset annotation field in the interface parsing includes:
extracting all character strings in the interface annotation;
traversing all the character strings to screen the character strings containing the annotation fields to obtain target character strings;
and removing the annotation field and the preset symbol contained in the target character string to obtain the field parameters corresponding to the annotation field contained in the character string.
In another embodiment of the present invention, the field parameter may be stored in a blockchain node, and the data access efficiency is improved by using the characteristic of high throughput of the blockchain node.
S3, determining an interface field corresponding to each annotation field according to preset mapping relation data of the annotation fields and the interface fields;
in the embodiment of the present invention, in order to ensure that the annotation field is consistent with the interface field that can be called in the interface to be called and ensure the normal call of the interface to be called subsequently, the mapping relationship data is the mapping corresponding relationship between different annotation fields and interface fields, and the interface field corresponding to each annotation field is determined according to the preset mapping relationship data between the annotation fields and the interface fields.
S4, acquiring a preset interface request template containing the interface field, and performing data replacement on the interface request template according to the interface field corresponding to the annotation field and the field parameter to obtain an interface call request;
the interface request template in the embodiment of the invention is a blank interface call request which contains necessary interface fields and is not filled with parameters.
Further, in the embodiment of the present invention, performing data replacement on the interface request template according to the interface field corresponding to the annotation field and the field parameter to obtain an interface call request, where the method includes:
and replacing the field value of the interface field corresponding to the annotation field in the interface request template by using the field parameter corresponding to the annotation field to obtain the interface call request.
S5, calling the interface to be called according to the interface calling request, and receiving returned request return data after the interface to be called is called;
in the embodiment of the present invention, the invoking the interface to be invoked according to the interface invocation request includes:
acquiring an interface address of the interface to be called;
and sending the interface calling request to the interface address to call the interface to be called.
Further, in the embodiment of the present invention, the request return data is a set of return values of fields corresponding to a part of interface fields included in the interface to be called.
And S6, converting the format of the request return data to obtain interface query data, and sending the interface query data to the terminal equipment sending the interface call test request and/or predetermined terminal equipment.
In the embodiment of the present invention, converting the format of the request return data to obtain interface query data includes:
extracting a field return value corresponding to each interface field in the request return data;
acquiring a return field value format of the interface field;
and converting each field return value in the request return data into a return field value format of an interface field corresponding to the field return value to obtain interface query data.
In the embodiment of the invention, the interface query data is sent to the terminal equipment which sends the interface calling test request and/or the predetermined terminal equipment. Specifically, the terminal device includes: the mobile phone, the computer, the tablet, the server and other electronic terminals can receive data.
Further, in the embodiment of the present invention, sending the interface query data to the terminal device that sends the interface call test request and/or a predetermined terminal device includes:
acquiring a device transmission address of the terminal device;
constructing a transmission channel according to the equipment transmission address and a preset transmission protocol;
and sending the interface query data to the terminal equipment by utilizing the transmission channel.
Specifically, the constructing of the transmission channel according to the device transmission address and the preset transmission protocol in the embodiment of the present invention includes:
and replacing the equipment transmission address with a transmission address in the transmission protocol to obtain the transmission channel.
Specifically, the transmission protocol in the embodiment of the present invention may be a transmission protocol such as a TCP protocol, a UDP protocol, or the like, and the embodiment of the present invention does not limit the type of the transmission protocol.
In another embodiment of the present invention, in order to ensure that data loss occurs due to incomplete data transmission of the interface query data during the transmission process, the sending of the interface query data to the terminal device that sends the interface call test request and/or to the predetermined terminal device includes:
calculating a data signature of the interface query data;
identifying the interface query data using the data signature;
and sending the interface query data identified by the data signature to the terminal equipment sending the interface call test request and/or predetermined terminal equipment.
Specifically, the file signature calculation on the interface query data to obtain signature data in the embodiment of the present invention includes:
converting the interface query data into binary data;
and taking the binary data as a function variable of a preset file signature function to calculate the file signature function, so as to obtain the data signature.
Optionally, the file signature function in the embodiment of the present invention includes, but is not limited to, an MD5 algorithm function and a hash algorithm function.
In another embodiment of the present invention, to ensure that the format of the interface query data meets the requirement, the sending the interface query data to the terminal device that sends the interface call test request and/or the predetermined terminal device includes: and converting the interface query data into a preset data format to update the query data, and sending the updated query data to the terminal equipment which sends the interface call test request and/or predetermined terminal equipment. The data format is in a set data format in the embodiment of the invention, and the embodiment of the invention does not limit the type of the data format.
Fig. 2 is a functional block diagram of the interface calling apparatus according to the present invention.
The interface calling apparatus 100 according to the present invention may be installed in an electronic device. According to the implemented functions, the interface calling device may include an annotation parsing module 101, a request construction module 102, and an interface calling module 103, which may also be referred to as a unit, and refers to a series of computer program segments that can be executed by a processor of an electronic device and can perform fixed functions, and are stored in a memory of the electronic device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
the annotation parsing module 101 is configured to obtain an interface annotation of an interface to be called and an interface call test request; performing field analysis on the interface annotation to obtain field parameters corresponding to preset annotation fields in the interface analysis;
the request construction module 102 is configured to determine, according to mapping relationship data between preset annotation fields and interface fields, an interface field corresponding to each annotation field; acquiring a preset interface request template containing the interface field, and performing data replacement on the interface request template according to the interface field corresponding to the annotation field and the field parameter to obtain an interface calling request;
the interface calling module 103 is configured to call the interface to be called according to the interface calling request, and receive returned request return data after the interface to be called is called; format conversion is carried out on the request return data to obtain interface query data; and sending the interface query data to the terminal equipment which sends the interface call test request and/or predetermined terminal equipment.
In detail, in the embodiment of the present invention, when the modules in the interface invoking device 100 are used, the same technical means as the interface invoking method described in fig. 1 are used, and the same technical effect can be produced, which is not described herein again.
Fig. 3 is a schematic structural diagram of an electronic device implementing the interface calling method according to the present invention.
The electronic device may comprise a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may further comprise a computer program, such as an interface calling program, stored in the memory 11 and operable on the processor 10.
The memory 11 includes at least one type of readable storage medium, which includes flash memory, removable hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device, for example a removable hard disk of the electronic device. The memory 11 may also be an external storage device of the electronic device in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device. The memory 11 may be used not only to store application software installed in the electronic device and various types of data, such as codes of interface calling programs, etc., but also to temporarily store data that has been output or is to be output.
The processor 10 may be formed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be formed of a plurality of integrated circuits packaged with the same function or different functions, including one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the electronic device by using various interfaces and lines, and executes various functions and processes data of the electronic device by running or executing programs or modules (e.g., interface calling programs, etc.) stored in the memory 11 and calling data stored in the memory 11.
The communication bus 12 may be a PerIPheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. The communication bus 12 is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
Fig. 3 shows only an electronic device having components, and those skilled in the art will appreciate that the structure shown in fig. 3 does not constitute a limitation of the electronic device, and may include fewer or more components than those shown, or some components may be combined, or a different arrangement of components.
For example, although not shown, the electronic device may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so that functions of charge management, discharge management, power consumption management and the like are realized through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure classification circuits, power converters or inverters, power status indicators, and the like. The electronic device may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
Optionally, the communication interface 13 may include a wired interface and/or a wireless interface (e.g., WI-FI interface, bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices.
Optionally, the communication interface 13 may further include a user interface, which may be a Display (Display), an input unit (such as a Keyboard (Keyboard)), and optionally, a standard wired interface, or a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable, among other things, for displaying information processed in the electronic device and for displaying a visualized user interface.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The interface calling program stored in the memory 11 of the electronic device is a combination of a plurality of computer programs, and when running in the processor 10, can realize:
acquiring an interface annotation of an interface to be called and an interface calling test request;
performing field analysis on the interface annotation to obtain field parameters corresponding to preset annotation fields in the interface analysis;
determining an interface field corresponding to each annotation field according to preset mapping relation data of the annotation fields and the interface fields;
acquiring a preset interface request template containing the interface field, and performing data replacement on the interface request template according to the interface field corresponding to the annotation field and the field parameter to obtain an interface calling request;
calling the interface to be called according to the interface calling request, and receiving returned request return data after the interface to be called is called;
format conversion is carried out on the request return data to obtain interface query data;
and sending the interface query data to the terminal equipment which sends the interface call test request and/or predetermined terminal equipment.
Specifically, the processor 10 may refer to the description of the relevant steps in the embodiment corresponding to fig. 1 for a specific implementation method of the computer program, which is not described herein again.
Further, the electronic device integrated module/unit, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in a computer readable storage medium. The computer readable medium may be non-volatile or volatile. The computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM).
Embodiments of the present invention may also provide a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, the computer program may implement:
acquiring an interface annotation of an interface to be called and an interface calling test request;
performing field analysis on the interface annotation to obtain field parameters corresponding to preset annotation fields in the interface analysis;
determining an interface field corresponding to each annotation field according to preset mapping relation data of the annotation fields and the interface fields;
acquiring a preset interface request template containing the interface field, and performing data replacement on the interface request template according to the interface field corresponding to the annotation field and the field parameter to obtain an interface calling request;
calling the interface to be called according to the interface calling request, and receiving returned request return data after the interface to be called is called;
format conversion is carried out on the request return data to obtain interface query data;
and sending the interface query data to the terminal equipment which sends the interface call test request and/or predetermined terminal equipment.
Further, the computer usable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the blockchain node, and the like.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules 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 modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
The embodiment of the application can acquire and process related data based on an artificial intelligence technology. Among them, Artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
In addition, functional modules in the embodiments of the present invention 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 module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
Furthermore, it will be obvious that the term "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only intended to illustrate the technical solutions of the present invention and not to limit the same, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. An interface calling method, comprising:
acquiring an interface annotation of an interface to be called and an interface calling test request;
performing field analysis on the interface annotation to obtain field parameters corresponding to preset annotation fields in the interface analysis;
determining an interface field corresponding to each annotation field according to preset mapping relation data of the annotation fields and the interface fields;
acquiring a preset interface request template containing the interface field, and performing data replacement on the interface request template according to the interface field corresponding to the annotation field and the field parameter to obtain an interface calling request;
calling the interface to be called according to the interface calling request, and receiving returned request return data after the interface to be called is called;
format conversion is carried out on the request return data to obtain interface query data;
and sending the interface query data to the terminal equipment which sends the interface call test request and/or predetermined terminal equipment.
2. The interface calling method of claim 1, wherein the performing field parsing on the interface annotation to obtain field parameters corresponding to preset annotation fields in the interface parsing includes:
segmenting the interface annotation by taking a preset annotation symbol as a segmentation node to obtain a plurality of segmentation annotation texts;
traversing all the segmentation annotation texts to screen segmentation annotation texts containing preset annotation fields to obtain target annotation texts;
extracting a character string containing a preset annotation field in the target annotation text;
and removing the extracted preset annotation field and the preset symbol in the character string to obtain the field parameters corresponding to the preset annotation field in the character string.
3. The interface calling method of claim 1, wherein the performing field parsing on the interface annotation to obtain field parameters corresponding to preset annotation fields in the interface parsing includes:
extracting all character strings in the interface annotation;
traversing all the character strings to screen the character strings containing the annotation fields to obtain target character strings;
and removing the annotation field and the preset symbol contained in the target character string to obtain the field parameters corresponding to the annotation field contained in the character string.
4. The interface calling method according to claim 1, wherein the performing data replacement on the interface request template according to the interface field corresponding to the comment field and the field parameter to obtain an interface calling request comprises:
and replacing the field value of the interface field corresponding to the annotation field in the interface request template by using the field parameter corresponding to the annotation field to obtain the interface call request.
5. The interface call method according to claim 1, wherein the converting the format of the request return data to obtain the interface query data comprises:
extracting a field return value corresponding to each interface field in the request return data;
acquiring a return field value format of the interface field;
and converting each field return value in the request return data into a return field value format of an interface field corresponding to the field return value to obtain interface query data.
6. The interface invoking method according to any one of claims 1 to 5, wherein the sending the interface query data to the terminal device issuing the interface invoking test request and/or a predetermined terminal device comprises:
calculating a data signature of the interface query data;
identifying the interface query data using the data signature;
and sending the interface query data identified by the data signature to the terminal equipment sending the interface call test request and/or predetermined terminal equipment.
7. An interface invocation apparatus, comprising:
the annotation analysis module is used for acquiring the interface annotation of the interface to be called and the interface calling test request; performing field analysis on the interface annotation to obtain field parameters corresponding to preset annotation fields in the interface analysis;
the request construction module is used for determining an interface field corresponding to each annotation field according to preset mapping relation data of the annotation fields and the interface fields; acquiring a preset interface request template containing the interface field, and performing data replacement on the interface request template according to the interface field corresponding to the annotation field and the field parameter to obtain an interface calling request;
the interface calling module is used for calling the interface to be called according to the interface calling request and receiving returned request return data after the interface to be called is called; carrying out format conversion on the request return data to obtain interface query data; and sending the interface query data to the terminal equipment which sends the interface call test request and/or predetermined terminal equipment.
8. The interface invocation device according to claim 7, wherein the field parsing the interface annotation to obtain the field parameter corresponding to the preset annotation field in the interface parsing includes:
segmenting the interface annotation by using a preset annotation symbol as a segmentation node to obtain a plurality of segmentation annotation texts;
traversing all the segmentation annotation texts to screen segmentation annotation texts containing preset annotation fields to obtain target annotation texts;
extracting a character string containing a preset annotation field in the target annotation text;
and removing the extracted preset annotation field and the preset symbol in the character string to obtain the field parameters corresponding to the preset annotation field in the character string.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor;
wherein the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the interface call method according to any one of claims 1 to 6.
10. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the interface call method according to any one of claims 1 to 6.
CN202210700373.4A 2022-06-20 2022-06-20 Interface calling method and device, electronic equipment and storage medium Pending CN114942855A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210700373.4A CN114942855A (en) 2022-06-20 2022-06-20 Interface calling method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210700373.4A CN114942855A (en) 2022-06-20 2022-06-20 Interface calling method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114942855A true CN114942855A (en) 2022-08-26

Family

ID=82910111

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210700373.4A Pending CN114942855A (en) 2022-06-20 2022-06-20 Interface calling method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114942855A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118041900A (en) * 2024-03-13 2024-05-14 江西数字网联信息安全技术有限公司 Hardware terminal control method and device based on middleware

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118041900A (en) * 2024-03-13 2024-05-14 江西数字网联信息安全技术有限公司 Hardware terminal control method and device based on middleware

Similar Documents

Publication Publication Date Title
CN112653760B (en) Cross-server file transmission method and device, electronic equipment and storage medium
CN113806434B (en) Big data processing method, device, equipment and medium
CN112486490B (en) Front-end code packaging method and device, electronic equipment and storage medium
CN114881616A (en) Business process execution method and device, electronic equipment and storage medium
CN113868528A (en) Information recommendation method and device, electronic equipment and readable storage medium
CN114491047A (en) Multi-label text classification method and device, electronic equipment and storage medium
CN113890712A (en) Data transmission method and device, electronic equipment and readable storage medium
CN112702228A (en) Service current limiting response method and device, electronic equipment and readable storage medium
CN114942855A (en) Interface calling method and device, electronic equipment and storage medium
CN115033605A (en) Data query method and device, electronic equipment and storage medium
CN115174555A (en) File transmission method and device, electronic equipment and storage medium
CN114547011A (en) Data extraction method and device, electronic equipment and storage medium
CN115145870A (en) Method and device for positioning reason of failed task, electronic equipment and storage medium
CN115082736A (en) Garbage identification and classification method and device, electronic equipment and storage medium
CN115174541A (en) H5 resource loading method and device, electronic equipment and storage medium
CN114185588A (en) Incremental package generation method, device, equipment and storage medium
CN113704616A (en) Information pushing method and device, electronic equipment and readable storage medium
CN112667244A (en) Data verification method and device, electronic equipment and computer readable storage medium
CN115002100B (en) File transmission method and device, electronic equipment and storage medium
CN113672483B (en) Device log storage method and device, electronic device and medium
CN114416575A (en) Method, device and equipment for generating Mock data and storage medium
CN114510666A (en) Page jump method, device, equipment and storage medium
CN113608931A (en) Fault-tolerant processing method, device and equipment for updating application resources and storage medium
CN115080898A (en) View updating method, device, equipment and medium based on front-end trigger scene
CN115480842A (en) Secondary development service method and device for product application, electronic equipment and storage medium

Legal Events

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