CN116880920A - System and method for generating API (application program interface) execution log - Google Patents

System and method for generating API (application program interface) execution log Download PDF

Info

Publication number
CN116880920A
CN116880920A CN202310799454.9A CN202310799454A CN116880920A CN 116880920 A CN116880920 A CN 116880920A CN 202310799454 A CN202310799454 A CN 202310799454A CN 116880920 A CN116880920 A CN 116880920A
Authority
CN
China
Prior art keywords
api
log
execution
execution log
generating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310799454.9A
Other languages
Chinese (zh)
Inventor
茅庆江
龙罡
蒙剑
霍芷瑶
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Haoyun Technologies Co Ltd
Original Assignee
Haoyun Technologies 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 Haoyun Technologies Co Ltd filed Critical Haoyun Technologies Co Ltd
Priority to CN202310799454.9A priority Critical patent/CN116880920A/en
Publication of CN116880920A publication Critical patent/CN116880920A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The invention discloses a system and a method for generating an API execution log, wherein the system comprises the following steps: the system comprises a front-end processing module, a platform service module and a software service module; acquiring a first ID (identity) identifier corresponding to an API to be debugged through the front-end processing module, and sending the first ID identifier to the platform service module; the platform service module generates an API execution instruction corresponding to the first ID according to the first ID, and sends the API execution instruction to the software service module; and the software service module executes the corresponding API to be debugged according to the API execution instruction, and generates an execution log corresponding to the API to be debugged according to an execution result. By implementing the method and the system, the corresponding API can be executed directly through the platform service module and the software service module in the system for generating the API execution log, and then the corresponding execution log is obtained.

Description

