Method and device for realizing interface reading based on interface document, equipment and medium

Automated interface document generation using Swagger and FreeMarker improves efficiency and accuracy in managing interface information, addressing inefficiencies and errors in traditional manual methods.

CN119149097APending Publication Date: 2024-12-17INSPUR ZHUOSHU BIG DATA IND DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411176635.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-26
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

Traditional methods of manually recording and maintaining interface information in complex software systems are inefficient, prone to errors, and lead to inconsistencies, affecting system stability and maintainability due to human factors.

Method used

Implement a method using the Swagger framework and FreeMarker template engine to automatically generate and manage interface documents, integrating Swagger annotations to extract interface information and using FreeMarker to create customizable templates for storing and parsing interface data.

Benefits of technology

This approach enhances efficiency and accuracy in interface document management, reduces human errors, ensures real-time updates, and maintains consistency, improving system stability and maintainability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119149097A_ABST
    Figure CN119149097A_ABST
Patent Text Reader

Abstract

The invention discloses a method, a device and equipment for realizing interface reading based on an interface document and a medium, and the method comprises the following steps: adding a dependency item of a Swagger framework into a preset SpringBoot application, and creating a configuration class corresponding to the Swagger framework to determine a to-be-read interface; when the SpringBoot application is started, obtaining interface information corresponding to the to-be-read interface based on the configuration class and the dependency item; the FreeMarker template engine is integrated into the SpringBoot application, an interface document template used for storing the interface information is created through the FreeMarker template engine, and an interface document corresponding to the interface to be read is generated through the interface document template and the interface information; and analyzing the interface document to obtain interface element information corresponding to the to-be-read interface so as to read the to-be-read interface.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device, equipment and medium for implementing interface reading based on an interface document. Background Art

[0002] In the complex environment of modern software development and operation and maintenance, data full-cycle management has become a core strategy to ensure data quality, security and efficiency. This cycle covers the entire process of data generation, processing, storage, analysis and destruction, and the service interface, as a bridge for data exchange, plays a vital role in this process. Interface information, including the URL of the interface, request parameters, response data structure, etc., is the basis for ensuring smooth communication between systems and correct data flow.

[0003] However, with the expansion of system scale and the surge in the number of service interfaces, the traditional method of manually recording and maintaining these interface information is not only inefficient, but also prone to information inconsistencies, omissions or errors due to human factors, which in turn affects the stability and maintainability of the system. Summary of the invention

[0004] In order to solve the above problems, the present application proposes a method for implementing interface reading based on an interface document, including:

[0005] Add the dependencies of the Swagger framework to the preset SpringBoot application, and create a configuration class corresponding to the Swagger framework to determine the interface to be read;

[0006] When the SpringBoot application is started, based on the configuration class and the dependencies, the interface information corresponding to the interface to be read is obtained;

[0007] Integrate the FreeMarker template engine into the SpringBoot application, and create an interface document template for storing interface information through the FreeMarker template engine, so as to generate an interface document corresponding to the interface to be read through the interface document template and the interface information;

[0008] The interface document is parsed to obtain interface element information corresponding to the interface to be read, thereby realizing reading of the interface to be read.

[0009] In one implementation of the present application, based on the configuration class and the dependency, obtaining the interface information corresponding to the interface to be read specifically includes:

[0010] Based on the configuration class and the dependencies, a corresponding Swagger annotation is added to the interface to be read, so that when the SpringBoot application is started, interface information corresponding to the interface to be read is obtained through the Swagger annotation.

[0011] In one implementation of the present application, an interface document template for storing interface information is created by the FreeMarker template engine, specifically including:

[0012] By means of the FreeMarker template engine, an initial interface document template for storing interface information is created, and dynamic parameters that can change dynamically in each interface information contained in the initial interface document template are identified; wherein the dynamic parameters include at least one or more of the following: interface name, interface address, request parameter name, response code, response description;

[0013] Convert the dynamic parameters into their corresponding placeholders to obtain a converted initial interface document template;

[0014] After storing the converted initial interface document template in the first format, converting the format of the converted initial interface document template to obtain the converted initial interface document template in the second format;

[0015] The converted initial interface document template is formatted to obtain an interface document template; wherein the first format is an XML format and the second format is an FTL format.

