CN113590699B - Interface request processing method, system and computing device - Google Patents

Interface request processing method, system and computing device Download PDF

Info

Publication number
CN113590699B
CN113590699B CN202110796249.8A CN202110796249A CN113590699B CN 113590699 B CN113590699 B CN 113590699B CN 202110796249 A CN202110796249 A CN 202110796249A CN 113590699 B CN113590699 B CN 113590699B
Authority
CN
China
Prior art keywords
interface
cache
request
return value
parameter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110796249.8A
Other languages
Chinese (zh)
Other versions
CN113590699A (en
Inventor
李亮
张帆
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chezhi Interconnection Beijing Technology Co ltd
Original Assignee
Chezhi Interconnection Beijing Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chezhi Interconnection Beijing Technology Co ltd filed Critical Chezhi Interconnection Beijing Technology Co ltd
Priority to CN202110796249.8A priority Critical patent/CN113590699B/en
Publication of CN113590699A publication Critical patent/CN113590699A/en
Application granted granted Critical
Publication of CN113590699B publication Critical patent/CN113590699B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/258Data format conversion from or to a database

Abstract

The invention discloses an interface request processing method, which is executed in an interface management server and comprises the following steps: receiving interface requests of one or more request ends, and acquiring interface addresses and request parameters from the interface requests; determining the cache type corresponding to the interface, and if the cache type is list cache, then: splitting the request parameter into a plurality of parameter values, and requesting to acquire cache data corresponding to the plurality of parameter values from a cache server; if the cache data corresponding to one or more parameter values in the plurality of parameter values are not obtained, calling a corresponding interface based on the interface address and the one or more parameter values to obtain a return value of the interface; and aggregating the cached data and/or the returned value and returning to the request end. The invention also discloses a corresponding interface request processing system and a corresponding computing device. According to the technical scheme of the invention, unified management of a plurality of service end interfaces is realized, and the output format of the return value can be unified.

Description

Interface request processing method, system and computing device
Technical Field
The present invention relates to the field of computers and internet technologies, and in particular, to an interface request processing method, an interface request processing system, and a computing device.
Background
At present, the interface call of most systems is generally to directly call an interface, and the return value of the interface is directly used after corresponding anti-serialization operation. In the aspect of caching, direct caching is generally performed for interfaces which are relatively frequently accessed.
In the prior art, the get/post request is realized by packaging the Http related request tool class, the JSON tool class is used for carrying out corresponding reverse-serialization operation on the return value, the most original caching strategy or the caching strategy based on the AOP is used for caching the interface return value, the related processing of a third party interface (a third party system interface) is not carried out, and the calling, caching, preheating and the like of the interface are not uniformly managed.
Based on the prior art, when multiple systems call the same third party interface, because the return values of the interfaces are not uniformly cached, a single system can be repeatedly called, and multiple redundant codes are generated. The cache for each third party interface is maintained by a designated caller, and if a plurality of callers call at the same time, cache redundancy can be caused, and the cache is very troublesome to preheat, clean and the like. In addition, when the three-way interface involves the change of calling modes such as server migration domain name, parameter modification, return value change and the like, the prior use scene needs to be searched for each system based on the existing solution and is replaced by a new calling mode respectively, so that the whole modification process of the interface calling mode is very complicated, and the whole regression test is needed. In addition, when the three-way interface is not available due to system jitter or the like, the calling interfaces of the respective calling parties are affected.
For this reason, an interface request processing method is needed to solve the problems in the above technical solutions.
Disclosure of Invention
Accordingly, the present invention provides an interface request processing method, system, and computing device to solve or at least alleviate the above-identified problems.
According to an aspect of the present invention, there is provided an interface request processing method, which is executed in an interface management server connected to a cache server, the method comprising the steps of: receiving interface requests of one or more request ends, and acquiring interface addresses and request parameters from the interface requests; determining the cache type corresponding to the interface, and if the cache type is list cache, then: splitting the request parameter into a plurality of parameter values, and requesting to acquire cache data corresponding to the parameter values from the cache server; if the cache data corresponding to one or more parameter values in the plurality of parameter values are not acquired, calling a corresponding interface based on the interface address and the one or more parameter values to acquire a return value of the interface; and aggregating the cached data and/or the return value and returning to the request end.
Optionally, in the method for processing an interface request according to the present invention, the step of determining a cache type corresponding to the interface further includes: if the cache type is a common cache, requesting to acquire cache data corresponding to the request parameter value from a cache server; if the cache data is obtained, returning the cache data to a request end; and if the cache data is not acquired, calling a corresponding interface based on the interface address and the request parameter value to acquire a return value of the interface, and returning the return value to the request end.
Optionally, in the interface request processing method according to the present invention, after acquiring the return value of the interface, the method further includes the steps of: and storing the return value and the corresponding parameter value in the cache server in an associated mode, wherein the return value is cache data, and the parameter value is a corresponding cache key value.
Optionally, in the interface request processing method according to the present invention, after acquiring the return value of the interface, the method further includes the steps of: and determining a conversion processing mode corresponding to the interface, and converting the data format of the return value according to the conversion processing mode so as to output the return value based on the uniform data format.
Optionally, in the interface request processing method according to the present invention, the step of performing conversion processing on the data format of the return value according to the conversion processing mode includes: and calling a converter corresponding to the conversion processing mode to perform conversion processing on the data format of the return value.
Optionally, in the interface request processing method according to the present invention, the step of converting the data format of the return value further includes: and modifying the response result status code defined by the interface into a preset response result status code.
Optionally, in the method for processing an interface request according to the present invention, the step of determining a cache type corresponding to the interface includes: and acquiring an interface configuration table corresponding to the interface from a configuration platform, and determining a cache type corresponding to the interface according to the interface configuration table, wherein the cache type comprises list cache, common cache and non-cache.
Optionally, in the method for processing an interface request according to the present invention, the interface configuration table includes an interface name, an interface address, a cache type, and a conversion processing manner corresponding to an interface.
Optionally, in the interface request processing method according to the present invention, before storing the return value and the corresponding parameter value in association in the cache server, the method further includes the steps of: judging whether the interface starts cache compression or not, and if so, compressing the return value.
Optionally, in the interface request processing method according to the present invention, the method further includes the steps of: acquiring index data of each interface, and judging whether the interface is abnormal according to the index data; when the interface is determined to be abnormal, an alarm is triggered.
Optionally, in the method for processing an interface request according to the present invention, before receiving an interface request of one or more requesting ends, the method further includes the steps of: the current cache data in the cache server is cleaned up.
According to one aspect of the present invention, there is provided an interface request processing system including: comprising the following steps: an interface management server adapted to perform the method as described above; one or more request terminals connected with the interface management server and adapted to send interface requests to the interface management server; one or more service ends connected with the interface management server and adapted to provide interfaces; and the cache server is connected with the interface management server and is suitable for storing the return value of each interface as cache data.
Optionally, in the interface request processing system according to the present invention, further includes: and the configuration platform is connected with the interface management server and is suitable for configuration and generation of an interface configuration table corresponding to each interface.
According to one aspect of the invention, there is provided a computing device comprising: at least one processor; a memory storing program instructions, wherein the program instructions are configured to be adapted to be executed by the at least one processor, the program instructions comprising instructions for performing the interface request processing method as described above.
According to one aspect of the present invention, there is provided a readable storage medium storing program instructions that, when read and executed by a computing device, cause the computing device to perform the interface request processing method as described above.
According to the technical scheme of the invention, the interface request processing method and the system are provided, the unified management of interfaces of a plurality of service ends is realized based on the interface management server, any request end can send an interface request to the interface management server when calling the interfaces, the interface management server is used for uniformly processing the interface request, corresponding cache data are obtained from a cache based on request parameters, or when the cache is missed, the interface management server is used for calling corresponding service end interfaces to obtain an interface return value. Therefore, when the interface calling mode of the service end is changed, the interface calling mode is only updated in the interface management server, and modification in a plurality of request ends is not needed, so that the change of the interface calling mode is simpler and easier to realize. In addition, the invention avoids repeated calling of interfaces to cause multiple redundant data by uniformly caching the return values of the interfaces of each service end.
In addition, the invention carries out conversion processing on the return value of the interface according to the conversion processing mode corresponding to the interface so as to output the return value with the unified data format. Thus, the return value of the unified data format can be obtained no matter the request end calls any service interface.
The foregoing description is only an overview of the present invention, and is intended to be implemented in accordance with the teachings of the present invention in order that the same may be more clearly understood and to make the same and other objects, features and advantages of the present invention more readily apparent.
Drawings
To the accomplishment of the foregoing and related ends, certain illustrative aspects are described herein in connection with the following description and the annexed drawings, which set forth the various ways in which the principles disclosed herein may be practiced, and all aspects and equivalents thereof are intended to fall within the scope of the claimed subject matter. The above, as well as additional objects, features, and advantages of the present disclosure will become more apparent from the following detailed description when read in conjunction with the accompanying drawings. Like reference numerals generally refer to like parts or elements throughout the present disclosure.
FIG. 1 shows a schematic diagram of an interface request processing system 100 according to one embodiment of the invention;
FIG. 2 shows a schematic diagram of a computing device 200 according to one embodiment of the invention; and
FIG. 3 illustrates a flow diagram of an interface request processing method 300 according to one embodiment of the invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
FIG. 1 shows a schematic diagram of an interface request processing system 100 according to one embodiment of the invention.
As shown in fig. 1, the interface request processing system 100 includes one or more requesting terminals 110, an interface management server 120, one or more service terminals 130, and a cache server 140. The interface management server 120 is communicatively coupled to one or more of the requesting end 110 and one or more of the service end 130, respectively, such as by a wired or wireless network connection. Here, the service end 130 is a third party service end, each service end 130 may provide a corresponding interface (i.e. a third party interface), and the interface management server 120 may call the interface of the service end 130 to obtain an interface return value. The interface management server 120 is also communicatively connected to the cache server 140.
The request terminal 110, i.e., a terminal device that needs to call a service terminal interface, may send a request for calling the service terminal interface (hereinafter referred to as an "interface request") to the interface management server 120. The system can be specifically implemented as a personal computer such as a desktop computer, a notebook computer, a mobile phone, a tablet computer, a multimedia device, an intelligent wearable device, and the like, but is not limited thereto.
The interface management server 120 may implement unified management of interfaces of the plurality of service ends 130, and unified processing of interface requests. Specifically, the interface management server 120 may receive an interface request (a request to invoke a service-side interface) sent by one or more of the requesters 110, and the interface management server 120 may invoke an interface of the service-side 130 based on the interface request of the requester 110 to obtain an interface return value. In one embodiment, the interface management server 120 may store the return value of each interface in the cache server 140 as cache data, so that when the next processing of the interface request of the request end 110, the cache data corresponding to the request parameter in the interface request may be directly obtained from the cache server 140, without calling the interface again. In this way, redundant data of multiple branches caused by repeated calling of interfaces is avoided.
It should be noted that the present invention is not limited to the specific kind of interface management server 120. For example, the interface management server 120 may be implemented as a computing device such as a desktop computer, a notebook computer, a processor chip, a mobile phone, a tablet computer, etc., but is not limited thereto, and may be an application program residing on the computing device.
In one embodiment, the interface request processing system 100 further includes a configuration platform 125 coupled to the interface management server 120. By generating the interface configuration table corresponding to the interface of each service end 130 by configuring the configuration platform 125 in advance, the interface management server 120 can obtain the interface configuration table corresponding to the interface from the configuration platform 125 when processing the interface request, and process the interface request and the return value of the interface according to the interface configuration information in the interface configuration table. The interface configuration table includes various configuration information corresponding to the interface, including, for example, interface configuration information such as an interface name, an interface type, an interface address, an interface request method, a cache type, a cache time, whether or not to perform cache compression, a conversion processing method of a return value, and the like. Here, the present invention is not limited to the interface configuration information listed above.
In an embodiment of the present invention, the interface management server 120 is adapted to perform an interface request processing method. The interface request processing method 300 of the present invention will be described in detail below.
In one embodiment, the interface management server 120 of the present invention may be implemented as a computing device such that the interface request processing method of the present invention may be performed in the computing device.
FIG. 2 illustrates a block diagram of a computing device 200 according to one embodiment of the invention. As shown in FIG. 2, in a basic configuration 202, computing device 200 typically includes a system memory 206 and one or more processors 204. A memory bus 208 may be used for communication between the processor 204 and the system memory 206.
Depending on the desired configuration, the processor 204 may be any type of processing including, but not limited to: a microprocessor (UP), a microcontroller (UC), a digital information processor (DSP), or any combination thereof. Processor 204 may include one or more levels of cache, such as a first level cache 210 and a second level cache 212, a processor core 214, and registers 216. The example processor core 214 may include an Arithmetic Logic Unit (ALU), a Floating Point Unit (FPU), a digital signal processing core (DSP core), or any combination thereof. The example memory controller 218 may be used with the processor 204, or in some implementations, the memory controller 218 may be an internal part of the processor 204.
Depending on the desired configuration, system memory 206 may be any type of memory including, but not limited to: volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory, etc.), or any combination thereof. The system memory 106 may include an operating system 220, one or more applications 222, and program data 224. The application 222 is in effect a plurality of program instructions for instructing the processor 204 to perform a corresponding operation. In some implementations, the application 222 can be arranged to cause the processor 204 to operate with the program data 224 on an operating system.
Computing device 200 may also include a storage interface bus 234. Storage interface bus 234 enables communication from storage devices 232 (e.g., removable storage 236 and non-removable storage 238) to base configuration 202 via bus/interface controller 230. At least a portion of the operating system 220, applications 222, and data 224 may be stored on removable storage 236 and/or non-removable storage 238 and loaded into the system memory 206 via the storage interface bus 234 and executed by the one or more processors 204 when the computing device 200 is powered up or the application 222 is to be executed.
Computing device 200 may also include an interface bus 240 that facilitates communication from various interface devices (e.g., output devices 242, peripheral interfaces 244, and communication devices 246) to basic configuration 202 via bus/interface controller 230. The example output device 242 includes a graphics processing unit 248 and an audio processing unit 250. They may be configured to facilitate communication with various external devices, such as a display or speakers, via one or more a/V ports 252. The example peripheral interface 244 may include a serial interface controller 254 and a parallel interface controller 256, which may be configured to facilitate communication via one or more I/O ports 258 and external devices such as input devices (e.g., keyboard, mouse, pen, voice input device, touch input device) or other peripherals (e.g., printer, scanner, etc.). The example communication device 246 may include a network controller 260 that may be arranged to facilitate communication with one or more other computing devices 262 over a network communication link via one or more communication ports 264.
The network communication link may be one example of a communication medium. Communication media may typically be embodied by computer readable instructions, data structures, program modules, and may include any information delivery media in a modulated data signal, such as a carrier wave or other transport mechanism. A "modulated data signal" may be a signal that has one or more of its data set or changed in such a manner as to encode information in the signal. By way of non-limiting example, communication media may include wired media such as a wired network or special purpose network, and wireless media such as acoustic, radio Frequency (RF), microwave, infrared (IR) or other wireless media. The term computer readable media as used herein may include both storage media and communication media.
In the computing device 200 according to the present invention, the application 222 includes a plurality of program instructions for executing the interface request processing method 300, which may instruct the processor 204 to execute the interface request processing method 300 of the present invention, so that the computing device 200 executes the interface request processing method 300 of the present invention.
FIG. 3 illustrates a flow diagram of an interface request processing method 300 according to one embodiment of the invention. The method 300 is adapted to be executed in an interface management server 120 (e.g., the aforementioned computing device 200). As shown in fig. 3, the method 300 begins at step S310.
It should be noted that, the interface management server 120 is connected to one or more request ends 110 that need to call the third party interface, and is connected to one or more service ends 130 that provide the interface call service, where each service end 130 may provide a corresponding interface.
According to one embodiment, the interface management server 120 is connected to the configuration platform 125, where the configuration platform 125 may be configured to generate an interface configuration table corresponding to the interface (i.e., the third party interface) of each service end 130, where the interface configuration table includes various configuration information corresponding to the interface, including, for example, interface configuration information such as an interface name, an interface type, an interface address, an interface request mode, a cache type, a cache time, whether to perform cache compression, a conversion processing mode of a return value, and the like. Here, the present invention is not limited to the interface configuration information listed above.
As shown in fig. 3, in step S310, an interface request sent by one or more requesters 110 is received, and an interface address and a request parameter are obtained from the interface request. Here, the interface request is a request that the requesting end invokes the service end interface.
Subsequently, in step S320, a cache type corresponding to the interface is determined.
In one embodiment, the interface management server 120 may determine the cache type corresponding to the interface based on the interface configuration table by retrieving the interface configuration table corresponding to the interface from the configuration platform 125. Here, the cache type may include, for example, list cache, normal cache, and no cache. It should be noted that, the normal cache is to store a single parameter value and a corresponding return value in association with respect to an interface called based on the single parameter value (the request parameter corresponding to the interface includes one parameter value), and one parameter value corresponds to one cache value. The list cache is a cache structure defined for interfaces capable of being queried in batches, the request parameters corresponding to the interfaces capable of being queried in batches comprise a plurality of parameter values, after the interfaces are called based on the request parameters formed by combining the plurality of parameter values, the acquired interface return results are split and cached, namely, each parameter value in the request parameters is respectively stored in association with one return value after splitting the return results by adopting the list structure, and the plurality of parameter values in the request parameters and the corresponding plurality of return values are combined into a cache list. Thus, the cache hit rate is advantageously improved. In addition, the non-caching is used for some interfaces without caching the return value, for example, for interfaces with high real-time requirements of Get requests on the return value, a non-caching strategy is adopted.
If it is determined that the cache type corresponding to the interface is a list cache, the following step S330 is performed.
In step S330, the request parameter is split into a plurality of parameter values, and the cache server is requested to obtain cache data corresponding to the plurality of parameter values, respectively. Here, each parameter value is a key value or a part of a key value to request to acquire cache data corresponding to the parameter value from the cache server. If the cache data corresponding to each of the plurality of parameter values is obtained from the cache server, that is, all of the plurality of parameter values hit the cache, the cache data corresponding to each of the plurality of parameter values obtained from the cache server may be directly aggregated, and the aggregated cache data may be returned to the corresponding request terminal 110. So that the request source interface (i.e., the interface provided by the service end 130) is not required.
In addition, if cache data corresponding to one or more parameter values of the plurality of parameter values is not acquired from the cache server (one or more parameter values do not hit the cache), step S340 is performed. In step S340, the corresponding service-side interface is invoked based on the interface address and one or more parameter values in the interface request to obtain a return value of the interface. It should be noted that, by taking the difference between the original plurality of parameter values in the request parameters and the parameter values of the hit cache, one or more parameter values that need to call the service interface may be obtained, and further, by combining the one or more parameter values into a new request parameter, the interface management server 120 calls the service interface based on the new request parameter.
Subsequently, step S350 is executed, where the cached data obtained in step S330 and/or the return value obtained in step S340 are aggregated, and the aggregated result is returned to the request end 110. It should be understood that if the cache data corresponding to all the parameter values are obtained from the cache server, the obtained cache data are aggregated and returned to the request end; if the cache data corresponding to a part of the parameter values are not obtained, after the corresponding return values are obtained through the calling interface, aggregating all the obtained cache data and the return values of the interface, and returning the aggregation result to the request end 110; if the cache data corresponding to any one parameter value is not acquired, acquiring a return value corresponding to each parameter value through a calling interface, and then aggregating all acquired return values and returning to the request end.
According to one embodiment, if it is determined in step S320 that the cache type corresponding to the interface is a normal cache (the request parameter of the interface includes only one parameter), the cache data corresponding to the request parameter value is requested to be obtained from the cache server 140, and if the cache data is obtained from the cache server 140, i.e. hit in the cache, the cache data is returned to the requesting terminal 110. And if the cache data is not acquired, calling a corresponding service end interface based on the interface address and the request parameter value to acquire a return value of the interface, and returning the return value of the interface to the request end. Here, it is understood that the return value obtained by calling the interface based on the single parameter value may be directly returned to the request end 110 without performing the aggregation process.
According to one embodiment, when the cache type of the interface is a list cache or a normal cache, the interface management server 120 further stores the return value in association with the corresponding parameter value in the cache server 140 after obtaining the return value of the service-side interface. Here, the return value is stored as cached data, the parameter value as a corresponding cached key value or as part of a cached key value. It should be noted that, by caching the return value of the interface, the interface management server 120 may directly obtain the cache data corresponding to the request parameter from the cache server 140, without calling the interface again, when the next time the interface management server processes the interface request sent by the request end 110 based on the same request parameter. Therefore, redundant data of multiple branches caused by repeated calling of the interface is avoided.
It should be noted that, according to the foregoing description of the normal cache and the list cache, if the corresponding service-side interface is called based on a single request parameter value (single parameter value), and the return value of the interface is obtained, the return value and the request parameter value may be directly stored in the cache server 140 in association. If the interface is called based on the request parameter combined by a plurality of parameter values, splitting the acquired interface return result into return values corresponding to each parameter value, and storing each parameter value in the request parameter in association with a corresponding split return value by adopting a list structure.
It should be understood that the invention can avoid repeated calling of interfaces to cause multiple redundant codes by uniformly caching the return values of the interfaces of each service end.
According to one embodiment, before storing the return value and the corresponding parameter value in association in the cache server 140, the interface management server 120 further determines whether the interface starts cache compression, and if the cache compression is started, performs compression processing on the return value, and stores the return value after the compression processing in the cache server 140. Here, the interface management server 120 may determine whether the interface starts the buffer compression according to the interface configuration table corresponding to the interface.
According to one embodiment, after obtaining the return value of the service-side interface, the interface management server 120 further determines a conversion processing manner corresponding to the interface according to the interface configuration table, and further performs conversion processing on the data format of the return value according to the determined conversion processing manner, so as to unify the data format of the return value and output the unified data format, so that the return value of any interface is stored in the unified data format in the cache server 140 and returned to the request side 110. Thus, no matter the request end calls any service interface, the return value of the unified data format can be obtained.
According to one embodiment, after determining the conversion processing mode corresponding to the interface, a converter corresponding to the conversion processing mode may be called to perform conversion processing on the data format of the return value. Specifically, by judging whether a converter matched with the conversion processing mode exists, if so, calling the matched converter, converting the data format of the return value by using the converter, and acquiring a result returned by the converter after converting the data format of the return value.
In addition, in one embodiment, the step of converting the data format of the return value further includes: the response result status code defined by the interface of the service side is modified to a predetermined response result status code predefined by the interface management server 120. Specifically, when the interface response is successful, the response success status code is uniformly modified to a predetermined response success status code predefined by the interface management server 120. For example, in the original return value defined by the service interface, the successful state code of the interface response is code 200. And the predetermined response success status code predefined by the interface management server 120 is return code:0, the response success status code of the service side interface is modified to return code:0. Thus, for any return value of the service-side interface, after conversion via the interface management server 120, a target return value of the unified data format, unified status code, can be output.
According to one embodiment, the interface management server 120 may also obtain index data of the interface of each service end 130. Whether the interface is abnormal or not is judged by analyzing index data of the interface, for example, whether cache service of a return value of the interface is abnormal or not can be judged. When the interface is determined to be abnormal, an alarm is triggered. Here, the alert information may be sent to one or more client applications for the user to view the alert information and to handle the abnormal situation in a timely manner. In one embodiment, after the index data of each interface is obtained, the interface management server 120 may upload the index data to a designated server for unified analysis, so as to determine an abnormal state of each interface.
According to one embodiment, before performing step S310 of the method, that is, before receiving the interface request of one or more requesting ends, a cache cleaning operation may be performed for the service interface, to clean up the existing current cache data corresponding to the interface in the cache server 140.
In addition, before executing step S310 of the method, a buffer preheating process may be performed, and before receiving an interface request of the request end, interfaces of one or more service ends are called in advance, and a return value of the interfaces is buffered in advance.
According to the method 300 of the invention, the unified management of the interfaces of a plurality of service ends is realized based on the interface management server, any request end can send an interface request to the interface management server when calling the interfaces, the interface management server processes the interface request in a unified way, corresponding cache data are obtained from the cache based on request parameters, or when the cache is missed, the interface management server calls the corresponding service end interface to obtain the interface return value. Therefore, when the interface calling mode of the service end is changed, the interface calling mode is only updated in the interface management server, and modification in a plurality of request ends is not needed, so that the change of the interface calling mode is simpler and easier to realize. In addition, the invention avoids repeated calling of interfaces to cause multiple redundant codes by uniformly caching the return values of the interfaces of each service end.
In addition, the invention carries out conversion processing on the return value of the interface according to the conversion processing mode corresponding to the interface so as to output the return value with the unified data format. Thus, the return value of the unified data format can be obtained no matter the request end calls any service interface.
The various techniques described herein may be implemented in connection with hardware or software or, alternatively, with a combination of both. Thus, the methods and apparatus of the present invention, or certain aspects or portions of the methods and apparatus of the present invention, may take the form of program code (i.e., instructions) embodied in tangible media, such as removable hard drives, U-drives, floppy diskettes, CD-ROMs, or any other machine-readable storage medium, wherein, when the program is loaded into and executed by a machine, such as a computer, the machine becomes an apparatus for practicing the invention.
In the case of program code execution on programmable computers, the mobile terminal will generally include a processor, a storage medium readable by the processor (including volatile and non-volatile memory and/or storage elements), at least one input device, and at least one output device. Wherein the memory is configured to store program code; the processor is configured to execute the interface request processing method of the present invention in accordance with instructions in said program code stored in the memory.
By way of example, and not limitation, readable media comprise readable storage media and communication media. The readable storage medium stores information such as computer readable instructions, data structures, program modules, or other data. Communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. Combinations of any of the above are also included within the scope of readable media.
In the description provided herein, algorithms and displays are not inherently related to any particular computer, virtual system, or other apparatus. Various general-purpose systems may also be used with examples of the invention. The required structure for a construction of such a system is apparent from the description above. In addition, the present invention is not directed to any particular programming language. It will be appreciated that the teachings of the present invention described herein may be implemented in a variety of programming languages, and the above description of specific languages is provided for disclosure of enablement and best mode of the present invention.
In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be construed as reflecting the intention that: i.e., the claimed invention requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules or units or components of the devices in the examples disclosed herein may be arranged in a device as described in this embodiment, or alternatively may be located in one or more devices different from the devices in this example. The modules in the foregoing examples may be combined into one module or may be further divided into a plurality of sub-modules.
Those skilled in the art will appreciate that the modules in the apparatus of the embodiments may be adaptively changed and disposed in one or more apparatuses different from the embodiments. The modules or units or components of the embodiments may be combined into one module or unit or component and, furthermore, they may be divided into a plurality of sub-modules or sub-units or sub-components. Any combination of all features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or units of any method or apparatus so disclosed, may be used in combination, except insofar as at least some of such features and/or processes or units are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings), may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features but not others included in other embodiments, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments can be used in any combination.
Furthermore, some of the embodiments are described herein as methods or combinations of method elements that may be implemented by a processor of a computer system or by other means of performing the functions. Thus, a processor with the necessary instructions for implementing the described method or method element forms a means for implementing the method or method element. Furthermore, the elements of the apparatus embodiments described herein are examples of the following apparatus: the apparatus is for carrying out the functions performed by the elements for carrying out the objects of the invention.
As used herein, unless otherwise specified the use of the ordinal terms "first," "second," "third," etc., to describe a general object merely denote different instances of like objects, and are not intended to imply that the objects so described must have a given order, either temporally, spatially, in ranking, or in any other manner.
While the invention has been described with respect to a limited number of embodiments, those skilled in the art, having benefit of the above description, will appreciate that other embodiments are contemplated within the scope of the invention as described herein. Furthermore, it should be noted that the language used in the specification has been principally selected for readability and instructional purposes, and may not have been selected to delineate or circumscribe the inventive subject matter. Accordingly, many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the appended claims. The disclosure of the present invention is intended to be illustrative, but not limiting, of the scope of the invention, which is defined by the appended claims.

