CN116931918A - Interface generation method, device, storage medium and electronic equipment - Google Patents

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

Info

Publication number
CN116931918A
CN116931918A CN202310912050.6A CN202310912050A CN116931918A CN 116931918 A CN116931918 A CN 116931918A CN 202310912050 A CN202310912050 A CN 202310912050A CN 116931918 A CN116931918 A CN 116931918A
Authority
CN
China
Prior art keywords
calling
interface
interfaces
performance
determining
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
CN202310912050.6A
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.)
China Telecom Technology Innovation Center
China Telecom Corp Ltd
Original Assignee
China Telecom Technology Innovation Center
China Telecom Corp 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 China Telecom Technology Innovation Center, China Telecom Corp Ltd filed Critical China Telecom Technology Innovation Center
Priority to CN202310912050.6A priority Critical patent/CN116931918A/en
Publication of CN116931918A publication Critical patent/CN116931918A/en
Pending legal-status Critical Current

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

Landscapes

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

Abstract

The embodiment of the disclosure relates to an interface generation method, a device, a storage medium and electronic equipment, and relates to the technical field of computers, wherein the interface generation method comprises the following steps: responding to a call request of a calling end to a providing end, and acquiring call information of a plurality of interfaces; determining the calling performance of the interfaces according to the calling information, and determining the association relation among a plurality of interfaces according to the calling information; and optimizing a plurality of interfaces according to the calling performance and the association relation to generate a new interface. According to the technical scheme, the interfaces can be optimized according to the calling performance of the interfaces and the association relation among the interfaces, so that the interfaces with proper granularity and high calling performance can be generated.

Description