[0016] In one implementation of the present application, generating an interface document corresponding to the interface to be read by using the interface document template and the interface information specifically includes:

[0017] Identify the interface information to obtain a dynamic parameter value corresponding to the dynamic parameter;

[0018] The placeholders in the interface document template are filled according to the dynamic parameter values ​​to generate an interface document corresponding to the interface to be read.

[0019] In one implementation of the present application, parsing the interface document to obtain interface element information corresponding to the interface to be read and reading the interface to be read specifically includes:

[0020] Converting the interface document into an intermediate file in a preset format, and parsing the intermediate file to obtain interface element information corresponding to the interface to be read; wherein the preset format is XML format;

[0021] The interface element information is stored in an interface element information table corresponding to a database, so as to read the interface element information corresponding to the interface to be read through the interface element information table.

[0022] In one implementation of the present application, the interface element information includes at least one or more of the following: basic interface information, interface parameters, and interface response information.

[0023] In one implementation of the present application, the interface document is a word document.

[0024] The embodiment of the present application provides a device for implementing interface reading based on an interface document, the device comprising:

[0025] Create a module to add the dependencies of the Swagger framework to the preset SpringBoot application, and create a configuration class corresponding to the Swagger framework to determine the interface to be read;

[0026] An acquisition module, used to acquire interface information corresponding to the interface to be read based on the configuration class and the dependencies when the SpringBoot application is started;

[0027] An interface document generation module, used to integrate the FreeMarker template engine into the SpringBoot application, create an interface document template for storing interface information through the FreeMarker template engine, and generate an interface document corresponding to the interface to be read through the interface document template and the interface information;

[0028] The reading module is used to parse the interface document to obtain the interface element information corresponding to the interface to be read, so as to realize the reading of the interface to be read.

[0029] The embodiment of the present application provides a device for implementing interface reading based on an interface document, the device comprising:

[0030] at least one processor;

[0031] and, a memory communicatively coupled to the at least one processor;

[0032] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for implementing interface reading based on an interface document as described in any of the above items.

[0033] The embodiment of the present application provides a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured as follows:

[0034] A method for implementing interface reading based on an interface document as described in any of the above items.

[0035] The method for implementing interface reading based on interface document proposed in this application can bring the following beneficial effects:

[0036] Through the Swagger framework, you can automatically scan and extract the interface information defined in the SpringBoot application, greatly improving the efficiency and accuracy of interface document writing, reducing duplication of work and human errors. When the interface changes, Swagger can capture these changes in real time and update the interface document, ensuring the real-time and accuracy of the interface document without manual update.

[0037] Through the FreeMarker template engine, the style and content of the interface document can be flexibly customized to make it more in line with the actual needs of the project. At the same time, it is also convenient for subsequent expansion and updating of the document.

[0038] Using interface documents as a medium to store and manage interface information makes management easier and avoids omissions, errors, or inconsistencies that may occur in traditional storage methods. This helps ensure the accuracy and consistency of interface information and reduce development errors caused by inconsistent information. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0040] Figure 1 A flowchart of a method for implementing interface reading based on an interface document provided in an embodiment of the present application;

[0041] Figure 2 A flowchart of another method for implementing interface reading based on an interface document provided in an embodiment of the present application;

[0042] Figure 3 A schematic diagram of the structure of a device for implementing interface reading based on an interface document provided in an embodiment of the present application;

[0043] Figure 4 A schematic diagram of the structure of a device for implementing interface reading based on an interface document provided in an embodiment of the present application. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0045] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.

[0046] like Figure 1 As shown, a method for implementing interface reading based on an interface document provided in an embodiment of the present application includes:

[0047] S101: Add the dependencies of the Swagger framework to the preset SpringBoot application, and create a configuration class corresponding to the Swagger framework to determine the interface to be read.

[0048] Traditional interface storage services need to retain a large amount of interface information in the database. Due to the large amount and complexity of the information, the error rate is high. To solve the above problem, the embodiment of the present application formats the interface information and generates an interface document containing the interface information, thereby realizing standardized storage of the interface information with the help of the interface document, thereby ensuring the consistency and accuracy of the interface data.