Claims (15)

1. An interface request processing method, executed in an interface management server, the interface management server being connected to a cache server, the method comprising the steps of:
receiving interface requests of one or more request ends, and acquiring interface addresses and request parameters from the interface requests;
determining a cache type corresponding to the interface, and if the cache type is a list cache, wherein the list cache is a cache structure defined for the batch-queried interface, and the request parameters corresponding to the batch-queried interface comprise a plurality of parameter values, then:
splitting the request parameter into a plurality of parameter values, and requesting to acquire cache data corresponding to the parameter values from the cache server;
if the cache data corresponding to one or more parameter values in the plurality of parameter values are not acquired, calling a corresponding interface based on the interface address and the one or more parameter values to acquire a return value of the interface, wherein the original plurality of parameter values in the request parameter and the parameter values hitting the cache are subjected to difference set to obtain one or more parameter values needing to call the interface, and the one or more parameter values are combined into a new request parameter so as to call the interface based on the new request parameter; and
and aggregating the cache data and/or the return value and returning to the request end.
2. The method of claim 1, wherein determining the cache type to which the interface corresponds further comprises:
if the cache type is a common cache, requesting to acquire cache data corresponding to the requested parameter value from a cache server, wherein the common cache is used for storing a single parameter value and a corresponding return value in an associated manner aiming at an interface called based on the single parameter value, and one parameter value corresponds to one cache value;
if the cache data is obtained, returning the cache data to a request end;
and if the cache data is not acquired, calling a corresponding interface based on the interface address and the request parameter value to acquire a return value of the interface, and returning the return value to the request end.
3. The method of claim 1, wherein after obtaining the return value of the interface, further comprising the steps of:
and storing the return value and the corresponding parameter value in the cache server in an associated mode, wherein the return value is cache data, and the parameter value is a corresponding cache key value.
4. A method according to any of claims 1-3, wherein after obtaining the return value of the interface, further comprising the step of:
and determining a conversion processing mode corresponding to the interface, and converting the data format of the return value according to the conversion processing mode so as to output the return value based on the uniform data format.
5. The method of claim 4, wherein the converting the data format of the return value according to the converting means comprises:
and calling a converter corresponding to the conversion processing mode to perform conversion processing on the data format of the return value.
6. The method of claim 4, wherein converting the data format of the return value further comprises:
and modifying the response result status code defined by the interface into a preset response result status code.
7. The method of claim 2, wherein determining the cache type to which the interface corresponds comprises:
and acquiring an interface configuration table corresponding to the interface from a configuration platform, and determining a cache type corresponding to the interface according to the interface configuration table, wherein the cache type comprises list cache, common cache and non-cache.
8. The method of claim 7, wherein the interface configuration table includes an interface name, an interface address, a cache type, and a conversion processing manner corresponding to an interface.
9. A method as claimed in claim 3, wherein prior to storing the return value and corresponding parameter value in association in the cache server, further comprising the step of:
judging whether the interface starts cache compression or not, and if so, compressing the return value.
10. A method according to any one of claims 1-3, further comprising the step of:
acquiring index data of each interface, and judging whether the interface is abnormal according to the index data;
when the interface is determined to be abnormal, an alarm is triggered.
11. A method according to any of claims 1-3, wherein prior to receiving the interface request of the one or more requesting terminals, further comprising the step of:
the current cache data in the cache server is cleaned up.
12. An interface request processing system, comprising:
an interface management server adapted to perform the method of any of claims 1-11;
one or more request terminals connected with the interface management server and adapted to send interface requests to the interface management server;
one or more service ends connected with the interface management server and adapted to provide interfaces; and
and the cache server is connected with the interface management server and is suitable for storing the return value of each interface as cache data.
13. The system of claim 12, further comprising:
and the configuration platform is connected with the interface management server and is suitable for configuration and generation of an interface configuration table corresponding to each interface.
14. A computing device, comprising:
at least one processor; and
a memory storing program instructions, wherein the program instructions are configured to be adapted to be executed by the at least one processor, the program instructions comprising instructions for performing the interface request processing method of any of claims 1-11.
15. A readable storage medium storing program instructions which, when read and executed by a computing device, cause the computing device to perform the interface request processing method of any of claims 1-11.
CN202110796249.8A 2021-07-14 2021-07-14 Interface request processing method, system and computing device Active CN113590699B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110796249.8A CN113590699B (en) 2021-07-14 2021-07-14 Interface request processing method, system and computing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110796249.8A CN113590699B (en) 2021-07-14 2021-07-14 Interface request processing method, system and computing device