System and method for generating API (application program interface) execution log
Technical Field
The invention relates to the field of low-code development, in particular to a system and a method for generating an API (application program interface) execution log.
Background
In the process of developing and constructing application programs, debugging, optimizing and managing a plurality of APIs are involved, and the execution logs of the APIs are important tools for debugging, optimizing and managing the APIs, so that in general, the deletion of the execution logs of the APIs often brings a lot of trouble to developers, the execution results of the APIs are checked by specially configuring page binding APIs, and then the execution logs are generated according to the execution results, but because the number of the APIs is large, the generation efficiency of the execution logs of the APIs is reduced by configuring pages one by one, the development efficiency of the application programs is reduced, and therefore, how to quickly acquire the execution logs of the APIs is a technical problem to be solved.
Disclosure of Invention
The invention provides a system and a method for generating an API execution log, which can execute a corresponding API directly through a platform service module and a software service module in the system for generating the API execution log, and then acquire the corresponding execution log.
The invention provides a system and a method for generating an API execution log, wherein the system comprises the following steps: the system comprises a front-end processing module, a platform service module and a software service module;
the front-end processing module is used for acquiring a first ID (identity) identifier corresponding to an API to be debugged and sending the first ID identifier to the platform service module;
the platform service module is used for generating an API execution instruction corresponding to the first ID according to the first ID, and sending the API execution instruction to the software service module;
the software service module is used for executing the API to be debugged corresponding to the API execution instruction according to the API execution instruction, and generating an execution log corresponding to the API to be debugged according to an execution result.
Further, the method further comprises the following steps: a storage module;
and the storage module is used for storing each execution log into the local disk.
Further, the method further comprises the following steps: a file transmission module and a message queue module;
the file transmission module is used for collecting each execution log corresponding to each API from the storage module and sending each execution log to the message queue module;
the platform service module is further configured to: receiving a log calling instruction, acquiring a second execution log corresponding to a second ID from the message queue module according to the second ID in the log calling instruction, and sending the second execution log to the front-end processing module so that the front-end processing module analyzes the second execution log and displays the analyzed execution log according to a preset display mode.
Further, the display mode includes: advanced mode, json mode, and business mode;
the advanced mode is used for directly displaying the data after log analysis is executed;
the json mode is used for displaying the data after log analysis is executed in a key value name and key value format;
the business mode is used for displaying the Chinese and English names, the data types and the numerical values of the data after the log analysis in the form of a table.
Further, the data after log parsing includes: node name, node type, node ID, transmission time consumption, and node input/output data of the data transmission node.
Furthermore, the front-end processing module and the platform service module are connected through a websocket channel.
On the basis of the system item embodiment, the invention correspondingly provides a method item embodiment;
the invention provides a method for generating an API execution log, which comprises the following steps: acquiring an ID (identity) corresponding to an API to be debugged;
generating an API execution instruction corresponding to the ID identification according to the ID identification;
and executing the API to be debugged corresponding to the API executing instruction according to the API executing instruction, and generating an execution log corresponding to the API to be debugged according to an executing result.
Further, the method further comprises the following steps: the execution log is stored to a local disk.
Further, the method further comprises the following steps: collecting each stored execution log from a local disk, and sending each execution log to the message queue;
receiving a log calling instruction, and acquiring a second execution log corresponding to a second ID from the message queue according to the second ID in the log calling instruction; analyzing the second execution log, and displaying the analyzed execution log according to a preset display mode.
Further, the display mode includes: advanced mode, json mode, and business mode;
the advanced mode is used for directly displaying the data after log analysis is executed;
the json mode is used for displaying the data after log analysis is executed in a key value name and key value format;
the business mode is used for displaying the Chinese and English names, the data types and the numerical values of the data after the log analysis in the form of a table.
The embodiment of the invention has the following beneficial effects:
the invention provides a system for generating an API execution log; the system comprises a front-end processing module, a platform service module and a software service module; when a certain API needs to be debugged, firstly, an ID (identity) identifier corresponding to the API to be debugged is obtained through a front-end processing module, then the ID identifier is sent to a platform service module, after the ID identifier is obtained, the platform service module calls the software service module to execute the API corresponding to the ID identifier according to the ID identifier, and then an execution log is generated according to an execution result. By implementing the method and the device, when the API execution log to be debugged is missing, the page binding API does not need to be specially configured to check the execution result of the API, the corresponding API is directly executed through the platform service module and the software service module in the generation system of the API execution log, and then the corresponding execution log is acquired, so that the generation efficiency of the API execution log is improved, and further the development efficiency of the application program is improved.
Drawings
FIG. 1 is a schematic diagram of a system for generating an API execution log according to an embodiment of the present invention;
FIG. 2 is a timing flow diagram of a system for generating an API execution log according to an embodiment of the present invention;
fig. 3 is a flowchart of a method for generating an API execution log according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made more apparent and fully hereinafter with reference to the accompanying drawings, in which some, but not all embodiments of the invention are shown. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
As shown in fig. 1, an API execution log generating system according to an embodiment includes: comprising the following steps: front end processing module, platform service module (Paas) and software service module (Saas);
the front-end processing module is used for acquiring a first ID (identity) corresponding to an API to be debugged and sending the first ID to the platform service module (Paas);
the platform service module (Paas) is used for generating an API execution instruction corresponding to the first ID according to the first ID, and sending the API execution instruction to the software service module (Saas);
the software service module (Saas) is configured to execute an API to be debugged corresponding to the API execution instruction according to the API execution instruction, and generate an execution log corresponding to the API to be debugged according to an execution result.
Specifically, after the user finishes configuring an API through the front end of the low-code development tool, clicking the debugging API, a front-end processing module of a generating system of an API execution log acquires a first ID (identity) corresponding to the API to be debugged, then the first ID is sent to a platform service module (Paas), then the platform service module (Paas) generates an API execution instruction corresponding to the first ID after receiving the ID, then the API execution instruction is sent to a software service module (Saas), and after acquiring the API execution instruction, the software service module (Saas) executes the API to be debugged corresponding to the API execution instruction, namely calls an API execution service (Saas) of the low-code development tool to execute the API, and then generates an execution log corresponding to the API to be debugged according to an execution result.
In a preferred embodiment, the system for generating an API execution log further includes: a storage module;
and the storage module is used for storing each execution log into the local disk.
Specifically, the storage module can store each generated execution log into the local disk, so that the local disk can perform persistent storage on each execution log.
In a preferred embodiment, the system for generating an API execution log further includes: a file transfer module (filebean) and a message queue module (Kafka);
the file transmission module (filecoat) is used for collecting each execution log corresponding to each API from the storage module and sending each execution log to the message queue module (Kafka);
the platform services module (Paas) is further configured to: receiving a log calling instruction, acquiring a second execution log corresponding to a second ID from the message queue module (Kafka) according to the second ID in the log calling instruction, and sending the second execution log to the front-end processing module so that the front-end processing module analyzes the second execution log and displays the analyzed execution log according to a preset display mode.
Specifically, since there may be multiple APIs in the whole API execution log generating system that are debugged at the same time, the file transfer module (file) may collect each execution log corresponding to each API from the storage module, and then send each execution log corresponding to each API to the message queue module (Kafka); the method comprises the steps that a file transmission module (filecoat) is used for collecting and distributing logs in a local disk, and the logs are transmitted to a message queue module (Kafka); schematically, the message queue module (Kafka) may also be called a central cluster or a log management system, or may transmit each execution log from the local disk to the central log management system (Kafka), so as to implement centralized storage and unified management of the log, thereby providing convenience for subsequent log processing, screening and displaying.
When a plurality of APIs are debugged at the same time, the platform service module (Paas) receives a corresponding log calling instruction for each API to be debugged, then screens a second execution log corresponding to the second ID from the message queue module (Kafka) according to the second ID in the log calling instruction, and after screening the second execution log corresponding to the second ID, sends the second execution log to the front-end processing module, analyzes the second execution log through the front-end processing module, and displays the analyzed execution log through the front end according to a preset display mode.
In a preferred embodiment, the presentation mode includes: advanced mode, json mode, and business mode;
the advanced mode is used for directly displaying the data after log analysis is executed;
the json mode is used for displaying the data after log analysis is executed in a key value name and key value format;
the business mode is used for displaying the Chinese and English names, the data types and the numerical values of the data after the log analysis in the form of a table.
Specifically, the display modes include, but are not limited to: advanced mode, json mode, and business mode;
the high-level mode is suitable for developers, namely the high-level mode is suitable for the developers, and the data after the log analysis is directly displayed, namely all contents of all nodes in the log are directly displayed. The json mode is suitable for non-professional programmers, the front end analyzes the input and output parameters of each node, and the input and output parameters are displayed through a preset code editor in the format of { key value names: key values }. The business mode is suitable for non-professional programmers, the front end analyzes the input and output parameters of each node in the execution log, and the Chinese and English names, the data types and the numerical values of the data after the execution log analysis are displayed in the form of a table.
In a preferred embodiment, the data after the line log parsing includes: node name, node type, node ID, time consuming transmission and node input/output data of the data transmission node;
specifically, the parsed execution log displays the node name, the node type, the node ID, the transmission time consumption and the node input/output data of the data transmission node in any display mode.
In a preferred embodiment, a connection is established between the front-end processing module and the platform service module (Paas) through a websocket channel;
specifically, the front-end processing module establishes a session between platform service modules (Paas) through a websocket channel, and when a user clicks the debugging API, the front-end processing module generates a unique tag saas_deubg_tracking_id, i.e. an ID identifier, for identifying the uniqueness of the API call, and sends the saas_deubg_tracking_id to the platform service module (Paas) to facilitate subsequent processing.
In summary, a T2 timing diagram of the API execution log generating system is shown in fig. 2.
Based on the system item embodiment, the invention correspondingly provides a method item embodiment.
As shown in fig. 3, an embodiment of the present invention provides a method for generating an API execution log, including:
step S101, an ID (identity) corresponding to an API to be debugged is obtained;
step S102, according to the ID mark, generating an API executing instruction corresponding to the ID mark;
step S103, executing the API to be debugged corresponding to the API executing instruction according to the API executing instruction, and generating an execution log corresponding to the API to be debugged according to an executing result.
In a preferred embodiment, the method for generating an API execution log further includes: the execution log is stored to a local disk.
In a preferred embodiment, the method for generating an API execution log further includes: collecting each stored execution log from a local disk, and sending each execution log to the message queue;
receiving a log calling instruction, and acquiring a second execution log corresponding to a second ID from the message queue according to the second ID in the log calling instruction; analyzing the second execution log, and displaying the analyzed execution log according to a preset display mode.
In a preferred embodiment, the presentation mode includes: advanced mode, json mode, and business mode;
the advanced mode is used for directly displaying the data after log analysis is executed;
the json mode is used for displaying the data after log analysis is executed in a key value name and key value format;
the business mode is used for displaying the Chinese and English names, the data types and the numerical values of the data after the log analysis in the form of a table.
It will be clearly understood by those skilled in the art that, for convenience and brevity, the specific implementation process of the above-described method may refer to the corresponding process in the foregoing system item embodiment, which is not described herein again.
By implementing the embodiments of the invention, the execution result of the API can be checked without specially configuring the page binding API, the corresponding API is directly executed through the platform service module and the software service module in the generation system of the API execution log, and then the corresponding execution log is obtained, so that the generation efficiency of the API execution log is improved, and the development efficiency of the application program is further improved.
While the foregoing is directed to the preferred embodiments of the present invention, it will be appreciated by those skilled in the art that changes and modifications may be made without departing from the principles of the invention, such changes and modifications are also deemed to be the invention as set forth in the claims.