[0049] The extraction of interface information needs to be implemented through the Swagger framework. The Swagger framework is used to generate, describe, call and visualize RESTful-style web services. It not only provides a detailed description of the API, but also allows users to send requests and view responses directly in the browser through the Swagger UI interface. This real-time testing function greatly simplifies the API testing process, allowing developers to quickly verify the functionality and performance of the API without writing additional test code or configuring the test environment. Based on the above features, if you want to achieve automatic extraction of interface information, you need to integrate the SpringBoot application and the Swagger framework. Therefore, you need to add the dependencies of the Swagger framework to the preset SpringBoot application. Specifically, add the Spring Boot integration library of Swagger (such as springfox-swagger2 and springfox-swagger-ui) in the pom.xml file in the SpringBoot application. These libraries provide support for Swagger annotations and a built-in Swagger UI to display API information. Then, create a configuration class to specify which packages or classes under which interfaces should be scanned by Swagger and extract interface information.

[0050] S102: When the SpringBoot application is started, based on the configuration class and dependencies, the interface information corresponding to the interface to be read is obtained.

[0051] Extracting interface information can be done through annotations. Based on the previously configured configuration classes and dependencies, after determining the interface to be read, add Swagger annotations to the interface to be read. In this way, when the SpringBoot application is started, the server can automatically read the corresponding interface information through Swagger annotations. For example, you can add custom information to the interface to be read by adding annotations such as @Api, @ApiOperation, and @ApiParam. It should be noted that the above interface information is implemented through the / v2 / api-docs interface provided by Swagger.

[0052] S103: Integrate the FreeMarker template engine into the SpringBoot application, and create an interface document template for storing interface information through the FreeMarker template engine, so as to generate an interface document corresponding to the interface to be read through the interface document template and the interface information.

[0053] FreeMarker is a template engine, that is, a general tool based on templates and data to be changed, and used to generate output text. Its working principle can be summarized as "template + data model = output". FreeMarker uses a specific template file as the basis for generating output. When outputting problems, it needs to rely on a data model, which is a collection of various attributes (such as variables, objects, etc.). When it is necessary to generate output, FreeMarker reads the template file and fills the data in the data model into the placeholder position in the template. After filling, FreeMarker generates the final output file, which contains the static content of the template and the dynamic data in the data model. Therefore, after reading the interface information, if you want to achieve formatted output of the interface information, you can use the FreeMarker template engine integrated into the SpringBoot application to achieve it. The FreeMarker template engine creates interface document templates for storing interface information. These templates define the structure and style of the interface document, including static HTML tags, CSS styles, and placeholders for inserting dynamic parameters. When it is necessary to generate an interface document, the SpringBoot application reads the interface information and passes it to the FreeMarker template engine as a data model. The FreeMarker template engine renders the provided interface document template and data model (interface information) to generate the final interface document, which is in word format.

[0054] Specifically, according to the requirements of the interface document, an initial interface document template is created. This template contains the basic structure of the interface document and some static content, such as the title of the document, the interface request method, instructions for use, etc. Identify which information in the initial interface document template may change dynamically, that is, which information needs to be filled in according to the actual interface information. These dynamic parameters include at least one or more of the following: interface name, interface address (URL), request parameter name, response code. These dynamic parameters are the core content of the interface document, and they will vary according to different interfaces. The dynamic parameters are only placeholders in the form of text in the initial interface document template, and do not have actual data. Therefore, the identified dynamic parameters need to be converted according to the placeholder syntax of the FreeMarker template engine. FreeMarker placeholders are usually wrapped in ${}, for example, ${interfaceName} is used to represent the placeholder of the interface name. Through this step, the dynamic parameters in the initial interface document template are converted into placeholders that FreeMarker can recognize, and these placeholders will be replaced by actual data when the template is rendered.

[0055] The converted initial interface document template (which already contains FreeMarker placeholders at this time) is first stored in a certain format. The first format mentioned here is XML format. After the storage is completed, it needs to be formatted to convert the converted initial interface document template into FreeMarker's FTL format. After the conversion is completed, the template is stored in FTL format, and the converted initial interface document template is formatted to ensure that it conforms to the expected format and style. This step may include adjusting HTML tags, CSS styles, text formats, etc. to ensure that the generated interface document is both beautiful and easy to read. The formatted template is the final interface document template, which contains all the necessary static content and dynamic placeholders, ready to be combined with the actual interface information when needed to generate a complete interface document.