Publications (2)

Publication Number Publication Date
CN113590699A CN113590699A (en) 2021-11-02
CN113590699B true CN113590699B (en) 2023-12-01

Family

ID=78247361

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110796249.8A Active CN113590699B (en) 2021-07-14 2021-07-14 Interface request processing method, system and computing device

Country Status (1)

Country Link
CN (1) CN113590699B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115495398B (en) * 2022-09-28 2023-06-30 北京亚控科技发展有限公司 Interface resource operation method, device, electronic equipment and storage medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101021875A (en) * 2007-03-22 2007-08-22 金蝶软件(中国)有限公司 Object-oriented data bank access method and system
CN102542368A (en) * 2010-12-13 2012-07-04 金蝶软件(中国)有限公司 Cache system access method and device
US9407726B1 (en) * 2013-03-15 2016-08-02 Juniper Networks, Inc. Caching objects identified by dynamic resource identifiers
CN107689977A (en) * 2016-08-05 2018-02-13 厦门雅迅网络股份有限公司 Distributed caching and the method for routing and its system of push
CN108282405A (en) * 2017-12-27 2018-07-13 努比亚技术有限公司 Application programming interfaces buffer memory management method, application server and storage medium
CN110062274A (en) * 2019-04-30 2019-07-26 深圳市迅雷网络技术有限公司 A kind of video file caching method, device, equipment and readable storage medium storing program for executing
CN110442309A (en) * 2019-07-24 2019-11-12 广东紫晶信息存储技术股份有限公司 A kind of cold and hot method for interchanging data and system based on optical storage
CN111092877A (en) * 2019-12-12 2020-05-01 北京金山云网络技术有限公司 Data processing method and device, electronic equipment and storage medium
CN111352741A (en) * 2018-12-21 2020-06-30 马上消费金融股份有限公司 Interface calling method and device, intelligent terminal and storage device
CN112187904A (en) * 2020-09-22 2021-01-05 四川长虹电器股份有限公司 Parameter decryption method and system based on multimedia system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8984311B2 (en) * 2011-12-30 2015-03-17 Intel Corporation Method, apparatus, and system for energy efficiency and energy conservation including dynamic C0-state cache resizing

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101021875A (en) * 2007-03-22 2007-08-22 金蝶软件(中国)有限公司 Object-oriented data bank access method and system
CN102542368A (en) * 2010-12-13 2012-07-04 金蝶软件(中国)有限公司 Cache system access method and device
US9407726B1 (en) * 2013-03-15 2016-08-02 Juniper Networks, Inc. Caching objects identified by dynamic resource identifiers
CN107689977A (en) * 2016-08-05 2018-02-13 厦门雅迅网络股份有限公司 Distributed caching and the method for routing and its system of push
CN108282405A (en) * 2017-12-27 2018-07-13 努比亚技术有限公司 Application programming interfaces buffer memory management method, application server and storage medium
CN111352741A (en) * 2018-12-21 2020-06-30 马上消费金融股份有限公司 Interface calling method and device, intelligent terminal and storage device
CN110062274A (en) * 2019-04-30 2019-07-26 深圳市迅雷网络技术有限公司 A kind of video file caching method, device, equipment and readable storage medium storing program for executing
CN110442309A (en) * 2019-07-24 2019-11-12 广东紫晶信息存储技术股份有限公司 A kind of cold and hot method for interchanging data and system based on optical storage
CN111092877A (en) * 2019-12-12 2020-05-01 北京金山云网络技术有限公司 Data processing method and device, electronic equipment and storage medium
CN112187904A (en) * 2020-09-22 2021-01-05 四川长虹电器股份有限公司 Parameter decryption method and system based on multimedia system

