CN113778423B - Interface document generation method and system - Google Patents

Interface document generation method and system Download PDF

Info

Publication number
CN113778423B
CN113778423B CN202111062536.2A CN202111062536A CN113778423B CN 113778423 B CN113778423 B CN 113778423B CN 202111062536 A CN202111062536 A CN 202111062536A CN 113778423 B CN113778423 B CN 113778423B
Authority
CN
China
Prior art keywords
data
interface
interface document
preset
application
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111062536.2A
Other languages
Chinese (zh)
Other versions
CN113778423A (en
Inventor
沈煜超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Hode Information Technology Co Ltd
Original Assignee
Shanghai Hode Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Hode Information Technology Co Ltd filed Critical Shanghai Hode Information Technology Co Ltd
Priority to CN202111062536.2A priority Critical patent/CN113778423B/en
Publication of CN113778423A publication Critical patent/CN113778423A/en
Application granted granted Critical
Publication of CN113778423B publication Critical patent/CN113778423B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/36Software reuse
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Library & Information Science (AREA)
  • User Interface Of Digital Computer (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses an interface document generation method, which comprises the following steps: acquiring application information and all interface paths under the application; reading log data of a corresponding interface according to the application information and the interface path; performing data conversion on the log data according to a preset rule to obtain interface document data; and displaying the interface document data to a user. The application also discloses an interface document generation system, an electronic device and a computer readable storage medium. Therefore, the cost and the error of human intervention can be reduced, the interface document can be continuously updated, and the stable timeliness and reliability are ensured.

Description

Interface document generation method and system
Technical Field
The present disclosure relates to the field of data processing technologies, and in particular, to an interface document generating method, an interface document generating system, an electronic device, and a computer readable storage medium.
Background
Swagger is currently commonly used in generating interface documents. Swagger is a canonical and complete framework for generating, describing, invoking, and visualizing RESTful-style Web services. The goal of Swagger is to define a standard and language independent interface to REST APIs that allows people and computers to have the ability to discover and understand services without having to access source code, documents, or network traffic monitoring. When properly defined by Swagger, the user can understand the remote service and interact with the remote service with minimal implementation logic. Similar to the interface implemented for the underlying programming, swagger eliminates the guesses that may be made when invoking the service. In colloquial terms, swagger is a service that exposes all (wanted to be exposed) interfaces in an item on a page, and can make interface calls and tests.
However, swagger needs to define the interface and the information related to the interface according to the specification, and then generates interface documents in various formats through a series of derived projects and tools. Because the prior art such as Swagger needs to write annotations to generate the corresponding interface document, human intervention is needed in the process, time and labor are wasted, and mistakes are easy to make in writing.
It should be noted that the foregoing is not intended to limit the scope of the application.
Disclosure of Invention
The main objective of the present application is to provide a method, a system, an electronic device and a computer readable storage medium for generating an interface document, which aim to solve the problem of how to automatically and quickly generate the interface document.
To achieve the above object, an embodiment of the present application provides an interface document generating method, including:
acquiring application information and all interface paths under the application;
reading log data of a corresponding interface according to the application information and the interface path;
performing data conversion on the log data according to a preset rule to obtain interface document data;
and displaying the interface document data to a user.
Optionally, the acquiring the application information and all interface paths under the application includes:
the timing task platform triggers the synchronous task at regular time, updates the service tree information and obtains the latest application information;
acquiring the IP address and port information of a corresponding service container in a release platform through the application number in the application information;
and acquiring all interface paths under the corresponding application from the BM interface according to the IP address and the port information.
Optionally, the obtaining log data of the corresponding interface according to the application information and the interface path includes:
and accessing a data management engine according to the application information and the interface path, obtaining log data of a corresponding interface from the data management engine, and storing the log data in a database in a lasting manner.
Optionally, the data conversion of the log data according to a preset rule to obtain interface document data includes:
acquiring full log data;
screening the total log data according to preset screening conditions, and aggregating according to preset dimensions;
and carrying out format conversion on the aggregated data according to a preset data format to obtain the interface document data.
Optionally, the screening the total log data according to a preset screening condition, and aggregating according to a preset dimension includes:
performing first-round screening on the full log data according to the interface path to obtain first screening data;
aggregating the first screening data according to the domain name and the interface path to obtain first aggregate data;
and carrying out second-round screening on the first aggregation data according to the service special cases to obtain second aggregation data.
Optionally, the performing format conversion on the aggregated data according to a preset data format includes:
selecting one piece of data from each group of the aggregated data;
and converting the selected piece of data into a new data structure body according to the preset key value pair to obtain corresponding interface document data.
Optionally, the method further comprises, before converting the selected piece of data into the new data structure according to the preset key value pair:
and supplementing a preset special identification field for the selected piece of data.
In addition, to achieve the above object, an embodiment of the present application further provides an interface document generating system, including:
the acquisition module is used for acquiring application information and all interface paths under the application;
the reading module is used for reading log data of the corresponding interface according to the application information and the interface path;
the conversion module is used for carrying out data conversion on the log data according to preset rules to obtain interface document data;
and the display module is used for displaying the interface document data to a user.
To achieve the above object, an embodiment of the present application further provides an electronic device, including: the interface document generation system comprises a memory, a processor and an interface document generation program stored in the memory and capable of running on the processor, wherein the interface document generation program realizes the interface document generation method when being executed by the processor.
To achieve the above object, embodiments of the present application further provide a computer-readable storage medium having stored thereon an interface document generation program that, when executed by a processor, implements an interface document generation method as described above.
According to the interface document generation method, the system, the electronic device and the computer readable storage medium, log data of an interface corresponding to an application service can be acquired at fixed time, then the log data is automatically converted into a specific interface document format according to the preset rule, and the specific interface document format is automatically imported into an interface management platform for display and viewing by a user, so that the cost and the error of human intervention are reduced, the interface document can be continuously updated, and stable timeliness and reliability are ensured.
Drawings
FIG. 1 is a diagram of an application environment architecture for implementing various embodiments of the present application;
FIG. 2 is a schematic diagram of a functional component structure of the server in FIG. 1;
FIG. 3 is a flowchart of an interface document generating method according to a first embodiment of the present application;
FIG. 4 is a schematic diagram of a refinement flow chart of step S200 in FIG. 3;
FIG. 5 is a schematic diagram of a refinement process of step S204 in FIG. 3;
FIG. 6 is a schematic flow chart of another form of the first embodiment;
fig. 7 is a schematic hardware architecture of an electronic device according to a second embodiment of the present application;
fig. 8 is a schematic block diagram of an interface document generating system according to a third embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
It should be noted that the descriptions of "first," "second," etc. in the embodiments of the present application are for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In addition, the technical solutions of the embodiments may be combined with each other, but it is necessary to base that the technical solutions can be realized by those skilled in the art, and when the technical solutions are contradictory or cannot be realized, the combination of the technical solutions should be regarded as not exist and not within the protection scope of the present application.
Referring to fig. 1, fig. 1 is a schematic diagram of an application environment for implementing various embodiments of the present application. The application is applicable to application environments including, but not limited to, client 2, server 4, and network 6.
The client side 2 is used for displaying an interface of a current application, displaying an interface document and the like to a user. The client 2 may be a terminal device such as a PC (Personal Computer ), a mobile phone, a tablet computer, a portable computer, or a wearable device.
The server 4 is configured to provide data and technical support for the client 2. For example, the server 4 obtains the log data of the corresponding interface according to the application information and the interface path, performs data conversion on the log data to obtain interface document data, and then sends the interface document data to the client 2 for display to the user. The server 4 may be a rack server, a blade server, a tower server, or a cabinet server, and may be an independent server or a server cluster formed by a plurality of servers.
The network 6 may be a wireless or wired network such as an Intranet (Intranet), the Internet (Internet), a global system for mobile communications (Global System of Mobile communication, GSM), wideband code division multiple access (Wideband Code Division Multiple Access, WCDMA), a 4G network, a 5G network, bluetooth (Bluetooth), wi-Fi, etc. The server 4 and one or more clients 2 are in communication connection through the network 6 for data transmission and interaction.
In addition, as shown in fig. 2, a functional component structure of the server 4 is schematically shown. In fig. 2, the timing task platform is used for periodically triggering tasks to ensure the validity of data. The service Tree (Tree) platform is used for providing association relations among various applications and other information. A service container (container) is a container in which individual applications are deployed. The publishing platform (master) is mainly used for providing various information of the query service container. The BM interface is used to provide the ability to query all interface information under the corresponding application. The permission checking function is used for controlling the permission of each component platform and guaranteeing the security of the system. The log component is used to output application logs of a specific format to a data management engine (ES for short). The databases include a remote dictionary service database (Redis) and Mongodb (a database based on distributed file storage). The Redis provides a queue function and is mainly used for transmitting information. Mongodb provides persistent storage for data queries.
The BAPI (Business Application Programming Interface, a set of program interfaces in the object-oriented programming method) server is used for obtaining log data from the ES, persisting the log data to a database, converting the data to obtain interface document data, and then sending the interface document data to the BAPI client (client 2) for display to a user.
Example 1
As shown in fig. 3, a flowchart of a method for generating an interface document according to a first embodiment of the present application is shown. It will be appreciated that the flow charts in the method embodiments are not intended to limit the order in which the steps are performed. Some of the steps in the flow chart may be added or subtracted as desired. The method will be described below with the server 4 as the execution subject.
The method comprises the following steps:
s200, acquiring application information and all interface paths under the application.
Specifically, referring further to fig. 4, a schematic diagram of the refinement process of step S200 is shown. It will be appreciated that the flowchart is not intended to limit the order in which the steps are performed. Some of the steps in the flow chart may be added or subtracted as desired. In this embodiment, the step S200 specifically includes:
and S2000, the timing task platform triggers the synchronous task at regular time, updates the service tree information and obtains the latest application information.
The timing task platform is used for triggering tasks regularly and guaranteeing the effectiveness of data. The service tree platform is used for providing association relation among various applications and other information. When the interface document of the application service needs to be generated, the timing task platform triggers the synchronous task at regular time (for example, every day) and updates the information of each application in the service tree platform, so that the latest application information can be obtained from the service tree platform. The application information includes at least an application number (ID).
Optionally, at this time, it is further required to verify whether the format of the application ID is correct, if so, the next step is entered, otherwise, the process ends.
S2002, acquiring IP address and Port (Port) information of the service container in the release platform through the application number in the application information.
A service container (container) is a container in which individual applications are deployed. The publishing platform (master) is mainly used for providing various information of the query service container. After the application ID is obtained, the IP address and Port information of the corresponding service container can be obtained from the release platform according to the application ID.
And S2004, acquiring all interface paths under the corresponding application from the BM interface according to the IP address and the port information.
The BM interface provides the ability to query all interfaces under the corresponding application. And according to the acquired IP address and Port information, all interface paths under the corresponding application can be inquired from the BM interface. And firstly, acquiring a corresponding Application (APP) service node according to the IP address and the Port information, and then inquiring the interface path in the APP service node.
It should be noted that in this embodiment, each step further includes a permission checking function, which controls permissions of each component platform, so as to ensure security of the system. The specific permission verification method can adopt the existing feasible method, and is not described herein.
Returning to fig. 3, S202 reads log data of the corresponding interface according to the application information and the interface path.
The log component may output an application log in a particular format to the ES. After the application information and the interface path are acquired, the ES can be accessed according to the application information and the interface path, and log data of a corresponding interface can be obtained from the ES. The log data is stored in Json.
After the log data is obtained, the log data is parsed and is stored in a persistent manner, that is, written into a database.
S204, carrying out data conversion on the log data according to preset rules to obtain interface document data.
Specifically, referring further to fig. 5, a schematic diagram of the refinement process of step S204 is shown. It will be appreciated that the flowchart is not intended to limit the order in which the steps are performed. Some of the steps in the flow chart may be added or subtracted as desired. In this embodiment, the step S204 specifically includes:
s2040, obtaining the full log data.
The log data read in the previous step is parsed and stored in a database in a persistent manner, and the total log data can be obtained from the database.
S2042, screening the total log data according to preset screening conditions, and aggregating according to preset dimensions.
For example, the steps may specifically include:
(1) And performing first-round screening on the full log data according to the interface path to obtain first screening data.
(2) And aggregating the first screening data according to the domain name and the interface path to obtain first aggregate data. That is, the first screening data of the same domain name and interface path are aggregated into one packet, and the structure of each group of data is the same, and the corresponding values may be different.
(3) And carrying out second-round screening on the first aggregation data according to the service special cases to obtain second aggregation data.
Since the data format of some special business scenarios (business special cases) may not support such data conversion, after the first round of screening and aggregation, the data corresponding to these business special cases are also removed through the second round of screening.
In other embodiments, the preset screening conditions and the preset dimensions may be set in a user-defined manner according to a specific application scenario, which is not described herein.
S2044, carrying out format conversion on the aggregated data according to a preset data format to obtain the interface document data.
After the aggregation in the previous step, the data of the same domain name and interface path are aggregated into a group, one piece of data is selected from each group of aggregated data (second aggregated data), and the selected one piece of data is converted into a new data structure body according to a preset key value pair, so that the corresponding interface document data can be obtained.
The selection of one piece of data can select the data obtained by aggregation through the obtained state code of the return result, so that the correct data of the return result is ensured to be obtained. Specifically, when the full log data is acquired in step S2040, a status code is provided for each piece of data returned after the request of the data, so as to indicate whether the status of the piece of data is normal. For example, assume that the acquisition of a certain piece of data fails due to poor network, and the status code of the returned result of the piece of data is an error. Therefore, when selecting one piece of data from each group of the aggregated data (second aggregated data), it is necessary to select the data according to the status code in the returned result, that is, to select one piece of data from the data whose status code is correct.
Preferably, a piece of data selected is supplemented with a number of preset special identification fields, and then a new data structure body of the key value pair is formed, so that corresponding interface document data is obtained. The special identification field generally refers to a field which is not in the piece of data, but is necessarily needed when the special identification field is imported into the interface document data of the BAPI, for example, a field for setting environments, configurations, and the like, and can be null.
Returning to FIG. 3, S206, the interface document data is presented to the user.
After the interface document data is obtained through data conversion, the interface document data is sent to a client (leading-in BAPI), and the interface document data can be displayed to a user in the client.
According to the interface document generation method, log data of a corresponding interface can be acquired regularly through the service tree platform, the BM framework and the ES system, then the log data is automatically converted into a specific interface document format according to preset rules, and the specific interface document format is automatically imported into the interface management platform (BAPI) for display to a user for viewing, so that the cost and the error of human intervention are reduced, the interface document can be continuously updated, and stable timeliness and reliability are ensured.
As shown in fig. 6, a flow chart of another form of the first embodiment is shown. In fig. 6, the latest application information (application ID) is obtained by updating the information of the service Tree platform (Tree), and it is verified whether the format of the application ID is correct, if so, the next step is executed, otherwise, the flow ends. And acquiring the IP address and Port information of the service container through the application ID at a release platform (Master). And acquiring a corresponding APP service node according to the IP address and the Port information, and then inquiring the interface path in the APP service node. And the BAPI Server (BAPI-Server) reads the log data of the corresponding interface from the ES according to the application information and the interface path, then analyzes the log data and performs persistent storage, namely writing the log data into a database. And then carrying out data conversion on the log data according to a preset rule to obtain interface document data. And finally, sending the interface document data to a BAPI Client (BAPI-Client), importing the BAPI, and displaying the BAPI for a user to view.
Through cooperation among the service tree platform, the release platform, the BM framework, the ES, the BAPI server and the BAPI client, log data of an interface corresponding to the application service can be automatically obtained, then the log data is automatically converted into a specific interface document format, and the log data is automatically imported into an interface management platform (BAPI) for display to a user for viewing, so that the cost and the error of human intervention are reduced, the interface document can be continuously updated, and the stable timeliness and reliability are ensured.
Example two
As shown in fig. 7, a hardware architecture diagram of an electronic device 20 according to a second embodiment of the present application is provided. In this embodiment, the electronic device 20 may include, but is not limited to, a memory 21, a processor 22, and a network interface 23, which may be communicatively connected to each other through a system bus. It should be noted that fig. 7 only shows an electronic device 20 having components 21-23, but it should be understood that not all of the illustrated components are required to be implemented and that more or fewer components may alternatively be implemented. In this embodiment, the electronic device 20 may be the server 4.
The memory 21 includes at least one type of readable storage medium including flash memory, hard disk, multimedia card, card memory (e.g., SD or DX memory, etc.), random Access Memory (RAM), static Random Access Memory (SRAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), programmable Read Only Memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the storage 21 may be an internal storage unit of the electronic device 20, such as a hard disk or a memory of the electronic device 20. In other embodiments, the memory 21 may also be an external storage device of the electronic apparatus 20, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the electronic apparatus 20. Of course, the memory 21 may also include both an internal memory unit and an external memory device of the electronic apparatus 20. In this embodiment, the memory 21 is typically used to store an operating system and various application software installed on the electronic device 20, such as program codes of the interface document generation system 60. Further, the memory 21 may be used to temporarily store various types of data that have been output or are to be output.
The processor 22 may be a central processing unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments. The processor 22 is generally used to control the overall operation of the electronic device 20. In this embodiment, the processor 22 is configured to execute the program code or process data stored in the memory 21, for example, to execute the interface document generation system 60 or the like.
The network interface 23 may comprise a wireless network interface or a wired network interface, which network interface 23 is typically used for establishing a communication connection between the electronic apparatus 20 and other electronic devices.
Example III
As shown in fig. 8, a block diagram of an interface document generation system 60 is provided in accordance with a third embodiment of the present application. The interface document generation system 60 may be partitioned into one or more program modules that are stored in a storage medium and executed by one or more processors to perform the embodiments of the present application. Program modules in the embodiments of the present application refer to a series of computer program instruction segments capable of implementing specific functions, and the following description specifically describes the functions of each program module in the embodiments.
In this embodiment, the interface document generation system 60 includes:
the acquiring module 600 is configured to acquire application information and all interface paths under the application.
Specifically, the process of the obtaining module 600 obtaining the application information and the interface path includes:
(1) And the timing task platform triggers the synchronous task at fixed time, updates the service tree information and obtains the latest application information.
The timing task platform is used for triggering tasks regularly and guaranteeing the effectiveness of data. The service tree platform is used for providing association relation among various applications and other information. When the interface document of the application service needs to be generated, the timing task platform triggers the synchronous task at regular time (for example, every day) and updates the information of each application in the service tree platform, so that the latest application information can be obtained from the service tree platform. The application information at least comprises an application ID.
(2) And acquiring the IP address and Port information of the service container in the release platform through the application ID in the application information.
A service container (container) is a container in which individual applications are deployed. The publishing platform (master) is mainly used for providing various information of the query service container. After the application ID is obtained, the IP address and Port information of the corresponding service container can be obtained from the release platform according to the application ID.
(3) And acquiring all interface paths under the corresponding application from the BM interface according to the IP address and the Port information.
The BM interface provides the ability to query all interfaces under the corresponding application. And according to the acquired IP address and Port information, all interface paths under the corresponding application can be inquired from the BM interface. And firstly, acquiring a corresponding Application (APP) service node according to the IP address and the Port information, and then inquiring the interface path in the APP service node.
It should be noted that in this embodiment, the above process further includes a permission checking function, which controls permissions of each component platform, so as to ensure security of the system. The specific permission verification method can adopt the existing feasible method, and is not described herein.
And the reading module 602 is configured to read log data of a corresponding interface according to the application information and the interface path.
The log component may output an application log in a particular format to the ES. After the application information and the interface path are acquired, the ES can be accessed according to the application information and the interface path, and log data of a corresponding interface can be obtained from the ES. The log data is stored in Json.
After the log data is obtained, the log data is parsed and is stored in a persistent manner, that is, written into a database.
And the conversion module 604 is configured to perform data conversion on the log data according to a preset rule, so as to obtain interface document data.
Specifically, the process of the conversion module 604 for performing data conversion includes:
(1) And acquiring the total log data.
The log data read by the reading module 602 is parsed and persisted in a database from which the full amount of log data may be obtained.
(2) And screening the total log data according to preset screening conditions, and aggregating according to preset dimensions.
For example, the process may specifically include:
performing first-round screening on the full log data according to the interface path to obtain first screening data;
aggregating the first screening data according to the domain name and the interface path to obtain first aggregate data;
and carrying out second-round screening on the first aggregation data according to the service special cases to obtain second aggregation data.
In other embodiments, the preset screening conditions and the preset dimensions may be set in a user-defined manner according to a specific application scenario, which is not described herein.
(3) And carrying out format conversion on the aggregated data according to a preset data format to obtain the interface document data.
After the aggregation, the data with the same domain name and interface path are aggregated into a group, one piece of data is selected from each group of aggregated data (second aggregated data), and the selected piece of data is converted into a new data structure body according to a preset key value pair, so that corresponding interface document data can be obtained.
The selection of one piece of data can select the data obtained by aggregation through the obtained state code of the return result, so that the correct data of the return result is ensured to be obtained. Specifically, when the full log data is obtained, each piece of data returned after the data is requested has a status code to indicate whether the status of the piece of data is normal. For example, assume that the acquisition of a certain piece of data fails due to poor network, and the status code of the returned result of the piece of data is an error. Therefore, when selecting one piece of data from each group of the aggregated data (second aggregated data), it is necessary to select the data according to the status code in the returned result, that is, to select one piece of data from the data whose status code is correct.
Preferably, a piece of data selected is supplemented with a number of preset special identification fields, and then a new data structure body of the key value pair is formed, so that corresponding interface document data is obtained. The special identification field generally refers to a field which is not in the piece of data, but is necessarily needed when the special identification field is imported into the interface document data of the BAPI, for example, a field for setting environments, configurations, and the like, and can be null.
And a display module 606, configured to display the interface document data to a user.
After the interface document data is obtained through data conversion, the interface document data is sent to a client (leading-in BAPI), and the interface document data can be displayed to a user in the client.
According to the interface document generation system provided by the embodiment, log data of a corresponding interface can be acquired at regular time through the service tree platform, the BM framework and the ES system, then the log data is automatically converted into a specific interface document format according to the preset rule, and the specific interface document format is automatically imported into the interface management platform (BAPI) for display and viewing by a user, so that the cost and the error of human intervention are reduced, the interface document can be continuously updated, and the stable timeliness and reliability are ensured.
Example IV
The present application also provides another embodiment, namely, a computer-readable storage medium storing an interface document generation program executable by at least one processor to cause the at least one processor to perform the steps of the interface document generation method as described above.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing embodiment numbers of the present application are merely for describing, and do not represent advantages or disadvantages of the embodiments.
It will be apparent to those skilled in the art that the modules or steps of the embodiments of the application described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may alternatively be implemented in program code executable by computing devices, so that they may be stored in a storage device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than what is shown or described, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps of them may be fabricated into a single integrated circuit module. Thus, embodiments of the present application are not limited to any specific combination of hardware and software.
The foregoing is only the preferred embodiments of the present application, and is not intended to limit the scope of the embodiments of the present application, and all equivalent structures or equivalent processes using the descriptions of the embodiments of the present application and the contents of the drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the embodiments of the present application.

Claims (9)

1. A method of generating an interface document, the method comprising:
acquiring application information and all interface paths under the application;
reading log data of a corresponding interface according to the application information and the interface path;
performing data conversion on the log data according to a preset rule to obtain interface document data, wherein the data conversion comprises the following steps: acquiring full log data; screening the total log data according to preset screening conditions, and aggregating according to preset dimensions; converting the format of the aggregated data according to a preset data format to obtain the interface document data;
and displaying the interface document data to a user.
2. The method for generating an interface document according to claim 1, wherein the step of acquiring the application information and applying all the interface paths under the application comprises:
the timing task platform triggers the synchronous task at regular time, updates the service tree information and obtains the latest application information;
acquiring the IP address and port information of a corresponding service container in a release platform through the application number in the application information;
and acquiring all interface paths under the corresponding application from the BM interface according to the IP address and the port information.
3. The interface document generation method according to claim 1 or 2, wherein the acquiring log data of a corresponding interface according to the application information and the interface path includes:
and accessing a data management engine according to the application information and the interface path, obtaining log data of a corresponding interface from the data management engine, and storing the log data in a database in a lasting manner.
4. The method of claim 1, wherein the filtering the full log data according to a preset filtering condition and aggregating according to a preset dimension comprises:
performing first-round screening on the full log data according to the interface path to obtain first screening data;
aggregating the first screening data according to the domain name and the interface path to obtain first aggregate data;
and performing second-round screening on the first aggregate data according to the service special cases to obtain second aggregate data, wherein the service special cases are service scenes which do not support format conversion of the preset data format, and the second-round screening is to reject data corresponding to the service special cases.
5. The interface document generating method according to claim 1 or 4, wherein the format converting the aggregated data according to a preset data format comprises:
selecting one piece of data from each group of the aggregated data;
and converting the selected piece of data into a new data structure body according to the preset key value pair to obtain corresponding interface document data.
6. The interface document generation method according to claim 5, further comprising, before converting the selected piece of data into a new data structure according to a preset key value pair:
and supplementing a preset special identification field for the selected piece of data, wherein the special identification field is a field which is not in the piece of data but is necessary in the interface document data, and comprises a setting field for environment and configuration.
7. An interface document generation system, the system comprising:
the acquisition module is used for acquiring application information and all interface paths under the application;
the reading module is used for reading log data of the corresponding interface according to the application information and the interface path;
the conversion module is used for carrying out data conversion on the log data according to a preset rule to obtain interface document data, and comprises the following steps: acquiring full log data; screening the total log data according to preset screening conditions, and aggregating according to preset dimensions; converting the format of the aggregated data according to a preset data format to obtain the interface document data;
and the display module is used for displaying the interface document data to a user.
8. An electronic device, the electronic device comprising: a memory, a processor, and an interface document generation program stored on the memory and executable on the processor, which when executed by the processor, implements the interface document generation method of any one of claims 1 to 6.
9. A computer-readable storage medium, having stored thereon an interface document generation program which, when executed by a processor, implements the interface document generation method of any one of claims 1 to 6.
CN202111062536.2A 2021-09-10 2021-09-10 Interface document generation method and system Active CN113778423B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111062536.2A CN113778423B (en) 2021-09-10 2021-09-10 Interface document generation method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111062536.2A CN113778423B (en) 2021-09-10 2021-09-10 Interface document generation method and system

Publications (2)

Publication Number Publication Date
CN113778423A CN113778423A (en) 2021-12-10
CN113778423B true CN113778423B (en) 2024-03-01

Family

ID=78842481

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111062536.2A Active CN113778423B (en) 2021-09-10 2021-09-10 Interface document generation method and system

Country Status (1)

Country Link
CN (1) CN113778423B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111796809A (en) * 2020-06-29 2020-10-20 平安普惠企业管理有限公司 Interface document generation method and device, electronic equipment and medium
WO2020253082A1 (en) * 2019-06-18 2020-12-24 平安科技(深圳)有限公司 Method, apparatus and device for processing svn log file, and storage medium
CN112148356A (en) * 2019-06-28 2020-12-29 腾讯科技(深圳)有限公司 Document generation method, interface development method, device, server and storage medium
CN112199331A (en) * 2020-10-09 2021-01-08 平安科技(深圳)有限公司 Automatic generation method, system, terminal and storage medium of interface document
CN112583891A (en) * 2020-11-19 2021-03-30 联通智网科技有限公司 Interface document acquisition method and device and server
CN112650533A (en) * 2020-12-22 2021-04-13 深圳前海微众银行股份有限公司 Interface document generation method and device and terminal equipment
CN112835810A (en) * 2021-03-30 2021-05-25 中国工商银行股份有限公司 Interface testing method and device based on log analysis

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110865867B (en) * 2015-12-21 2023-08-25 华为云计算技术有限公司 Method, device and system for discovering application topological relation

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020253082A1 (en) * 2019-06-18 2020-12-24 平安科技(深圳)有限公司 Method, apparatus and device for processing svn log file, and storage medium
CN112148356A (en) * 2019-06-28 2020-12-29 腾讯科技(深圳)有限公司 Document generation method, interface development method, device, server and storage medium
CN111796809A (en) * 2020-06-29 2020-10-20 平安普惠企业管理有限公司 Interface document generation method and device, electronic equipment and medium
CN112199331A (en) * 2020-10-09 2021-01-08 平安科技(深圳)有限公司 Automatic generation method, system, terminal and storage medium of interface document
CN112583891A (en) * 2020-11-19 2021-03-30 联通智网科技有限公司 Interface document acquisition method and device and server
CN112650533A (en) * 2020-12-22 2021-04-13 深圳前海微众银行股份有限公司 Interface document generation method and device and terminal equipment
CN112835810A (en) * 2021-03-30 2021-05-25 中国工商银行股份有限公司 Interface testing method and device based on log analysis

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Journaling Interfaces to Support Knowledge Workers in Their Collaborative Tasks and Goals;Paul Jones;《2016 International Conference on Collaboration Technologies and Systems》;1-9 *
轨道交通日志数据存储挖掘子系统的设计与实现;孙瑶;《中国优秀硕士学位论文全文数据库 工程科技Ⅱ辑》;C033-311 *

Also Published As

Publication number Publication date
CN113778423A (en) 2021-12-10

Similar Documents

Publication Publication Date Title
US11017368B2 (en) Systems and methods for automatically collection of performance data in a multi-tenant database system environment
CN108427705B (en) Electronic device, distributed system log query method and storage medium
CN111563368A (en) Report generation method and device, computer equipment and storage medium
CN108415925B (en) Electronic device, data call log generation and query method and storage medium
EP3557437B1 (en) Systems and methods for search template generation
CN110175157B (en) Query method and query device for column storage file
CN110036381B (en) In-memory data search technique
CN112422450B (en) Computer equipment, and flow control method and device for service request
CN109586970B (en) Resource allocation method, device and system
CN113656098B (en) Configuration acquisition method and system
CN113778423B (en) Interface document generation method and system
CN112418874A (en) Data tracing method and device and computer equipment
CN116776030A (en) Gray release method, device, computer equipment and storage medium
CN115795187A (en) Resource access method, device and equipment
CN114169306A (en) Method, device and equipment for generating electronic receipt and readable storage medium
CN114036132A (en) Object information processing method and device, storage medium and electronic equipment
CN111131393B (en) User activity data statistical method, electronic device and storage medium
CN110580181A (en) Cloud distributed configuration management method, electronic device and computer equipment
CN108566293B (en) Electronic device, zk node information notification method, and storage medium
CN112528189A (en) Data-based component packaging method and device, computer equipment and storage medium
CN112860755B (en) Service identifier generation method, device, computer equipment and medium
CN113553133B (en) Page display method and system
CN110413644B (en) Data caching method, electronic device and computer readable storage medium
US11301482B2 (en) Assist system and assist method
CN116566931A (en) Cloud asset synchronization method and system

Legal Events

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