[0056] When generating an interface document, first identify the interface information extracted by Swagger, and extract the dynamic parameter values ​​corresponding to the dynamic parameters defined in the interface document template from the interface information. These values ​​will be used to replace the placeholders in the template later. For example, if there is a placeholder ${interfaceName} in the template to represent the interface name, then you need to find the actual name of the interface from the interface information and use it as the value of interfaceName. Then, use the extracted dynamic parameter values ​​to fill the placeholders in the interface document template. This step is completed by the FreeMarker template engine. The FreeMarker template engine reads the template file and traverses all the placeholders in it. For each placeholder, it looks for the corresponding dynamic parameter value and inserts it into the corresponding position in the template. After this step, the placeholders in the template are replaced by the actual interface information, and an interface document containing specific interface content is generated.

[0057] S104: Parse the interface document to obtain interface element information corresponding to the interface to be read, so as to read the interface to be read.

[0058] After the interface document is generated, it is necessary to parse the interface document to obtain the corresponding interface element information, and then store the interface element information in the corresponding interface element information table in the database, so as to realize the storage of the interface information. By reading the database, the information of the interface to be read can be read. The interface element information includes at least one or more of the following: basic interface information, interface parameters, and interface response information.

[0059] Specifically, the interface document in word format is converted into an intermediate file in XML format, and an XML parser is selected or written to read and parse the converted XML file. The XML parser can traverse the structure of the XML document and extract all element information related to the interface to be read by parsing the XML file. One or more interface element information tables are created in the database to store the interface element information extracted from the XML file. When it is necessary to read the interface element information corresponding to the interface to be read, the required interface element information is obtained from the database after executing the corresponding query statement. This information can be used to generate interface call requests, perform interface testing, or be used by other system components.

[0060] By converting the interface document into an intermediate file in XML format, parsing the file and storing it in a database, the interface element information can be structured and centrally managed. This method improves the accessibility and maintainability of interface information, allowing developers to read and use interface information more conveniently. At the same time, the use of a database also provides powerful query and retrieval capabilities, supporting complex interface information management and analysis needs.

[0061] Figure 2 A flowchart of another method for implementing interface reading based on an interface document provided in an embodiment of the present application. Figure 2 As shown in the figure, by integrating the SpringBoot application and the Swagger framework, the interface information of the interface to be read can be obtained by calling the / v2 / api-docs interface in the Swagger framework by identifying annotations. The FreeMarker template engine can generate the corresponding interface document based on the interface information and the word template document (interface document template) provided by itself. In this way, the interface information can be stored based on the interface document. By parsing the interface document, the interface information can be stored in the database in the form of a structured table, ensuring the accuracy of the interface information when it is stored.

[0062] The above are embodiments of the method proposed in this application. Based on the same idea, some embodiments of this application also provide devices, equipment and non-volatile computer storage media corresponding to the above method.

[0063] Figure 3 The present invention provides a schematic diagram of a device for implementing interface reading based on an interface document. Figure 3 As shown, the device comprises:

[0064] Create module 301, which is used to add the dependencies of the Swagger framework to the preset SpringBoot application and create a configuration class corresponding to the Swagger framework to determine the interface to be read;

[0065] The acquisition module 302 is used to acquire the interface information corresponding to the interface to be read based on the configuration class and dependencies when the SpringBoot application is started;

[0066] The interface document generation module 303 is used to integrate the FreeMarker template engine into the SpringBoot application, create an interface document template for storing interface information through the FreeMarker template engine, and generate an interface document corresponding to the interface to be read through the interface document template and the interface information;

[0067] The reading module 304 is used to parse the interface document to obtain the interface element information corresponding to the interface to be read, so as to realize the reading of the interface to be read.

[0068] Figure 4 A schematic diagram of a device for implementing interface reading based on an interface document provided in an embodiment of the present application. Figure 4 As shown, including:

[0069] at least one processor; and,

[0070] at least one processor is communicatively connected to a memory; wherein,

[0071] The memory stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor so that the at least one processor can execute the method for implementing interface reading based on the interface document as described in any of the above items.

[0072] An embodiment of the present application provides a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured to: implement a method for interface reading based on an interface document as described in any one of the above items.