Interface generation method, device, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of computer technology, and in particular, to an interface generating method, an apparatus, a computer readable storage medium, and an electronic device.
Background
An application programming interface (Application Programming Interface, API) is an interface that defines interaction rules and conventions between software components, and is also a conventional manifestation of interaction interfaces between multiple systems, and the opening of capabilities of the interface is an important piece of digital transformation. In interface generation, the granularity design of the interface is an important content, the granularity of the interface is large, the system performance consumption is large, and the granularity of the interface is small, and the calling end needs to make multiple calls, so that in interface application, the interface with proper granularity and high performance needs to be generated.
In the related art, only the calling condition of a single interface is monitored in the interface generation process, the association relation among different interfaces is not considered, the performance of a providing end is not considered, and a certain improvement space still exists for the granularity and calling performance of the obtained interface.
Disclosure of Invention
The invention aims to provide an interface generation method, an interface generation device, a storage medium and electronic equipment, which can optimize interfaces according to calling performance of the interfaces and association relations among a plurality of interfaces, so that the interfaces with proper granularity and high calling performance are generated.
According to a first aspect of the present disclosure, there is provided an interface generating method, including: responding to a call request of a calling end to a providing end, and acquiring call information of a plurality of interfaces; determining calling performance of the interfaces according to the calling information, and determining association relations among the interfaces according to the calling information; and optimizing the interfaces according to the calling performance and the association relation to generate a new interface.
In some exemplary embodiments of the present disclosure, based on the foregoing technical solution, acquiring call information of a plurality of interfaces includes: monitoring and recording interface interaction operations of a calling end and a providing end to acquire calling information of a plurality of interfaces; the calling information comprises one or more of calling end names, calling time and calling times of calling ends on interfaces and feedback duration of providing ends on the interfaces.
In some exemplary embodiments of the present disclosure, based on the foregoing technical solutions, determining call performance of an interface according to call information, and determining an association relationship between a plurality of interfaces according to call information, includes: analyzing the calling times of the calling terminal to the interface and the feedback time length of the providing terminal to the interface, and determining the calling performance of the interface; and analyzing the calling time of the interface by the calling end and the calling end of the interface, and determining the association relation of the interface.
In some exemplary embodiments of the present disclosure, based on the foregoing technical solutions, the analyzing the number of times of calling an interface by a calling end and the feedback duration of the interface by a providing end, to determine the calling performance of the interface includes: comparing the calling times with a preset calling times threshold value, comparing the feedback time length with a preset feedback time length threshold value, and determining a comparison result; and determining the calling performance of the interface according to the comparison result.
In some exemplary embodiments of the present disclosure, based on the foregoing technical solutions, determining, according to a comparison result, call performance of an interface includes: and in response to the calling times being greater than a preset calling times threshold value and the feedback time length being greater than a preset feedback time length threshold value, determining that the calling performance of the interface does not meet the calling condition.
In some exemplary embodiments of the present disclosure, based on the foregoing technical solutions, analyzing a calling end of an interface and a calling time of the calling end on the interface, determining an association relationship of the interface includes: determining the time interval of the calling time of the calling end on different interfaces; and determining that the different interfaces are associated interfaces in response to the time interval being less than the preset time interval threshold.
In some exemplary embodiments of the present disclosure, based on the foregoing technical solutions, optimizing a plurality of interfaces according to call performance and association relationships, generating a new interface includes: if the calling performance of the interface does not meet the calling condition, cutting the interface to obtain a cutting result; if the different interfaces are associated interfaces, combining the different interfaces to obtain a combined result; and generating a new interface according to the clipping result and the combination result.
According to a second aspect of the present disclosure, there is provided an interface generating apparatus including: the calling information acquisition module can be used for responding to a calling request of a calling end to a providing end to acquire calling information of a plurality of interfaces; the performance relation determining module can be used for determining the calling performance of the interfaces according to the calling information and determining the association relation among a plurality of interfaces according to the calling information; the interface generation module can be used for optimizing a plurality of interfaces according to the calling performance and the association relation to generate a new interface.
According to a third aspect of the present disclosure, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the interface generation method of the first aspect described above and possible implementations thereof.
According to a fourth aspect of the present disclosure, there is provided an electronic device comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the interface generation method of the first aspect described above and possible implementations thereof via execution of executable instructions.
In the technical scheme provided by the embodiment of the disclosure, the calling performance of the interface is determined according to the calling information, the association relation among the interfaces is determined according to the calling information, and the interfaces are optimized according to the calling performance and the association relation, so that a new interface is generated. On one hand, the interface is optimized according to the calling performance, so that the interface with proper granularity is generated; on the other hand, the interfaces are optimized according to the association relation among the interfaces, so that the requirements of the calling end are considered, the association relation among the interface parameters in the providing end is considered, and the interface with high calling performance is generated; further, the generation effect of the interface and the application effect of the interface are further improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure. It will be apparent to those of ordinary skill in the art that the drawings in the following description are merely examples of the disclosure and that other drawings may be derived from them without undue effort.
Fig. 1 shows a schematic diagram of an application scenario in which an interface generation method of an embodiment of the present disclosure may be applied.
Fig. 2 schematically illustrates a flowchart of an interface generation method in an embodiment of the disclosure.
Fig. 3 schematically illustrates a structural diagram of an interface generation system in an embodiment of the present disclosure.
Fig. 4 shows a schematic diagram of a system architecture to which the interface generation method of the embodiments of the present disclosure may be applied.
Fig. 5 schematically illustrates a flowchart of another interface generation method in an embodiment of the disclosure.
Fig. 6 schematically shows a block diagram of an interface generating apparatus in an embodiment of the present disclosure.
Fig. 7 schematically illustrates a block diagram of an electronic device in an embodiment of the disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments may be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the present disclosure. However, those skilled in the art will recognize that the aspects of the present disclosure may be practiced with one or more of the specific details, or with other methods, components, devices, steps, etc. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus a repetitive description thereof will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software or in one or more hardware modules or integrated circuits or in different networks and/or processor devices and/or microcontroller devices.
An application programming interface (Application Programming Interface, API) is an interface that defines rules and conventions for interaction between software components, while API messages are interface content protocols, which are a common manifestation of interaction interfaces between multiple systems. In addition, the capability opening of the API is an important content of digital transformation and is also an integral part of the telecommunications capability opening. The design of the API needs to consider the system performance and the convenience of the calling operation of the calling end, besides meeting the service requirement of the system. In addition, in the design of the API, the granularity of the API is a content which is not easy to determine, the granularity of the API is large, the system performance consumption is large, the granularity of the API is small, and the calling end needs to make multiple calls, so that the proper granularity of the API is a key technology with open capability. Thus, in interface applications, there is a need to generate APIs that are properly sized and efficient in performance.
However, in the existing API generation technology, only the calling condition of a single API is monitored in the interface generation process, the association relation between different APIs is not considered, the granularity of the generated API is difficult to meet the calling condition of the system, and a certain improvement space exists for calling performance. In addition, in the related art, by acquiring the actual requirement of the calling end, namely the access parameter requirement, and summarizing, analyzing and counting the access parameters of the calling end, when the calling end for the same access parameter requirement reaches a certain preset quantity threshold, a new API service capability is generated according to the new access parameter requirement, and the new API service capability is provided for the providing end system and is provided for the outside. Although the method considers the actual use of the calling end and designs the API capability, in the use of the API capability, the performance of the providing end is not considered, and the designed API has the problem of overlarge granularity or overlarge granularity; meanwhile, the use of parameters by the calling end is system internal information, and the parameters are not easy to acquire from an interface layer. Therefore, how to generate APIs with proper granularity and efficient calling performance is a technical problem to be solved.
In order to solve the technical problems, the embodiment of the disclosure provides an interface generation method which can be applied to optimizing and generating an API to obtain the API with proper granularity and high calling performance. Fig. 1 is a schematic diagram of a system architecture to which the interface generation method and apparatus of the embodiments of the present disclosure may be applied.
As shown in fig. 1, the system architecture 100 may include a calling terminal 101, a providing terminal 102, a server 103, a network, and the like. The network may be used for providing a transmission medium of a communication link between the calling end, the providing end and the server, and is mainly used for transmitting the API call information between the calling end and the providing end to the server and transmitting the API interaction information between the calling end and the providing end. The network may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others. The calling and providing terminals 101, 102 may be a variety of electronic devices including, but not limited to, desktop computers, portable computers, smart phones, tablet computers, and the like. It should be understood that the number of call ends, provisioning ends, and servers in fig. 1 is merely illustrative, and that any number of call ends, provisioning ends, and servers may be provided as desired for implementation. For example, the server may be a server cluster formed by a plurality of servers.
For example, in the embodiment of the present disclosure, in the process of performing the API interaction between the calling end 101 and the providing end 102, the server 103 may obtain the calling information of a plurality of APIs in response to the calling request of the calling end to the providing end; the server determines calling performance of the APIs according to the acquired calling information of the APIs, determines association relations among the APIs according to the calling information of the APIs, optimizes the APIs according to the calling performance and the association relations of the APIs to generate new APIs, and configures the new APIs on a calling end and a providing end; the calling end and the service end complete interaction operation based on the new API.
However, it is easy to understand by those skilled in the art that the above application scenario is only for example, and the present exemplary embodiment is not limited thereto. Based on this, in an embodiment of the present disclosure, an interface generating method is provided. Various steps of the interface generation method in the embodiment of the present disclosure will be described in detail with reference to fig. 2.
In step S210, call information of a plurality of interfaces is acquired in response to a call request from a calling terminal to a providing terminal.
In the disclosed embodiment, the interface may be an application programming interface (Application Programming Interface), also simply referred to as an API. Among other things, APIs define the manner of interaction and communication protocols between different program components, allowing interaction and data transfer between applications or between applications and operating systems, databases, servers, etc. By using APIs, a user may build an application based on existing program components, databases, frameworks, or services without having to know specific internal details. Unless otherwise specified, interfaces in embodiments of the present disclosure all represent APIs.
In the embodiment of the disclosure, the call information may represent related information of API interaction operations such as sending a request, receiving a response, sending data, and the like between the API call end and the API providing end. Through analyzing the calling information, the related information of the API interaction operation between the calling end and the providing end can be obtained, and the use condition of the API is obtained.
In some embodiments, the method for obtaining call information of a plurality of interfaces specifically includes the following steps: monitoring and recording interface interaction operations of a calling end and a providing end to acquire calling information of a plurality of interfaces; the calling information comprises one or more of calling end names, calling time and calling times of calling ends on interfaces and feedback duration of providing ends on the interfaces.
Specifically, in the process of interface interaction operation of the calling end and the providing end, the interaction operation of the calling end and the providing end can be monitored by using the monitoring module so as to acquire calling information of a plurality of interfaces. Wherein, by obtaining various calling information of the API, the performance of the API can be better analyzed.
With continued reference to fig. 2, in step S220, the calling performance of the interfaces is determined according to the calling information, and the association relationship between the interfaces is determined according to the calling information.
In the embodiment of the disclosure, the calling performance can represent the effects in terms of calling efficiency, response speed and the like in the API calling process, and the API with too coarse granularity can be correspondingly cut based on the calling performance. The association relationship may represent an association relationship between different APIs in the API calling process, and, for example, after the different calling terminals call the API1, the API2 is often called in a shorter time interval, and then the API1 and the API2 may be considered as associated APIs.
In some embodiments, determining calling performance of the interfaces according to the calling information, and determining association relations among the interfaces according to the calling information specifically includes the following steps: analyzing the calling times of the calling terminal to the interface and the feedback time length of the providing terminal to the interface, and determining the calling performance of the interface; and analyzing the calling time of the interface by the calling end and the calling end of the interface, and determining the association relation of the interface.
Specifically, the number of times of calling the API by the calling end may reflect the degree of demand of the API, and the more the number of times of calling indicates that the degree of demand of the API is higher, so that it is necessary to control the feedback time length of the providing end to the API and ensure the calling performance of the API, so as to ensure the calling effect of the calling end to the API. The feedback time of the providing end to the API can reflect the granularity of the API to a certain extent, and the longer the feedback time of the providing end to a certain API is under the condition that the data volume and the network delay are the same, the coarser the granularity of the API can be indicated to a certain extent. By analyzing the calling ends of the APIs and the calling time of the calling ends to the APIs, the calling time of different calling ends to different APIs and the calling time interval of the calling ends to different APIs can be determined, and when the calling time interval of a plurality of calling ends to two APIs is shorter, the two APIs can be considered as associated APIs.
In some embodiments, the number of times of calling the interface by the calling end and the feedback duration of the interface by the providing end are analyzed to determine the calling performance of the interface, and the method specifically comprises the following steps: comparing the calling times with a preset calling times threshold value, comparing the feedback time length with a preset feedback time length threshold value, and determining a comparison result; and determining the calling performance of the interface according to the comparison result.
Specifically, comparing the calling times of the API with a preset calling times threshold value can determine the demand degree of the API, wherein the larger the calling times are, the larger the demand degree of the API is, and when the calling times are greater than the preset calling times threshold value, the higher the demand degree of the API is. Comparing the feedback time length of the API with a preset feedback time length threshold value by the providing end, the granularity of the API can be known to a certain extent, and when the feedback time length is larger than the preset feedback time length threshold value, the granularity of the API can be indicated to be too coarse to a certain extent.
In some embodiments, determining the calling performance of the interface according to the comparison result specifically includes the following steps: and in response to the calling times being greater than a preset calling times threshold value and the feedback time length being greater than a preset feedback time length threshold value, determining that the calling performance of the interface does not meet the calling condition.
Specifically, when the number of times of calling the API by the calling end is larger than a preset calling number threshold, the API is frequently called, the demand degree is higher, and when the feedback time of the providing end to the API is longer than a preset feedback time threshold, the calling performance of the API is low-efficiency, the granularity is too coarse and the calling condition cannot be met, so that the API with higher demand degree needs to be cut to a certain extent. By clipping the API, the performance of the provider system can be improved to a certain extent. For different application scenarios, the preset calling number threshold and the preset feedback duration threshold may be determined according to specific situations, and for an exemplary case that the calling end is a smart phone, it is generally considered that a relevant user of the smart phone needs a faster response speed, so that the preset feedback duration threshold may be set relatively smaller, for example, 4 seconds; for the case that the calling terminal is a portable computer, it is generally considered that the tolerance of the relevant user of the portable computer to the response speed of the program is high, so that the preset feedback duration can be set relatively large, for example, 10 seconds. In addition, for different application scenarios, the preset number of calls threshold may be selected to be a suitable value according to actual situations, and for example, the preset number of calls threshold may be 100.
In some embodiments, the calling end of the interface and the calling time of the interface are analyzed by the calling end to determine the association relationship of the interface, and the method specifically comprises the following steps: determining the time interval of the calling time of the calling end on different interfaces; and determining that the different interfaces are associated interfaces in response to the time interval being less than the preset time interval threshold.
Specifically, determining the time interval of the calling time of different calling terminals to different APIs can determine whether the different APIs have an association relationship. The time interval may be obtained by averaging the time intervals of call times of a plurality of call terminals to certain specific APIs. For example, after the multiple calling terminals call the API1, the multiple calling terminals call the API2, so that time intervals of calling the API2 by different calling terminals after calling the API1 can be obtained, then an average value of the obtained time intervals is compared with a preset time interval threshold, and when the time intervals are smaller than the preset time interval threshold, the API1 and the API2 can be considered to have a certain association relationship, and the association relationship is the associated API.
With continued reference to fig. 2, in step S230, the plurality of interfaces are optimized according to the calling performance and the association relationship, and a new interface is generated.
Specifically, when the calling performance of the API does not meet the calling performance, it means that the feedback time of the calling end to the API is too long, so that a certain degree of clipping is required. When multiple APIs have an association, the associated APIs may be combined to optimize the capabilities of the APIs.
In some embodiments, optimizing a plurality of interfaces according to calling performance and association relation to generate a new interface, specifically comprising the following steps: if the calling performance of the interface does not meet the calling condition, cutting the interface to obtain a cutting result; if the different interfaces are associated interfaces, combining the different interfaces to obtain a combined result; and generating a new interface according to the clipping result and the combination result.
Specifically, when the calling performance of the API does not meet the calling condition, clipping can be performed according to the function and the characteristic of the API, and the redundant function and endpoint in the API are removed or disabled, so as to obtain the clipped API. When a different API is an associated API, the different API may be combined to obtain a new API.
In some embodiments, after generating a new API, the calling end and the providing end perform interface interaction operation based on the new API, then continue to obtain call information of multiple APIs requested by the calling end for the providing end, determine call performance and association relation of the APIs based on the call information, optimize the APIs according to the call performance and association relation, generate a new API, and repeat the above steps to perform overall process optimization and generation on the APIs.
In some embodiments, an interface generating system is also provided, and fig. 3 schematically illustrates a structural schematic diagram of the interface generating system in an embodiment of the disclosure. As shown in fig. 3, the interface generating system is composed of a monitoring module, an API call performance analysis module, an API call association analysis module, an API capability design module, and an API generating and publishing module.
The monitoring module can be used for monitoring the calling of the service, and mainly responds to an API calling request of the calling end to the providing end to acquire related information of the calling end name, the calling time and the calling times of the calling end to the API, the feedback time of the providing end to the API and the like.
The API call performance analysis module can be used for analyzing the number of times of API call of the calling end and the feedback time length of the providing end to the API, and determining the call performance of the API. Specifically, the API call performance analysis module compares the call times with a preset call times threshold, compares the feedback time length with a preset feedback time length threshold, determines a comparison result, and then determines the call performance of the API according to the comparison result.
The API call association relation analysis module can be used for analyzing the calling time of the calling end and the calling end on the API and determining the association relation of the API. Specifically, the API call association relation analysis module determines the time interval of the calling time of the calling end on different APIs, and then determines the different APIs as the associated APIs in response to the time interval being smaller than a preset time interval threshold.
The API capability design module can be used for automatically designing a new API according to the analysis results of the API call performance analysis module and the API call association relation analysis module and the parameter composition of the API.
The API generation and release module may be used for generation and release of new APIs.
Fig. 4 shows a schematic diagram of a system architecture to which the interface generation method of the embodiments of the present disclosure may be applied. The system architecture can be applied to a scene with open use capability, such as a DCOOS platform. As shown in fig. 4, the provider contains 4 APIs, i.e., API1: talent total information query, API2: talent identity information query, API3: talent native place information query, API4: talent related information query, and parameters corresponding to API1, include 4 information groups: talent identity information group, talent academic information group, talent native place information group and talent relatives information group. When a calling end sends a calling request to a providing end, an API generating system can acquire calling information of a plurality of APIs, then determine calling performance of the APIs and association relations among the APIs according to the calling information, optimize the APIs according to the calling performance and the association relations, and generate new APIs.
Specifically, a dynamic API generating system is introduced between the calling end and the providing end, and when calling the API capability of the Fang Diaoyong provider, the API generating system performs the following steps:
The monitoring module obtains related information of the calling end name, the calling time and the calling times of the calling end on the API, the feedback time of the providing end on the API and the like. Illustratively, referring to FIG. 4, call end A calls API1 at 12:00:05, 12:01:10, talent full information query; calling end D calls API1 at 12:00:00 and 12:01:20, and talent full information inquiry is carried out.
The API call performance analysis module can be used for analyzing the number of times of API call of the calling end and the feedback time length of the providing end to the API, and determining the call performance of the API. For example, referring to fig. 4, after the analysis of the API call performance analysis module, the API call performance analysis module finds that the number of times of calling the API1 is more, and the calling end is also more, the feedback duration of the providing end is more than 10 seconds, and meanwhile, the CPU performance of the providing end is relatively tense, so as to obtain an analysis result: the calling performance of the API1 does not meet the calling condition and needs to be cut.
The API call association relation analysis module can be used for analyzing the calling time of the calling end and the calling end on the API and determining the association relation of the API. For example, referring to fig. 4, after the analysis of the association relationship of API calls, the analysis module finds that the calling end calls API4 frequently within 1 second after calling API3, and the feedback duration of both APIs is very short. Therefore, the two APIs are obtained as the associated APIs through analysis, the API3 and the API4 can be combined, and the API call association analysis module can configure the time interval of the call time of the API having the association.
And the API capability design module performs API design according to the analysis results of the API call performance analysis module and the API call association relation analysis module. Specifically, the granularity of the API1 is too coarse, the granularity of the API3 and the granularity of the API4 are too fine, and the API1 can be cut down, and the API3 and the API4 can be combined; the analysis module simultaneously discovers that the parameters of the API2, the API3 and the API4 are the subset of the API1, so that the API5 can be generated, and the parameters are the API3 and the API4; meanwhile, the calling performance of the API2 is normal, the granularity is proper, and optimization is not needed.
And finally, the API generating and publishing module generates a new API according to the design result of the API capability design module and publishes the new API.
Fig. 5 schematically illustrates a flowchart of another interface generation method in an embodiment of the disclosure, specifically including the following steps:
step S510, in response to the call request of the calling end to the providing end, the calling end names of the interfaces, the calling time and the calling times of the calling end to the interfaces and the feedback time length of the providing end to the interfaces are obtained.
Step S520, comparing the calling times with a preset calling times threshold, comparing the feedback time length with a feedback time length threshold, and determining the calling performance of the interface according to the comparison result.
Step S530, determining the time interval of the calling end on the calling time of the different interfaces, and determining the different interfaces as the associated interfaces in response to the time interval being smaller than the preset time interval threshold.
And step S540, if the calling performance of the interface does not meet the calling condition, cutting the interface to obtain a cutting result.
In step S550, if the different interfaces are associated interfaces, the different interfaces are combined to obtain a combined result.
Step S560, generating a new interface according to the clipping result and the combination result.
According to the interface generation method in the embodiment, the API call information such as the association relation of the APIs in the calling and using processes of the calling end, the calling time interval of different APIs, the feedback time length of the providing end on the APIs and the like can be analyzed, and the APIs with moderate granularity and meeting the requirements of users can be generated, so that the providing of the API capacity can be enriched, and the use of the API capacity can be continuously optimized. In addition, the method not only considers the association relation between the requirements of the calling end and API parameters, but also comprehensively considers the performance of the providing end system, and improves the performance of the providing end system while accurately meeting the requirements of users.
In the technical scheme provided by the embodiment of the disclosure, the calling performance of the interface is determined according to the calling information, the association relation among the interfaces is determined according to the calling information, and the interfaces are optimized according to the calling performance and the association relation, so that a new interface is generated. On one hand, the interface is optimized according to the calling performance, so that the interface with proper granularity is generated; on the other hand, the interfaces are optimized according to the association relation among the interfaces, so that the requirements of the calling end are considered, the association relation among the interface parameters in the providing end is considered, and the interface with high calling performance is generated; further, the generation effect of the interface and the application effect of the interface are further improved.
The embodiment of the present disclosure further provides an interface generating apparatus, referring to fig. 6, the interface generating apparatus 600 may include: the information acquisition module 601, the performance relationship determination module 602, and the interface generation module 603 are invoked. Wherein:
the call information obtaining module 601 may be configured to obtain call information of a plurality of interfaces in response to a call request from a calling end to a providing end; the performance relation determining module 602 may determine a calling performance of the interface according to the calling information, and determine an association relation between the interfaces according to the calling information; the interface generating module 603 may be configured to optimize a plurality of interfaces according to the calling performance and the association relationship, and generate a new interface.
In one exemplary embodiment of the present disclosure, the call information acquisition module is configured to: monitoring and recording interface interaction operations of a calling end and a providing end to acquire calling information of a plurality of interfaces; the calling information comprises one or more of calling end names, calling time and calling times of calling ends on interfaces and feedback duration of providing ends on the interfaces.
In one exemplary embodiment of the present disclosure, the performance relationship determination module includes: the calling performance determining unit can be used for analyzing the calling times of the calling terminal to the interface and the feedback time length of the providing terminal to the interface to determine the calling performance of the interface; the association relation determining unit can be used for analyzing the calling end of the interface and the calling time of the calling end on the interface to determine the association relation of the interface.
In an exemplary embodiment of the present disclosure, the call performance determining unit is configured to: comparing the calling times with a preset calling times threshold value, comparing the feedback time length with a preset feedback time length threshold value, and determining a comparison result; and determining the calling performance of the interface according to the comparison result.
In one exemplary embodiment of the present disclosure, determining call performance of an interface according to a comparison result includes: and in response to the calling times being greater than a preset calling times threshold value and the feedback time length being greater than a preset feedback time length threshold value, determining that the calling performance of the interface does not meet the calling condition.
In an exemplary embodiment of the present disclosure, the association relation determining unit is configured to: determining the time interval of the calling time of the calling end on different interfaces; and determining that the different interfaces are associated interfaces in response to the time interval being less than the preset time interval threshold.
In one exemplary embodiment of the present disclosure, the interface generation module is configured to: if the calling performance of the interface does not meet the calling condition, cutting the interface to obtain a cutting result; if the different interfaces are associated interfaces, combining the different interfaces to obtain a combined result; and generating a new interface according to the clipping result and the combination result.
It should be noted that, the specific details of each part in the above-mentioned interface generating device are already described in detail in some embodiments of the corresponding method, and the details that are not disclosed may refer to the embodiment content of the method part, so that the details are not described again.
It should be noted that although in the above detailed description several modules or units of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit in accordance with embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
Furthermore, although the steps of the methods in the present disclosure are depicted in a particular order in the drawings, this does not require or imply that the steps must be performed in that particular order or that all illustrated steps be performed in order to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step to perform, and/or one step decomposed into multiple steps to perform, etc.
In an exemplary embodiment of the present disclosure, a computer-readable storage medium having stored thereon a program product capable of implementing the method described above in the present specification is also provided. In some possible implementations, various aspects of the disclosure may also be implemented in the form of a program product comprising program code for causing a terminal device to carry out the steps according to the various exemplary embodiments of the disclosure as described in the "exemplary methods" section of this specification, when the program product is run on the terminal device.
A program product for implementing the above-described method according to an embodiment of the present disclosure may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium would include the following: an electrical connection having one or more wires, a portable disk, a hard disk, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The computer readable signal medium may include a data signal propagated in baseband or as part of a carrier wave with readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
Those skilled in the art will appreciate that the various aspects of the present disclosure may be implemented as a system, method, or program product. Accordingly, various aspects of the disclosure may be embodied in the following forms, namely: an entirely hardware embodiment, an entirely software embodiment (including firmware, micro-code, etc.) or an embodiment combining hardware and software aspects may be referred to herein as a "circuit," module "or" system.
An electronic device 700 according to such an embodiment of the present disclosure is described below with reference to fig. 7. The electronic device 700 shown in fig. 7 is merely an example and should not be construed to limit the functionality and scope of use of embodiments of the present disclosure in any way.
As shown in fig. 7, the electronic device 700 is embodied in the form of a general purpose computing device. Components of electronic device 700 may include, but are not limited to: the at least one processing unit 710, the at least one memory unit 720, a bus 730 connecting the different system components (including the memory unit 720 and the processing unit 710), and a display unit 740.
Wherein the storage unit stores program code that is executable by the processing unit 710 such that the processing unit 710 performs steps according to various exemplary embodiments of the present disclosure described in the above-described "exemplary methods" section of the present specification. For example, the processing unit 710 may perform the steps as shown in fig. 2.
The memory unit 720 may include readable media in the form of volatile memory units, such as Random Access Memory (RAM) 7201 and/or cache memory 7202, and may further include Read Only Memory (ROM) 7203.
The storage unit 720 may also include a program/utility 7204 having a set (at least one) of program modules 7205, such program modules 7205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment.
Bus 730 may be a bus representing one or more of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 700 may also communicate with one or more external devices 800 (e.g., keyboard, pointing device, bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 700, and/or any device (e.g., router, modem, etc.) that enables the electronic device 700 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 750. Also, electronic device 700 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet, through network adapter 760. As shown, network adapter 760 communicates with other modules of electronic device 700 over bus 730. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with electronic device 700, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, including several instructions to cause a computing device (may be a personal computer, a server, a terminal device, or an electronic device, etc.) to perform the method according to the embodiments of the present disclosure.
Furthermore, the above-described figures are only schematic illustrations of processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It will be readily appreciated that the processes shown in the above figures do not indicate or limit the temporal order of these processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, for example, among a plurality of modules.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. This application is intended to cover any adaptations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

Claims (10)

1. An interface generation method, comprising:
responding to a call request of a calling end to a providing end, and acquiring call information of a plurality of interfaces;
determining the calling performance of the interfaces according to the calling information, and determining the association relation among a plurality of interfaces according to the calling information;
and optimizing a plurality of interfaces according to the calling performance and the association relation to generate a new interface.
2. The interface generating method according to claim 1, wherein the acquiring call information of the plurality of interfaces includes:
monitoring and recording interface interaction operations of a calling end and a providing end to acquire calling information of a plurality of interfaces; the calling information comprises one or more of the name of the calling end, the calling time and the calling times of the calling end to the interface and the feedback time of the providing end to the interface.
3. The interface generating method according to claim 2, wherein the determining the calling performance of the interface according to the calling information and determining the association relationship between the plurality of interfaces according to the calling information includes:
analyzing the calling times of the calling terminal to the interface and the feedback time length of the providing terminal to the interface, and determining the calling performance of the interface;
Analyzing the calling end of the interface and the calling time of the interface by the calling end, and determining the association relation of the interface.
4. The method for generating an interface according to claim 3, wherein the analyzing the number of times the calling terminal calls the interface and the feedback duration of the providing terminal to the interface to determine the calling performance of the interface includes:
comparing the calling times with a preset calling times threshold value, comparing the feedback time length with a preset feedback time length threshold value, and determining a comparison result;
and determining the calling performance of the interface according to the comparison result.
5. The interface generation method according to claim 4, wherein the determining the calling performance of the interface according to the comparison result includes:
and in response to the calling times being greater than the preset calling times threshold value and the feedback time period being greater than the preset feedback time period threshold value, determining that the calling performance of the interface does not meet the calling condition.
6. The interface generating method according to claim 3, wherein the analyzing the calling time of the interface by the calling end and the calling end of the interface, determining the association relationship of the interface, includes:
Determining the time interval of the calling time of the calling end to different interfaces;
and determining that the different interfaces are associated interfaces in response to the time interval being smaller than a preset time interval threshold.
7. The method of generating an interface according to claim 6, wherein optimizing a plurality of the interfaces according to the calling performance and the association relation to generate a new interface comprises:
if the calling performance of the interface does not meet the calling condition, cutting the interface to obtain a cutting result;
if the different interfaces are associated interfaces, combining the different interfaces to obtain a combined result;
and generating the new interface according to the clipping result and the combination result.
8. An interface generating apparatus, comprising:
the calling information acquisition module is used for responding to a calling request of a calling end to a providing end and acquiring calling information of a plurality of interfaces;
the performance relation determining module is used for determining the calling performance of the interfaces according to the calling information and determining the association relation among a plurality of interfaces according to the calling information;
and the interface generating module is used for optimizing a plurality of interfaces according to the calling performance and the association relation to generate a new interface.
9. A computer readable storage medium having stored thereon a computer program, wherein the computer program when executed by a processor implements the interface generation method of any of claims 1-7.
10. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the interface generation method of any of claims 1-7 via execution of the executable instructions.
CN202310912050.6A 2023-07-24 2023-07-24 Interface generation method, device, storage medium and electronic equipment Pending CN116931918A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310912050.6A CN116931918A (en) 2023-07-24 2023-07-24 Interface generation method, device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310912050.6A CN116931918A (en) 2023-07-24 2023-07-24 Interface generation method, device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN116931918A true CN116931918A (en) 2023-10-24

Family

ID=88393841

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310912050.6A Pending CN116931918A (en) 2023-07-24 2023-07-24 Interface generation method, device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN116931918A (en)

Similar Documents

Publication Publication Date Title
CN110008045B (en) Method, device and equipment for aggregating microservices and storage medium
WO2021013242A1 (en) Method for starting mini program, device and computer storage medium
WO2021013247A1 (en) Method and device for running applet, and computer storage medium
CN111427701A (en) Workflow engine system and business processing method
US11934287B2 (en) Method, electronic device and computer program product for processing data
WO2021088671A1 (en) Method for calling terminal capability, device, and computer storage medium
CN108093036B (en) Method and device for acquiring resources
CN112084042A (en) Message processing method and device
WO2022062634A1 (en) Method, apparatus, device, and storage medium for integrating map service in service
CN114296953A (en) Multi-cloud heterogeneous system and task processing method
CN113191889A (en) Wind control configuration method, configuration system, electronic device and readable storage medium
CN113010238A (en) Permission determination method, device and system for micro application call interface
WO2024045646A1 (en) Method, apparatus and system for managing cluster access permission
CN113722007B (en) Configuration method, device and system of VPN branch equipment
CN116931918A (en) Interface generation method, device, storage medium and electronic equipment
CN113986391A (en) Request processing method, device, medium and computing equipment
CN114780361A (en) Log generation method, device, computer system and readable storage medium
CN114374657A (en) Data processing method and device
CN113946816A (en) Cloud service-based authentication method and device, electronic equipment and storage medium
CN113761433A (en) Service processing method and device
CN112994934A (en) Data interaction method, device and system
CN109471849B (en) Model processing method and device, storage medium and electronic equipment
CN113342759A (en) Content sharing method, device, equipment and storage medium
CN113779018A (en) Data processing method and device
CN111737218A (en) File sharing method and device

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