Claims (10)

1. A system for generating an API execution log, comprising: the system comprises a front-end processing module, a platform service module and a software service module;
the front-end processing module is used for acquiring a first ID (identity) identifier corresponding to an API to be debugged and sending the first ID identifier to the platform service module;
the platform service module is used for generating an API execution instruction corresponding to the first ID according to the first ID, and sending the API execution instruction to the software service module;
the software service module is used for executing the API to be debugged corresponding to the API execution instruction according to the API execution instruction, and generating an execution log corresponding to the API to be debugged according to an execution result.
2. The API execution log generation system of claim 1, further comprising: a storage module;
and the storage module is used for storing each execution log into the local disk.
3. The API execution log generation system of claim 2, further comprising: a file transmission module and a message queue module;
the file transmission module is used for collecting each execution log corresponding to each API from the storage module and sending each execution log to the message queue module;
the platform service module is further configured to: receiving a log calling instruction, acquiring a second execution log corresponding to a second ID from the message queue module according to the second ID in the log calling instruction, and sending the second execution log to the front-end processing module so that the front-end processing module analyzes the second execution log and displays the analyzed execution log according to a preset display mode.
4. The system for generating an API execution log as recited in claim 3, wherein said exposing mode comprises: advanced mode, json mode, and business mode;
the advanced mode is used for directly displaying the data after log analysis is executed;
the json mode is used for displaying the data after log analysis is executed in a key value name and key value format;
the business mode is used for displaying the Chinese and English names, the data types and the numerical values of the data after the log analysis in the form of a table.
5. The system for generating an API execution log according to claim 4, wherein the data after execution log parsing comprises: node name, node type, node ID, transmission time consumption, and node input/output data of the data transmission node.
6. The system for generating an API execution log according to claim 5, wherein said front-end processing module and said platform service module are connected through a websocket channel.
7. The method for generating the API execution log is characterized by comprising the following steps of:
acquiring an ID (identity) corresponding to an API to be debugged;
generating an API execution instruction corresponding to the ID identification according to the ID identification;
and executing the API to be debugged corresponding to the API executing instruction according to the API executing instruction, and generating an execution log corresponding to the API to be debugged according to an executing result.
8. The method for generating an API execution log as recited in claim 7, further comprising: the execution log is stored to a local disk.
9. The method for generating an API execution log as recited in claim 8, further comprising: collecting each stored execution log from a local disk, and sending each execution log to the message queue;
receiving a log calling instruction, and acquiring a second execution log corresponding to a second ID from the message queue according to the second ID in the log calling instruction; analyzing the second execution log, and displaying the analyzed execution log according to a preset display mode.
10. The method for generating an API execution log according to claim 9, wherein said exposing mode comprises: advanced mode, json mode, and business mode;
the advanced mode is used for directly displaying the data after log analysis is executed;
the json mode is used for displaying the data after log analysis is executed in a key value name and key value format;
the business mode is used for displaying the Chinese and English names, the data types and the numerical values of the data after the log analysis in the form of a table.
CN202310799454.9A 2023-06-30 2023-06-30 System and method for generating API (application program interface) execution log Pending CN116880920A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310799454.9A CN116880920A (en) 2023-06-30 2023-06-30 System and method for generating API (application program interface) execution log

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310799454.9A CN116880920A (en) 2023-06-30 2023-06-30 System and method for generating API (application program interface) execution log