[0073] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0074] The devices and media provided in the embodiments of the present application correspond one-to-one to the methods. Therefore, the devices and media also have similar beneficial technical effects as the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.

[0075] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0076] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0077] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0078] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0079] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0080] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0081] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0082] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0083] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims

1. A method for implementing interface reading based on an interface document, characterized in that: The method comprises: Add the dependencies of the Swagger framework to the preset SpringBoot application, and create a configuration class corresponding to the Swagger framework to determine the interface to be read; When the SpringBoot application is started, based on the configuration class and the dependencies, the interface information corresponding to the interface to be read is obtained; Integrate the FreeMarker template engine into the SpringBoot application, and create an interface document template for storing interface information through the FreeMarker template engine, so as to generate an interface document corresponding to the interface to be read through the interface document template and the interface information; The interface document is parsed to obtain interface element information corresponding to the interface to be read, thereby realizing reading of the interface to be read.

2. The method for implementing interface reading based on interface document according to claim 1, characterized in that: Based on the configuration class and the dependency, obtaining interface information corresponding to the interface to be read specifically includes: Based on the configuration class and the dependencies, a corresponding Swagger annotation is added to the interface to be read, so that when the SpringBoot application is started, interface information corresponding to the interface to be read is obtained through the Swagger annotation.

3. The method for implementing interface reading based on interface document according to claim 1, characterized in that: The interface document template for storing interface information is created by the FreeMarker template engine, specifically including: By means of the FreeMarker template engine, an initial interface document template for storing interface information is created, and dynamic parameters that can change dynamically in each interface information contained in the initial interface document template are identified; wherein the dynamic parameters include at least one or more of the following: interface name, interface address, request parameter name, response code, response description; Convert the dynamic parameters into their corresponding placeholders to obtain a converted initial interface document template; After storing the converted initial interface document template in the first format, converting the format of the converted initial interface document template to obtain the converted initial interface document template in the second format; The converted initial interface document template is formatted to obtain an interface document template; wherein the first format is an XML format and the second format is an FTL format.

4. The method for implementing interface reading based on interface document according to claim 3, characterized in that: Generate an interface document corresponding to the interface to be read by using the interface document template and the interface information, specifically including: Identify the interface information to obtain a dynamic parameter value corresponding to the dynamic parameter; The placeholders in the interface document template are filled according to the dynamic parameter values ​​to generate an interface document corresponding to the interface to be read.

5. The method for implementing interface reading based on interface document according to claim 1, characterized in that: Parsing the interface document to obtain interface element information corresponding to the interface to be read, and realizing reading of the interface to be read, specifically includes: Converting the interface document into an intermediate file in a preset format, and parsing the intermediate file to obtain interface element information corresponding to the interface to be read; wherein the preset format is XML format; The interface element information is stored in an interface element information table corresponding to a database, so as to read the interface element information corresponding to the interface to be read through the interface element information table.

6. The method for implementing interface reading based on interface document according to claim 4, characterized in that: The interface element information includes at least one or more of the following: basic interface information, interface parameters, and interface response information.

7. The method for implementing interface reading based on interface document according to claim 1, characterized in that: The interface document is a word document.

8. A device for implementing interface reading based on an interface document, characterized in that: The device comprises: Create a module to add the dependencies of the Swagger framework to the preset SpringBoot application, and create a configuration class corresponding to the Swagger framework to determine the interface to be read; An acquisition module, used to acquire interface information corresponding to the interface to be read based on the configuration class and the dependencies when the SpringBoot application is started; An interface document generation module, used to integrate the FreeMarker template engine into the SpringBoot application, create an interface document template for storing interface information through the FreeMarker template engine, and generate an interface document corresponding to the interface to be read through the interface document template and the interface information; The reading module is used to parse the interface document to obtain the interface element information corresponding to the interface to be read, so as to realize the reading of the interface to be read.

9. A device for implementing interface reading based on an interface document, characterized in that: The device comprises: at least one processor; and, a memory communicatively coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for implementing interface reading based on an interface document as described in any one of claims 1-7.

10. A non-volatile computer storage medium storing computer executable instructions, characterized in that: The computer executable instructions are configured to: A method for implementing interface reading based on an interface document as described in any one of claims 1 to 7.