Also Published As

Publication number Publication date
CN113590699A (en) 2021-11-02

Similar Documents

Publication Publication Date Title
CN108566290B (en) Service configuration management method, system, storage medium and server
CN111651464B (en) Data processing method, system and computing device
CN113329069B (en) Instant messaging method, system and computing device
US10860398B2 (en) Adapting legacy endpoints to modern APIs
WO2019041738A1 (en) Client resource obtaining method and apparatus, terminal device, and storage medium
WO2018054170A1 (en) Browser resources pre-pulling method, terminal and storage medium
CN109992406B (en) Picture request method, picture request response method and client
US9223672B1 (en) Method and system for providing error repair status data to an application user
CN111177664B (en) Watermark information adding method, server and system
CN113419824A (en) Data processing method, device, system and computer storage medium
CN110943934A (en) Service request processing method, system, terminal and readable storage medium
CN113590699B (en) Interface request processing method, system and computing device
CN104994183A (en) Short network address determining method and device
CN111526181B (en) Data request processing method and system and computing device
CN110795343A (en) Test system, test method and computing device
CN109495556B (en) File processing method and device
CN111414383B (en) Data request method, data processing system and computing device
CN110784553B (en) Message encapsulation method, device and domain name resolution system
CN112732468A (en) Data processing method, data interaction system and computing equipment
CN109561152B (en) Data access request response method, device, terminal and storage medium
CN111294377A (en) Network request sending method of dependency relationship, terminal device and storage medium
CN113377563B (en) Webpage monitoring method and computing device
CN113300895A (en) Cable processing method and system and computing device
CN112671843A (en) Data request method, system and computing device
CN114884974B (en) Data multiplexing method, system and computing 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
GR01 Patent grant
GR01 Patent grant