Interface document management method, device, storage medium and electronic device
By automatically acquiring and correlating various interface data, a unified interface document is generated and saved, which solves the problem of scattered interface data and different formats, realizes the improvement and unified management of interface data, and improves the convenience of use.
Patent Information
- Application Number
- CN202110349188.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-31
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2041-03-31
AI Technical Summary
In the existing technology, the interface data opened by Internet company servers is scattered on multiple platforms, and the interface documents are written in different formats, resulting in difficult and incomplete management.
By automatically obtaining business service data, back-end interface data, front-end address data and front-end interface data, and performing correlation processing based on preset mapping relationships, a unified interface document is generated and saved in the database.
It realizes the improvement and unified management of interface data, reduces the time for users to search for interface data on multiple platforms, and avoids the cumbersome operation of encapsulating single interface data.
Smart Images

Figure CN112988872B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an interface document management method, device, storage medium and electronic device. Background Art
[0002] In today's Internet era, information systems support the operation of online services. The front-end services and back-end services within the information system and the interactions between information systems are all communicated through application programming interfaces (APIs). Therefore, Internet company servers open a large number of interfaces to clients. However, a large number of complex interface data are often scattered on various Internet platforms that support interface document storage services, and the writing formats of interface documents are also different. At the same time, there is also the problem of incomplete interface documents. Summary of the invention
[0003] The embodiment of the present application provides an interface document management method, device, storage medium and electronic device, which can automatically obtain interface documents, realize unified management of interface documents, and ensure the integrity of interface documents. The technical solution is as follows:
[0004] In a first aspect, an embodiment of the present application provides an interface document management method, the method comprising:
[0005] Acquire multiple business service data and backend interface data with corresponding relationships, and acquire multiple frontend address data and frontend interface data with corresponding relationships;
[0006] Based on the mapping relationship between the preset front-end address data and the preset business service data, the front-end address data and the business service data having a corresponding relationship are associated with each other to generate an interface document including the business service data, the back-end interface data, the front-end address data and the front-end interface data;
[0007] The interface document is saved in a database.
[0008] In a second aspect, an embodiment of the present application provides an interface document management device, the device comprising:
[0009] The interface data acquisition module is used to acquire a plurality of business service data and back-end interface data having corresponding relationships, and to acquire a plurality of front-end address data and front-end interface data having corresponding relationships;
[0010] An interface document generation module is used to associate the front-end address data and the business service data having a corresponding relationship based on a mapping relationship between the preset front-end address data and the preset business service data, and generate an interface document including the business service data, the back-end interface data, the front-end address data and the front-end interface data;
[0011] The interface document saving module is used to save the interface document into the database.
[0012] In a third aspect, an embodiment of the present application provides a computer storage medium, wherein the computer storage medium stores a plurality of instructions, wherein the instructions are suitable for being loaded by a processor and executing the above-mentioned method steps.
[0013] In a fourth aspect, an embodiment of the present application provides an electronic device, which may include: a processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the above-mentioned method steps.
[0014] The beneficial effects brought about by the technical solutions provided by some embodiments of the present application include at least:
[0015] By automatically acquiring business data and back-end interface data, as well as automatically acquiring front-end address data and front-end interface data, adding associations between the above four types of data to generate interface documents, and saving the interface documents in the database, the interface data can be improved and uniformly stored; a unified interface is provided to users to access the interface documents in the database that include all interface data, thereby reducing the time users spend searching for interface data on major platforms by themselves, and avoiding the tedious operation of users encapsulating single interface data. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0017] Figure 1 This is a system architecture diagram of an interface document management method provided by an embodiment of the present application;
[0018] Figure 2 It is a flowchart of an interface document management method provided in an embodiment of the present application;
[0019] Figure 3 It is a structural diagram of an interface document provided in an embodiment of the present application;
[0020] Figure 4 It is a schematic diagram of an interface document provided in an embodiment of the present application;
[0021] Figure 5 It is a flowchart of another interface document management method provided in an embodiment of the present application;
[0022] Figure 6 It is a schematic diagram of a flow chart of structured processing of front-end interface data provided by an embodiment of the present application;
[0023] Figure 7 It is a structural diagram of an interface document management device provided in an embodiment of the present application;
[0024] Figure 8 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0025] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. 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 creative work are within the scope of protection of this application.
[0026] In the description of the present application, it should be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In the description of the present application, it should be noted that, unless otherwise clearly specified and limited, "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood in specific circumstances. In addition, in the description of the present application, unless otherwise specified, "multiple" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships can exist, for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are a kind of "or" relationship.
[0027] The present application is described in detail below with reference to specific embodiments.
[0028] like Figure 1As shown, it is a system architecture diagram of an interface document management provided in an embodiment of the present application, and the system architecture diagram includes: a service platform 101 that can obtain multiple business service data and back-end interface data with corresponding relationships, for example, the service platform 101 includes swagger, WiKi or Yapi, and corresponding swagger services, WiKi services or Yapi services are provided, a service platform 102 that can obtain multiple front-end address data and front-end interface data with corresponding relationships, such as Alibaba Cloud log or page crawling server, corresponding log service 102 or page crawling service, an interface document management device 103 and a client 104 for accessing the database of the interface document management device.
[0029] Business service data can be understood as data such as the specific content or form of expression of a service provided by a server or server cluster. For example, if a business service is a search service or a news service, business service data is the data corresponding to the search service or the data corresponding to the news service.
[0030] The backend interface (Application Programming Interface, API) data can be understood as the entry data for implementing business services (Services). There is a corresponding relationship between the backend interface API data and the business service (Service) data. In other words, the client communicates with the logic layer of the business service through the backend interface to obtain the service content provided by the business service. For example, the client requests the search service through the backend interface corresponding to the search service.
[0031] The interface data includes, but is not limited to, interface method information, interface parameter name information, interface parameter description information, interface parameter example information, interface path information, or any data related to the interface. The above interface data includes front-end interface data and back-end interface data.
[0032] It is understandable that the business service data and the backend interface data include data in any format such as JS Object Notation (JSON), YAML Ain't a Markup Language (YAML) or eXtensible Markup Language (XML).
[0033] A service platform 101 can be used to obtain multiple business service data and back-end interface data with corresponding relationships. The following is referred to as the first service platform 101, for example, including swagger, WiKi or Yapi, swagger, swagger refers to a Web service platform that generates back-end interface data based on a standardized and complete Spring framework, wiki refers to a hypertext system that is open on the Internet and can be collaboratively created by multiple people, and Yapi refers to a powerful interface management platform. In other words, back-end developers will generate corresponding back-end interface data through various tools during the development of business services, and save the back-end interface data on various service platforms; the interface document management device 103 obtains business service data and back-end interface data with corresponding relationships by accessing various service platforms.
[0034] In one embodiment, the interface document management device 103 allows the user to directly write the business service data and back-end interface data with corresponding relationships into the database through the client. It can be understood that the above service platform is only an example, and this application does not limit the method by which the interface document management device 103 obtains the business service data and back-end interface data with corresponding relationships.
[0035] The front-end address data can be understood as the address data corresponding to the server's IP that is written based on the Internet domain name rules, and has the function of indicating the business services, nature, and location of the server. For example, the front-end address data is written based on the Uniform Resource Locator (URL) rule, which is https: / / www.xxxxxx.com / index.html. When the client accesses the front-end address data, it can automatically access the corresponding server based on the Domain Name System (DNS), thereby using the business services provided by the server. It can be understood that the front-end address data includes data in the format of URL or domain name.
[0036] The front-end interface data can be understood as web page (web) interface data written based on the front-end address data and HyperText Transfer Protocol (HTTP), and the front-end interface data and the front-end address data have a corresponding relationship.
[0037] A service platform 102 that can obtain multiple front-end address data and front-end interface data with corresponding relationships, hereinafter referred to as the second service platform 102, includes, for example, the Alibaba Cloud log service platform or a page crawler. The Alibaba Cloud log provides a log service (Log Service) for users to obtain massive front-end address data and corresponding front-end interface data through the log service. The page crawler refers to a tool that can crawl the front-end address data and the front-end interface data on the page. In other words, the interface document management device 103 can obtain the front-end address data and the corresponding front-end interface data through the log service (Log Service) provided by the Alibaba Cloud log service platform by accessing the Alibaba Cloud log service platform, and can also crawl the front-end address data and the corresponding front-end interface data on any web page through the page crawler.
[0038] In one embodiment, the interface document management device 103 allows the user to directly write the front-end address data and the corresponding front-end interface data into the database through the client. It can be understood that the above service platform is only an example, and this application does not limit the method by which the interface document management device 103 obtains the front-end address data and the corresponding front-end interface data.
[0039] The interface document management device 103 is used to execute the interface document management method. The interface document management device 103 can be implemented as all or part of the device through software, hardware or a combination of both. The interface document management device 103 can be implemented through a server or a server cluster. This application does not impose any restrictions on the location or implementation of the interface document management device 103. For a detailed introduction to the interface document management device 103, see Figure 7 The illustrated embodiments are not described in detail here.
[0040] The client 104 accessing the database of the interface document management device can be understood as a terminal device, including but not limited to a mobile station (MS), a mobile terminal, a mobile phone, a handset, and a portable equipment, etc. The terminal device can communicate with one or more core networks via a radio access network (RAN). For example, the terminal device can be a mobile phone (or a "cellular" phone), a computer with a wireless communication function, etc. The terminal device can also be a portable, pocket-sized, handheld, computer-built-in, or vehicle-mounted mobile device or equipment, such as: Figure 1As shown, the terminal device includes electronic devices such as smart phones, computers, and tablet computers, which have the function of storing data. And the client 104 can establish an access request with the interface document management device 103 through the Internet service to access the data in the database of the interface document management device 103. It can be understood that the client 101 that initiates the access request includes one or more, Figure 1 These are examples only.
[0041] This application automatically obtains business data and back-end interface data, as well as front-end address data and front-end interface data, adds associations between the above four types of data to generate interface documents, and saves the interface documents in a database to achieve the improvement and unified preservation of interface data; provides users with a unified interface to access interface documents in the database that include all interface data, reduces the time users spend searching for interface data on major platforms by themselves, and avoids the tedious operation of users encapsulating single interface data.
[0042] In one embodiment, Figure 2 As shown, a flowchart of an interface document management method is proposed, which can be implemented by a computer program and can be run on an interface document management device based on the von Neumann system. The computer program can be integrated into an application or run as an independent tool application.
[0043] Specifically, the interface document management method includes:
[0044] S101. Acquire a plurality of business service data and backend interface data having a corresponding relationship, and acquire a plurality of frontend address data and frontend interface data having a corresponding relationship.
[0045] In one embodiment, the access interface document management device 103 obtains multiple business service data and backend interface data with corresponding relationships through the swagger service platform. Specifically, a first access request is sent to the swagger service platform based on a preset period; the swagger service platform obtains the first target resource data in the swagger server based on the first target resource data pointed to by the first access request, that is, the business service data and backend interface data with corresponding relationships, and sends the first target resource data to the access interface document management device 103.
[0046] In one embodiment, the access interface document management device 103 obtains a plurality of corresponding front-end address data and front-end interface data through the Alibaba Cloud log service platform. Specifically, a second access request is sent to the Alibaba Cloud log service platform based on a preset period; the Alibaba Cloud log service platform obtains the second target resource data, i.e., the corresponding front-end address data and front-end interface data, in the Alibaba Cloud server based on the second target resource data pointed to by the second access request, and sends the second target resource data to the access interface document management device 103.
[0047] The corresponding relationship can be understood as the business service data and the backend interface data having the corresponding relationship carry the same annotation information, wherein various special marks exist in the annotation information, and the frontend address data and the frontend interface data having the corresponding relationship carry the same annotation information, and the annotation information can be represented based on a string. In other words, the access interface document management device 103 determines the corresponding relationship between the business service data and the backend interface data, and the corresponding relationship between the frontend address data and the frontend interface data through the carried annotation information.
[0048] S102. Based on the mapping relationship between the preset front-end address data and the preset business service data, the front-end address data and the business service data having the corresponding relationship are associated with each other to generate an interface document including the business service data, the back-end interface data, the front-end address data and the front-end interface data.
[0049] In one embodiment, the interface document management device 103 obtains the mapping relationship between the preset front-end address data and the preset business service data through a routing table. The routing table (routing table) or the routing information base (RIB) is an electronic spreadsheet (file) or a database-like object stored in a router or a networked computer.
[0050] The routing table includes a mapping relationship between preset front-end address data and preset business service data. For example, the front-end address data is https: / / www.xxxxxx.com / index.html. Based on the routing table, the business service data corresponding to the front-end address data can be found, including search service data and news viewing service data; or, the business service data is search service data. Based on the routing table, the front-end address data corresponding to the business service data can be found to be https: / / www.xxxxxx1.com / index.html and https: / / www.xxxxxx2.com / index.html.
[0051] In one embodiment, when the front-end address data obtained by the interface document management device 103 is in a format other than the specified format in the routing table, the format of the front-end address data is converted into the specified format through the conversion service. For example, the specified format of the front-end address data preset in the routing table is a URL, and the format of the obtained front-end address data is a domain name, and the interface document management device 103 converts the domain name into a URL through the conversion service.
[0052] like Figure 3 As shown, a structural diagram of an interface document provided in an embodiment of the present application includes: first front-end address data 301A, and first front-end interface data 301B corresponding to the first front-end address data 301A, first business service data 302A, and first back-end interface data 302B corresponding to the first business service data 302A, second business service data 303A, and second back-end interface data 303B corresponding to the second business service data 303A, second front-end interface data 304B and second front-end address data 304A.
[0053] The association processing of the business service data and the front-end address data can be understood as adding an association between the business service data and the front-end address data with a corresponding relationship, so that the interface document management device 103 displays the data with a corresponding relationship when the user retrieves the target data. For example, the interface document management device 103 receives a search request from a user, and the content of the search request is the front-end address data: https: / / www.xxxxxx.com / index.html; the interface document management device 103 displays the front-end interface data corresponding to the front-end address data, and the business service data corresponding to the front-end address data, including search service data and news viewing service data, and the back-end interface data corresponding to the business service data through the display device.
[0054] based on Figure 3 In the illustrated embodiment, the steps for the interface document management device 103 to obtain an interface document including front-end address data, front-end interface data, business service data, and back-end interface data having corresponding relationships are as follows:
[0055] The interface document management device 103 determines the correspondence between the first business service data 302A and the first back-end interface data 302B, the correspondence between the second business service data 303A and the second back-end interface data 303B, the correspondence between the first front-end address data 301A and the first front-end interface data 301B, and the correspondence between the second front-end address data 304A and the second front-end interface data 304B through the carried identifier, and performs association processing on the data with corresponding relationships.
[0056] The interface document management device 103 determines the first business service data 302A and the second business service data 303A corresponding to the first front-end address data 301A, and the second business service data 303A corresponding to the second front-end address data 304A through the mapping relationship between the preset front-end address data and the preset business service data included in the routing table, and associates the data with corresponding relationships.
[0057] The beneficial effects brought about by the technical solutions provided in some embodiments of the present application include at least: associating the front-end address data and business service data with corresponding relationships, thereby associating the front-end interface data corresponding to the front-end address data and the back-end interface data corresponding to the business service data, thereby supporting users to search from two dimensions: business service dimension and front-end address dimension, thereby improving the ease of use of interface documents; establishing the association between business service data and front-end address data through a mapping relationship, which simplifies the processing process and occupies less logical resources.
[0058] S103: Save the interface document in the database.
[0059] The interface document is saved in the database of the interface document management device 103 for storage.
[0060] In one embodiment, the interface document management device 103 encapsulates the database into at least one access interface based on at least one information dimension, and the access interface is used to receive an access request to access the interface document according to the access request. The information dimension can be understood as including multiple dimensions such as business service dimension and front-end address service, and one access interface corresponds to a service that generates an interface document based on one information dimension. For example, the first access interface corresponds to a service that generates an interface document of the front-end address dimension. When a user accesses the first access interface through the client 104, the interface document generated based on the front-end address dimension is obtained.
[0061] like Figure 4 The figure is a schematic diagram of an interface document based on the front-end address dimension provided by an embodiment of the present application. The user sends an access request to the interface document management device 103 through the client, and the access request includes obtaining the front-end address data: the data corresponding to Math-parent; the interface document management device 103 allocates and generates an access interface of the interface document based on the front-end address dimension for the access request, thereby displaying the following based on the access request: Figure 4The interface document interface shown, the front-end address data Math-parent corresponding to multiple business service data, including: sending mobile phone number changes, modifying mobile phone numbers and mini-program registration, and the back-end interface data corresponding to the multiple business service data. It can be understood that the interface document management device 103 can also send the interface document to the client, so that the client can display the interface document through the client's display interface.
[0062] exist Figure 4 In the interface document of the front-end address dimension shown, the back-end interface data is written in JSON format, and the business service data is written in the corresponding service content. Among them, JSON is a lightweight data exchange format that uses a text format that is completely independent of the programming language to store and represent data. The concise and clear hierarchical structure makes JSON an ideal data exchange language, which is easy for developers to read and write, and is also easy for machines to parse and generate, and can effectively improve network transmission efficiency. This application does not impose any restrictions on the writing form or presentation form of the back-end interface data and business service data.
[0063] For generating an interface document based on the business service dimension, please refer to the above-mentioned generating an interface document based on the front-end address dimension, which will not be repeated here.
[0064] In another embodiment, the database is encapsulated as at least one access interface based on at least the information dimension, and the access interface also includes an access interface for the user to directly test the interface through the interface document. Specifically, after the user initiates an access request through the client, nginx solves the cross-domain and authentication issues, and returns the access request and a web page showing the interface document, so that the user can directly test the interface through the interface document page on the web page. nginx is a high-performance HTTP and reverse proxy web server, and also provides IMAP / POP3 / SMTP services.
[0065] This application automatically obtains business data and back-end interface data, as well as front-end address data and front-end interface data, adds associations between the above four types of data to generate interface documents, and saves the interface documents in a database to achieve the improvement and unified preservation of interface data; provides users with a unified interface to access interface documents in the database that include all interface data, reduces the time users spend searching for interface data on major platforms by themselves, and avoids the tedious operation of users encapsulating single interface data.
[0066] like Figure 5As shown, it is a flow chart of another interface document management method provided by an embodiment of the present application, which can be implemented by a computer program and can be run on an interface document management device based on the von Neumann system. The computer program can be integrated into an application or run as an independent tool application.
[0067] Specifically, the interface document management method includes:
[0068] S501. Acquire a plurality of business service data and backend interface data having a corresponding relationship, and acquire a plurality of frontend address data and frontend interface data having a corresponding relationship.
[0069] The interface document management device obtains a plurality of business service data and back-end interface data with corresponding relationships, and obtains a plurality of front-end address data and front-end interface data with corresponding relationships. For specific steps, refer to Figure 1 and Figure 2 The step S101 shown is not repeated here.
[0070] S502. Based on the mapping relationship between the preset front-end address data and the preset business service data, the front-end address data and the business service data having the corresponding relationship are associated and processed to generate an interface document including the business service data, the back-end interface data, the front-end address data and the front-end interface data.
[0071] Based on the mapping relationship between the preset front-end address data and the preset business service data, the interface document management device associates the front-end address data and the business service data with corresponding relationships to generate an interface document including business service data, back-end interface data, front-end address data and front-end interface data. For specific steps, see the above Figure 3 Shown and Figure 2 The step S102 shown is not repeated here.
[0072] S503: Structurally process the front-end interface data and the back-end interface data included in the interface document respectively to obtain first structured data corresponding to the front-end interface data and second structured data corresponding to the back-end interface data.
[0073] After adding associations between the business service data, back-end interface data, front-end address data, and front-end interface data having corresponding relationships, the front-end interface data and the back-end interface data are further processed.
[0074] In one embodiment, Figure 6The figure is a flow chart of a structured processing of front-end interface data provided by an embodiment of the present application. The interface document management device filters out the front-end non-target data 602 in the front-end interface data 601 to obtain the front-end target data 603; the front-end target data 603 is segmented to obtain the first structured data 604 corresponding to the front-end interface data.
[0075] Specifically, the steps of structuring the front-end interface data 601 are as follows: based on the annotation information of the front-end interface data, analyze the level where the key information in the front-end interface data 601 is located, where the key information refers to the information of objects such as URL, Header, Params, Host, etc.; after confirming the level, obtain the specific content corresponding to the key information in the name field of the level, and filter out the content of non-name fields, for example, determine that the first level of the front-end interface data 601 is the level corresponding to the key information URL, obtain the specific content of the name field in the level, delete other fields, and obtain the front-end target data 603; segment the obtained target front-end data 603 based on key information such as URL, Header, Params, Host, etc., to obtain the first structured data 604. It can be understood that the front-end interface data 601 can also be filtered and segmented based on other key information such as method, description, response, etc., and the embodiment of the present application is only one possible implementation method.
[0076] The steps of structurally processing the back-end interface data refer to the steps of processing the front-end interface data 601, which will not be repeated here.
[0077] S504: Generate a structured interface document based on the first structured data and the second structured data.
[0078] The first structured data is obtained based on the front-end interface data, the second structured data is obtained based on the back-end interface data, and a structured interface document is generated.
[0079] In one embodiment, the present application generates a corresponding structured interface document based on the Swagger specification using the first structured data and the second structured data. Specifically, the Swagger specification specifies how to correctly describe the structured data obtained based on the interface data. The Swagger specification itself has nothing to do with the programming language, and supports two grammatical styles: YAML grammar and JSON grammar. These two grammatical styles can be converted to each other, and can be used to accurately describe the first structured data and the second structured data, which is convenient for users and machines to read. At present, there are two main Swagger specifications: Swagger 2.0 and OpenAPI 3.0. In Swagger, the document used to describe the interface information is called a Swagger document. The Swagger document refers to a file that complies with the Swagger specification and is used to fully describe the first structured data and the second structured data. There are two types of Swagger documents: yaml files and json files. The yaml file uses the YAML grammatical style; the json file uses the JSON grammatical style. Both files can be used to describe the first structured data and the second structured data, and can be converted to each other. Generally speaking, a Swagger document is an interface document, but a Swagger document is written in a specific syntax. In this embodiment, after obtaining the first structured data and the second structured data, the first structured data and the second structured data are used to generate a structured interface document in YAML format or JSON format with reference to the Swagger specification. With the embodiment of the present application, the structured interface document is more beautiful, which improves the efficiency of users reading and understanding the structured interface document, and improves the accuracy of the description of the front-end interface data and the back-end interface data.
[0080] S505: Save the structured interface document in the database.
[0081] The structured interface document is stored in a database, and the database is encapsulated into at least one access interface based on at least one information dimension, and the access interface is used to receive an access request to access the structured interface document according to the access request. The specific working steps of step S505 are shown in the above Figure 2 The step S103 shown is not repeated here.
[0082] In one embodiment, the interface document management device of the present application updates the interface document based on a preset period. Due to environmental changes, the specific content of the front-end interface data, the back-end interface data, the front-end address data, and the business service data will change. For example, when the internal test version is changed to the official online version, the front-end address data and the front-end interface data will also change accordingly. Specifically, the interface document management device obtains the front-end interface data and the front-end address data based on the preset period, and obtains the back-end interface data and the business service data, and regenerates the interface document based on the above steps and saves it in the database. The preset period can be 24 hours or a week, which is obtained through the modification instructions sent by the client, or the modification instructions are input by users through the controls set on the interface document management device. By adopting the embodiments of the present application, the maintainability and timeliness of the interface document are better, and the accuracy and reliability of the interface document are improved.
[0083] This application automatically obtains business data and back-end interface data, as well as front-end address data and front-end interface data, adds associations between the above four types of data to generate interface documents, and saves the interface documents in a database to achieve the improvement and unified preservation of interface data; provides users with a unified interface to access interface documents in the database that include all interface data, reduces the time users spend searching for interface data on major platforms by themselves, and avoids the tedious operation of users encapsulating single interface data.
[0084] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0085] See also Figure 7 , which shows a schematic diagram of the structure of an interface document management device provided by an exemplary embodiment of the present application. The interface document management device can be implemented as all or part of the device through software, hardware or a combination of both. It can be understood that the interface document management device and Figure 1 The interface document management device 103 shown is the same device. The interface document management device comprises an interface data acquisition module 701, an interface document generation module 702 and an interface document storage module 703.
[0086] The interface data acquisition module 701 is used to acquire a plurality of business service data and backend interface data having a corresponding relationship, and to acquire a plurality of frontend address data and frontend interface data having a corresponding relationship;
[0087] The interface document generation module 702 is used to associate the front-end address data and the business service data having a corresponding relationship based on the mapping relationship between the preset front-end address data and the preset business service data, and generate an interface document including the business service data, the back-end interface data, the front-end address data and the front-end interface data;
[0088] The interface document saving module 703 is used to save the interface document into a database.
[0089] Optionally, the interface document management device further includes:
[0090] The encapsulation module is used to encapsulate the database into at least one access interface based on at least one information dimension, and the access interface is used to receive an access request to access the interface document according to the access request.
[0091] Optionally, the interface document generation module 702 includes:
[0092] A structured processing unit, configured to perform structured processing on the front-end interface data and the back-end interface data included in the interface document, respectively, to obtain first structured data corresponding to the front-end interface data and second structured data corresponding to the back-end interface data;
[0093] A structured document unit, configured to generate a structured interface document based on the first structured data and the second structured data;
[0094] The interface document saving module 703 includes:
[0095] The structured storage unit is used to store the structured interface document in the database.
[0096] Optionally, the structured processing unit includes:
[0097] A first filtering subunit, used for filtering out front-end non-target data in the front-end interface data to obtain front-end target data;
[0098] A first structured subunit, used for segmenting the front-end target data to obtain first structured data corresponding to the front-end interface data;
[0099] A second filtering subunit is used to filter out backend non-target data in the backend interface data to obtain backend target data;
[0100] The second structured sub-unit is used to segment the back-end target data to obtain second structured data corresponding to the back-end interface data.
[0101] Optionally, the interface data acquisition module 701 is further used to acquire the business service data and the backend interface data having a corresponding relationship through a swagger service and / or a WiKi service and / or a Yapi service.
[0102] Optionally, the interface data acquisition module 701 is further configured to acquire a plurality of the front-end address data and the front-end interface data having a corresponding relationship through a log service and / or a page crawling service.
[0103] Optionally, the interface document management device further includes:
[0104] The update module is used to update the interface document based on a preset period.
[0105] It should be noted that the interface document management device provided in the above embodiment only uses the division of the above functional modules as an example when executing the interface document management method. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the interface document management device provided in the above embodiment and the interface document management method embodiment belong to the same concept, and the implementation process thereof is detailed in the method embodiment, which will not be repeated here.
[0106] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0107] This application automatically obtains business data and back-end interface data, as well as front-end address data and front-end interface data, adds associations between the above four types of data to generate interface documents, and saves the interface documents in a database to achieve the improvement and unified preservation of interface data; provides users with a unified interface to access interface documents in the database that include all interface data, reduces the time users spend searching for interface data on major platforms by themselves, and avoids the tedious operation of users encapsulating single interface data.
[0108] The present application also provides a computer storage medium, which can store multiple instructions, and the instructions are suitable for being loaded and executed by a processor as described above. Figure 1-Figure 6 The interface document management method of the embodiment shown in the figure can be found in the specific execution process. Figure 1-Figure 6 The specific description of the illustrated embodiment will not be repeated here.
[0109] The present application also provides a computer program product, which stores at least one instruction, and the at least one instruction is loaded and executed by the processor as described above. Figure 1-Figure 6 The interface document management method of the embodiment shown in the figure can be found in the specific execution process. Figure 1-Figure 6The specific description of the illustrated embodiment will not be repeated here.
[0110] See also Figure 8 , is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 8 As shown, the electronic device 800 may include: at least one processor 801 , at least one network interface 804 , a user interface 803 , a memory 805 , and at least one communication bus 802 .
[0111] The communication bus 802 is used to realize the connection and communication between these components.
[0112] The user interface 803 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 803 may also include a standard wired interface and a wireless interface.
[0113] The network interface 804 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0114] Among them, the processor 801 may include one or more processing cores. The processor 801 uses various interfaces and lines to connect various parts of the entire server 800, and executes various functions and processes data of the server 800 by running or executing instructions, programs, code sets or instruction sets stored in the memory 805, and calling data stored in the memory 805. Optionally, the processor 801 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 801 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 801, and it can be implemented separately through a chip.
[0115] Among them, the memory 805 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 805 includes a non-transitory computer-readable storage medium. The memory 805 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 805 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned method embodiments, etc.; the data storage area may store data involved in the above-mentioned method embodiments, etc. The memory 805 may optionally be at least one storage device located away from the aforementioned processor 801. As Figure 8 As shown, the memory 805 as a computer storage medium may include an operating system, a network communication module, a user interface module, and an interface document management application.
[0116] exist Figure 8 In the electronic device 800 shown, the user interface 803 is mainly used to provide an input interface for the user and obtain data input by the user; and the processor 801 can be used to call the interface document management application stored in the memory 805 and specifically perform the following operations:
[0117] Acquire multiple business service data and backend interface data with corresponding relationships, and acquire multiple frontend address data and frontend interface data with corresponding relationships;
[0118] Based on the mapping relationship between the preset front-end address data and the preset business service data, the front-end address data and the business service data having a corresponding relationship are associated with each other to generate an interface document including the business service data, the back-end interface data, the front-end address data and the front-end interface data;
[0119] The interface document is saved in a database.
[0120] In one embodiment, after the processor 801 executes the step of saving the interface document into the database, it further executes the following steps:
[0121] The database is encapsulated as at least one access interface based on at least one information dimension, and the access interface is used to receive an access request to access the interface document according to the access request.
[0122] In one embodiment, the processor 801 executes the mapping relationship based on the preset front-end address data and the preset business service data, associates the front-end address data and the business service data having a corresponding relationship, generates an interface document including the business service data, the back-end interface data, the front-end address data and the front-end interface data, and specifically performs the following operations:
[0123] The front-end interface data and the back-end interface data included in the interface document are respectively structured to obtain first structured data corresponding to the front-end interface data and second structured data corresponding to the back-end interface data;
[0124] Generate a structured interface document based on the first structured data and the second structured data;
[0125] The processor 801 saves the interface document into a database by specifically performing the following steps:
[0126] The structured interface document is stored in the database.
[0127] In one embodiment, the processor 801 performs the structured processing of the front-end interface data and the back-end interface data included in the interface document, respectively, to obtain first structured data corresponding to the front-end interface data and second structured data corresponding to the back-end interface data, specifically performing the following steps:
[0128] Filtering out front-end non-target data in the front-end interface data to obtain front-end target data;
[0129] Segmenting the front-end target data to obtain first structured data corresponding to the front-end interface data;
[0130] Filtering out backend non-target data in the backend interface data to obtain backend target data;
[0131] The backend target data is segmented to obtain second structured data corresponding to the backend interface data.
[0132] In one embodiment, the processor 801 executes the acquisition of a plurality of business service data and backend interface data having a corresponding relationship by specifically performing the following steps:
[0133] Through the swagger service and / or the WiKi service and / or the Yapi service, a plurality of the business service data and the backend interface data having corresponding relationships are obtained.
[0134] In one embodiment, the processor 801 executes the acquisition of the plurality of front-end address data and front-end interface data having a corresponding relationship by specifically performing the following steps:
[0135] A plurality of the front-end address data and the front-end interface data having corresponding relationships are obtained through the log service and / or the page crawling service.
[0136] In one embodiment, the processor 801 further performs the following steps:
[0137] Update the interface documentation based on a preset period.
[0138] This application automatically obtains business data and back-end interface data, as well as front-end address data and front-end interface data, adds associations between the above four types of data to generate interface documents, and saves the interface documents in a database to achieve the improvement and unified preservation of interface data; provides users with a unified interface to access interface documents in the database that include all interface data, reduces the time users spend searching for interface data on major platforms by themselves, and avoids the tedious operation of users encapsulating single interface data.
[0139] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only storage memory, or a random access memory, etc.
[0140] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. An interface document management method, characterized in that: The method comprises: Acquire multiple business service data and backend interface data with corresponding relationships, and acquire multiple frontend address data and frontend interface data with corresponding relationships; Based on the mapping relationship between the preset front-end address data and the preset business service data, the front-end address data and the business service data having a corresponding relationship are associated with each other to generate an interface document including the business service data, the back-end interface data, the front-end address data and the front-end interface data; Saving the interface document in a database; Wherein, based on the mapping relationship between the preset front-end address data and the preset business service data, the front-end address data and the business service data having a corresponding relationship are associated with each other to generate an interface document including the business service data, the back-end interface data, the front-end address data and the front-end interface data, including: Determine the correspondence between the first business service data and the first backend interface data, the correspondence between the second business service data and the second backend interface data, the correspondence between the first front-end address data and the first front-end interface data, and the correspondence between the second front-end address data and the second front-end interface data through the carried identifier, and perform association processing on the data with the correspondence; Through the mapping relationship between the preset front-end address data and the preset business service data included in the routing table, the first business service data and the second business service data corresponding to the first front-end address data, and the second business service data corresponding to the second front-end address data are determined, and the data with corresponding relationship are associated and processed.
2. The method according to claim 1, characterized in that: After the interface document is saved in the database, the method further includes: The database is encapsulated as at least one access interface based on at least one information dimension, and the access interface is used to receive an access request to access the interface document according to the access request.
3. The method according to claim 1, characterized in that: Based on the mapping relationship between the preset front-end address data and the preset business service data, the front-end address data and the business service data having a corresponding relationship are associated with each other to generate an interface document including the business service data, the back-end interface data, the front-end address data and the front-end interface data, including: The front-end interface data and the back-end interface data included in the interface document are respectively structured to obtain first structured data corresponding to the front-end interface data and second structured data corresponding to the back-end interface data; Generate a structured interface document based on the first structured data and the second structured data; The step of saving the interface document into a database comprises: The structured interface document is stored in the database.
4. The method according to claim 3, characterized in that: The step of respectively performing structured processing on the front-end interface data and the back-end interface data included in the interface document to obtain first structured data corresponding to the front-end interface data and second structured data corresponding to the back-end interface data includes: Filtering out front-end non-target data in the front-end interface data to obtain front-end target data; Segmenting the front-end target data to obtain first structured data corresponding to the front-end interface data; Filtering out backend non-target data in the backend interface data to obtain backend target data; The backend target data is segmented to obtain second structured data corresponding to the backend interface data.
5. The method according to claim 1, characterized in that: The acquiring of a plurality of business service data and backend interface data having a corresponding relationship includes: Through the swagger service and / or the WiKi service and / or the Yapi service, a plurality of the business service data and the backend interface data having corresponding relationships are obtained.
6. The method according to claim 1, characterized in that: The obtaining of a plurality of front-end address data and front-end interface data having a corresponding relationship comprises: A plurality of the front-end address data and the front-end interface data having corresponding relationships are obtained through the log service and / or the page crawling service.
7. The method according to claim 1, characterized in that: The method further comprises: Update the interface documentation based on a preset period.
8. An interface document management device, characterized in that: The device comprises: The interface data acquisition module is used to acquire a plurality of business service data and back-end interface data having corresponding relationships, and to acquire a plurality of front-end address data and front-end interface data having corresponding relationships; An interface document generation module is used to associate the front-end address data and the business service data having a corresponding relationship based on a mapping relationship between the preset front-end address data and the preset business service data, and generate an interface document including the business service data, the back-end interface data, the front-end address data and the front-end interface data; A module for saving interface documents, used for saving the interface documents into a database; The interface document generation module is specifically used for: Determine the correspondence between the first business service data and the first backend interface data, the correspondence between the second business service data and the second backend interface data, the correspondence between the first front-end address data and the first front-end interface data, and the correspondence between the second front-end address data and the second front-end interface data through the carried identifier, and perform association processing on the data with the correspondence; Through the mapping relationship between the preset front-end address data and the preset business service data included in the routing table, the first business service data and the second business service data corresponding to the first front-end address data, and the second business service data corresponding to the second front-end address data are determined, and the data with corresponding relationship are associated and processed.
9. A computer storage medium, characterized in that: The computer storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the method steps as claimed in any one of claims 1 to 7.
10. An electronic device, characterized in that: include: A processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the method steps as claimed in any one of claims 1 to 7.