Publications (1)

Publication Number Publication Date
CN116880920A true CN116880920A (en) 2023-10-13

Family

ID=88268995

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310799454.9A Pending CN116880920A (en) 2023-06-30 2023-06-30 System and method for generating API (application program interface) execution log

Country Status (1)

Country Link
CN (1) CN116880920A (en)

Similar Documents

Publication Publication Date Title
CN108427631B (en) Application test system, method, electronic equipment and readable storage medium
CN107241315B (en) Access method and device of bank gateway interface and computer readable storage medium
CN110750458A (en) Big data platform testing method and device, readable storage medium and electronic equipment
US10528456B2 (en) Determining idle testing periods
US8046638B2 (en) Testing of distributed systems
CN111026634A (en) Interface automation test system, method, device and storage medium
CN111159046A (en) Test method, test device, electronic equipment, test system and storage medium
CN110750453B (en) HTML 5-based intelligent mobile terminal testing method, system, server and storage medium
US20170220218A1 (en) Automatic Generation of Regular Expression Based on Log Line Data
CN108399095B (en) Method, system, device and storage medium for supporting dynamic management of timed tasks
US8997116B2 (en) Event logging application programming interface (API)
CN108595178B (en) Hook-based data acquisition method, device and equipment
CN113360413A (en) Code testing method and device
CN112416739B (en) Test method and device and electronic equipment
WO2016190869A1 (en) Determining potential test actions
CN109324892B (en) Distributed management method, distributed management system and device
CN112883088A (en) Data processing method, device, equipment and storage medium
CN116880920A (en) System and method for generating API (application program interface) execution log
CN113742408B (en) Protobuf protocol dynamic analysis-based data interaction method
CN115934537A (en) Interface test tool generation method, device, equipment, medium and product
US11734299B2 (en) Message templatization for log analytics
CN110806967A (en) Unit testing method and device
CN111679899B (en) Task scheduling method, device, platform equipment and storage medium
CN114327416A (en) Interface synchronization method and device applied to development branch and electronic equipment
CN113448985A (en) API (application program interface) interface generation method, calling method and device and electronic equipment

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