CN113590699A - Interface request processing method and system and computing equipment - Google Patents

Interface request processing method and system and computing equipment Download PDF

Info

Publication number
CN113590699A
CN113590699A CN202110796249.8A CN202110796249A CN113590699A CN 113590699 A CN113590699 A CN 113590699A CN 202110796249 A CN202110796249 A CN 202110796249A CN 113590699 A CN113590699 A CN 113590699A
Authority
CN
China
Prior art keywords
interface
cache
request
return value
management server
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.)
Granted
Application number
CN202110796249.8A
Other languages
Chinese (zh)
Other versions
CN113590699B (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 HULIAN (BEIJING) SCIENCE & TECHNOLOGY CO LTD
Original Assignee
CHEZHI HULIAN (BEIJING) SCIENCE & 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 HULIAN (BEIJING) SCIENCE & TECHNOLOGY CO LTD filed Critical CHEZHI HULIAN (BEIJING) SCIENCE & 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

Images

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

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 terminals, 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 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 a cache server; if 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 cache data and/or the return value and returning the aggregated cache data and/or the return value 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, the unified management of a plurality of service end interfaces is realized, and the value output format can be uniformly returned.

Description

Interface request processing method and system and computing equipment
Technical Field
The present invention relates to the field of computer and internet technologies, and in particular, to an interface request processing method, an interface request processing system, and a computing device.
Background
At present, most of system interface calls are generally direct interfaces, and return values of the interfaces are directly used after corresponding deserialization operation. In the aspect of caching, direct caching processing is generally performed on an interface with relatively frequent access.
In the prior art, requests such as get/post and the like are realized by packaging Http related request tool classes, JSON tool classes are used for performing corresponding deserialization operations on return values of the requests, the most original cache policy or the cache policy based on AOP is used for caching the interface return values, no related processing is performed on a third-party interface (third-party system interface), and no uniform management is performed on the calling, caching, preheating and the like of the interface.
Based on the prior art scheme, when a plurality of systems call the same third-party interface, because the return values of the interfaces are not cached uniformly, the single system can be called repeatedly, and a plurality of redundant codes are generated. The cache for each third-party interface is maintained at a designated calling party, if a plurality of calling parties call simultaneously, cache redundancy is caused, and preheating, cleaning and the like of the cache are very troublesome. In addition, when the three-party interface involves the change of calling modes such as the migration of domain names, the modification of parameters, the change of return values and the like of the server, the previous using scene needs to be searched for each system based on the existing solution, and the system needs to be respectively replaced by a new calling mode, so that the whole modification process of the interface calling mode is very complicated, and a full regression test needs to be carried out. In addition, when the three-party interface is unavailable due to system jitter and the like, the calling of the interface by each calling party is influenced.
Therefore, an interface request processing method is needed to solve the problems in the above technical solutions.
Disclosure of Invention
To this end, the present invention provides an interface request processing method, system and computing device to solve or at least alleviate the above existing problems.
According to an aspect of the present invention, there is provided an interface request processing method, executed in an interface management server, the interface management server being connected to a cache server, the method including the steps of: receiving interface requests of one or more request terminals, 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 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 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 cache data and/or the return value and returning the aggregated cache data and/or the return value to the request end.
Optionally, in the interface request processing method according to the present invention, the step of determining the 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 the request end; 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 obtaining the return value of the interface, the method further includes the steps of: and storing the return value and the corresponding parameter value into the cache server in an associated manner, 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 obtaining 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 a 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 convert 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 state code defined by the interface into a preset response result state code.
Optionally, in the interface request processing method according to the present invention, the step of determining the 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 no cache.
Optionally, in the interface request processing method according to the present invention, the interface configuration table includes an interface name, an interface address, a cache type, and a conversion processing mode corresponding to the interface.
Optionally, in the interface request processing method according to the present invention, before storing the return value and the corresponding parameter value in the cache server in association, the method further includes the steps of: and judging whether the interface starts cache compression or not, and if the interface starts the cache compression, compressing the return value.
Optionally, in the interface request processing method according to the present invention, further comprising: acquiring index data of each interface, and judging whether the interface is abnormal or not according to the index data; and triggering an alarm when the interface is determined to be abnormal.
Optionally, in the interface request processing method according to the present invention, before receiving the interface requests of one or more request terminals, the method further includes the steps of: and clearing current cache data in the cache server.
According to an aspect of the present invention, there is provided an interface request processing system including: the method comprises the following steps: an interface management server adapted to perform the method as described above; one or more request terminals connected to the interface management server and adapted to send interface requests to the interface management server; one or more service terminals connected to the interface management server and adapted to provide an interface; 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 comprising: and the configuration platform is connected with the interface management server and is suitable for configuring and generating an interface configuration table corresponding to each interface.
According to an aspect of the invention, there is provided a computing device comprising: at least one processor; a memory storing program instructions configured to be executed by the at least one processor, the program instructions including instructions for performing the interface request processing method as described above.
According to an 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 interface request processing system are provided, the interface management server is used for realizing the unified management of the interfaces of a plurality of service terminals, any request terminal can send the interface request to the interface management server when calling the interface, the interface management server is used for processing the interface request in a unified mode, corresponding cache data are obtained from a cache based on request parameters, or the interface management server is used for calling the corresponding service terminal interface to obtain an interface return value when the cache is not hit. Therefore, when the interface calling mode of the service end is changed, the interface calling mode is updated only at the interface management server, and modification at 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 performs unified cache on the return value of each service end interface, thereby avoiding multiple redundant data caused by repeatedly calling the interfaces.
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 in the uniform data format. Therefore, no matter the request terminal calls any service interface, the return value with the uniform data format can be obtained.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
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 are indicative of various ways in which the principles disclosed herein may be practiced, and all aspects and equivalents thereof are intended to be within the scope of the claimed subject matter. The above and other objects, features and advantages of the present disclosure will become more apparent from the following detailed description read in conjunction with the accompanying drawings. Throughout this disclosure, like reference numerals generally refer to like parts or elements.
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 shows 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 request 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 connected to one or more request terminals 110 and one or more service terminals 130, respectively, for example, through 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. Also, the interface management server 120 is communicatively connected to the cache server 140.
The request end 110, i.e. the terminal device that needs to invoke the service end interface, may send a request for invoking the service end interface (hereinafter referred to as "interface request") to the interface management server 120. The mobile phone can be specifically implemented as a personal computer such as a desktop computer and a notebook computer, and can also be a mobile phone, a tablet computer, multimedia equipment, intelligent wearable equipment, and the like, but is not limited thereto.
The interface management server 120 may implement unified management of the interfaces of the multiple service terminals 130 and unified processing of the interface requests. Specifically, the interface management server 120 may receive an interface request (a request for invoking an interface of the service terminal) sent by one or more request terminals 110, and the interface management server 120 may invoke an interface of the service terminal 130 based on the interface request of the request terminal 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 interface request of the request end 110 is processed next time, 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. Therefore, multi-division redundant data caused by repeated calling of the interface is avoided.
It should be noted that the present invention is not limited to a specific kind of the 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 also 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 configuring and generating the interface configuration table corresponding to the interface of each service end 130 in the configuration platform 125 in advance, the interface management server 120 can acquire 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. Here, the interface configuration table includes various configuration information corresponding to the interface, for example, interface configuration information including an interface name, an interface type, an interface address, an interface request method, a cache type, cache time, whether 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, so that the interface request processing method of the present invention may be executed in the computing device.
FIG. 2 shows 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, a 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. The processor 204 may include one or more levels of cache, such as a level one cache 210 and a level two cache 212, a processor core 214, and registers 216. Example processor cores 214 may include Arithmetic Logic Units (ALUs), Floating Point Units (FPUs), digital signal processing cores (DSP cores), 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. System memory 106 may include an operating system 220, one or more applications 222, and program data 224. The application 222 is actually a plurality of program instructions that direct the processor 204 to perform corresponding operations. In some embodiments, application 222 may be arranged to cause processor 204 to operate with program data 224 on an operating system.
Computing device 200 may also include a storage interface bus 234. The storage interface bus 234 enables communication from the storage devices 232 (e.g., removable storage 236 and non-removable storage 238) to the basic configuration 202 via the 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 system memory 206 via storage interface bus 234 and executed by the one or more processors 204 when the computing device 200 is powered on or the applications 222 are 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 the basic configuration 202 via the 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. Example peripheral interfaces 244 can include a serial interface controller 254 and a parallel interface controller 256, which can be configured to facilitate communications with 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.) via one or more I/O ports 258. An example communication device 246 may include a network controller 260, which may be arranged to facilitate communications with one or more other computing devices 262 over a network communication link via one or more communication ports 264.
A 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, such as carrier waves or other transport mechanisms, in a modulated data signal. A "modulated data signal" may be a signal that has one or more of its data set or its changes made in a manner that encodes information in the signal. By way of non-limiting example, communication media may include wired media such as a wired network or private-wired network, and various 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 a computing device 200 according to the present invention, the application 222 includes a plurality of program instructions that perform the interface request processing method 300, which may instruct the processor 204 to perform the interface request processing method 300 of the present invention such that the computing device 200 performs the interface request processing method 300 of the present invention.
FIG. 3 shows a flow diagram of an interface request processing method 300 according to one embodiment of the invention. The method 300 is suitable for execution in an interface management server 120, such as 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 terminals 110 that need to call a third-party interface, and is connected to one or more service terminals 130 that provide an interface call service, and each service terminal 130 can provide a corresponding interface.
According to an embodiment, the interface management server 120 is connected to the configuration platform 125, and the configuration platform 125 may configure and generate an interface configuration table corresponding to an interface (i.e., a third-party interface) of each service end 130, where the interface configuration table includes various configuration information corresponding to the interface, for example, interface configuration information including an interface name, an interface type, an interface address, an interface request manner, a cache type, a cache time, whether to perform cache compression, a conversion processing manner 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 request terminals 110 is received, and an interface address and request parameters are obtained from the interface request. Here, the interface request is a request for the request side to call the service side interface.
Subsequently, in step S320, the 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, no cache. It should be noted that, in the ordinary cache, for an interface called based on a single parameter value (a request parameter corresponding to the interface includes one parameter value), the single parameter value and a corresponding return value are stored in association, and one parameter value corresponds to one cache value. The list cache is a cache structure defined by aiming at interfaces capable of being queried in batches, 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 combined by the parameter values, obtained interface return results are split and cached, namely, the list structure is adopted, each parameter value in the request parameters is respectively and associatively stored with one return value obtained after the return results are split, and the parameter values in the request parameters and the corresponding return values are combined into a cache list. Thus, the cache hit rate is improved. In addition, the non-caching is performed when some interfaces do not need to cache the return value, for example, for an interface with a high requirement on the real-time performance of the return value by the Get request, a non-caching strategy is adopted.
If it is determined that the cache type corresponding to the interface is the list cache, the following step S330 is executed.
In step S330, the request parameter is divided into a plurality of parameter values, and cache data corresponding to the plurality of parameter values is requested to be obtained from the cache server. Here, each parameter value is used as a key value or a part of the key value to request to obtain 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 the plurality of parameter values obtained from the cache server may be directly aggregated, and the aggregated cache data is returned to the corresponding request terminal 110. So that there is no need to request the source interface (i.e., the interface provided by the service end 130).
In addition, if the cache data corresponding to one or more of the parameter values is not acquired from the cache server (one or more parameter values do not hit the cache), step S340 is executed. In step S340, a corresponding service-side interface is called based on the interface address and the one or more parameter values in the interface request to obtain a return value of the interface. It should be noted that one or more parameter values to be called to the service-side interface can be obtained by differentiating the original multiple parameter values in the request parameter from the parameter values hit in the cache, and then, the interface management server 120 calls the service-side interface based on the new request parameter by combining the new request parameter with the one or more parameter values.
Subsequently, step S350 is executed to aggregate the cache data acquired in step S330 and/or the return value acquired in step S340, and then return an aggregation result to the request end 110. It should be understood that if cache data corresponding to all parameter values are obtained from the cache server, the obtained cache data are aggregated and returned to the request end; if cache data corresponding to a part of parameter values are not obtained, aggregating all the obtained cache data and return values of the interfaces after obtaining corresponding return values by calling the interfaces, and returning an aggregation result to the request terminal 110; if the cache data corresponding to any parameter value is not acquired, after the return value corresponding to each parameter value is acquired through calling the interface, all the acquired return values are aggregated and returned 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, that is, the cache is hit, the cache data is returned to the requesting end 110. If the cache data is not acquired, calling a corresponding service terminal 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 terminal. Here, it can be understood that the return value obtained by calling the interface based on the single parameter value may be directly returned to the request terminal 110 without performing aggregation processing.
According to one embodiment, when the cache type of the interface is list cache or normal cache, the interface management server 120 further stores the return value of the service-side interface in association with the corresponding parameter value in the cache server 140 after acquiring the return value. Here, the returned value is stored as cached data and the parameter value is stored as the corresponding cached key value or as part of the cached key value. It should be noted that by caching the returned value of the interface, the interface management server 120 can directly obtain the cached data corresponding to the request parameter from the cache server 140 when processing the interface request sent by the request terminal 110 based on the same request parameter next time, without calling the interface again. Therefore, multi-division redundant data 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 a corresponding service-side interface is called based on a single request parameter value (a single parameter value) and a 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, the obtained interface return result is split into return values corresponding to each parameter value, and each parameter value in the request parameter is respectively stored in association with one corresponding split return value by adopting a list structure.
It should be understood that the present invention can avoid multiple redundant codes caused by repeatedly calling interfaces by uniformly caching the return values of each service-side interface.
According to one embodiment, before storing the return value and the corresponding parameter value in the cache server 140 in association, the interface management server 120 further determines whether the interface starts cache compression, and if the interface starts cache compression, performs compression processing on the return value, and stores the compressed return value in the cache server 140. Here, the interface management server 120 may determine whether the interface starts cache compression according to an interface configuration table corresponding to the interface.
According to an embodiment, after the return value of the service-side interface is obtained, 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 return value and output the unified data format, and thus, the return value of any interface is stored in the cache server 140 and returned to the request side 110 in the unified data format. Therefore, no matter the request terminal calls any service interface, the return value with the uniform data format can be obtained.
According to one embodiment, after the conversion processing mode corresponding to the interface is determined, a converter corresponding to the conversion processing mode may be called to convert the data format of the return value. Specifically, whether a converter matched with the conversion processing mode exists is judged, if the converter matched with the conversion processing mode exists, the matched converter is called, the converter is used for converting the data format of the return value, and the result, returned by the converter, of converting the data format of the return value is obtained.
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 end 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 defined in advance by the interface management server 120. For example, in the original return value defined by the service-side interface, the interface response success status code is code: 200. If the predefined response success status code predefined by the interface management server 120 is return code:0, the response success status code of the service end interface is modified to return code: 0. In this way, for any return value of the service-side interface, the target return value of the unified data format and the unified status code can be output after conversion by the interface management server 120.
According to an embodiment, the interface management server 120 may further obtain index data of the interface of each service end 130. Whether the interface is abnormal or not is judged by analyzing the index data of the interface, for example, whether the cache service of the interface return value is abnormal or not can be judged. And triggering an alarm when the interface is determined to be abnormal. Here, the alert information may be sent to one or more client applications so that the user views the alert information and handles the abnormal situation in time. 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 uniform analysis, so as to determine the abnormal state of each interface.
According to an embodiment, before performing step S310 of the method, that is, before receiving the interface requests of one or more request terminals, a cache cleaning operation may be performed on the service terminal interface to clean current cache data corresponding to the interface, which already exists in the cache server 140.
In addition, before step S310 of the method is executed, a cache preheating process may be performed, and before an interface request of a request end is received, one or more interfaces of a service end are called in advance, and a return value of the interface is cached in advance.
According to the method 300 of the present invention, the interface management server is used to implement unified management of the interfaces of multiple service terminals, any request terminal will send an interface request to the interface management server when calling an interface, the interface management server processes the interface request in a unified manner, and obtains corresponding cache data from the cache based on the request parameters, or, when the cache is not hit, the interface management server calls a corresponding service terminal interface to obtain an interface return value. Therefore, when the interface calling mode of the service end is changed, the interface calling mode is updated only at the interface management server, and modification at 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 performs unified cache on the return value of each service end interface, thereby avoiding multiple redundant codes caused by repeatedly calling the interfaces.
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 in the uniform data format. Therefore, no matter the request terminal calls any service interface, the return value with the uniform data format can be obtained.
A8, the method according to AA7, wherein the interface configuration table includes interface name, interface address, cache type, and conversion processing mode corresponding to the interface.
A9, the method as in A3, wherein before storing the return values and corresponding parameter values in association with each other in the cache server, further comprising the steps of: and judging whether the interface starts cache compression or not, and if the interface starts the cache compression, compressing the return value.
A10, the method according to any one of A1-A9, further comprising the steps of: acquiring index data of each interface, and judging whether the interface is abnormal or not according to the index data; and triggering an alarm when the interface is determined to be abnormal.
A11, the method according to any one of a1-a10, wherein before receiving one or more interface requests of a request end, the method further comprises the steps of: and clearing current cache data in the cache server.
B13, the system as in B12, further comprising: and the configuration platform is connected with the interface management server and is suitable for configuring and generating an interface configuration table corresponding to each 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 thereof, may take the form of program code (i.e., instructions) embodied in tangible media, such as removable hard drives, U.S. disks, floppy disks, 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 generally includes 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 according to instructions in the program code stored in the memory.
By way of example, and not limitation, readable media may comprise readable storage media and communication media. Readable storage media store 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 this invention. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, 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 interpreted as reflecting an intention that: that the invention as claimed 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 multiple sub-modules.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. 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. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements 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 included in other embodiments, rather than other features, 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 may be used in any combination.
Furthermore, some of the described embodiments are described herein as a method or combination of method elements that can be performed by a processor of a computer system or by other means of performing the described functions. A processor having the necessary instructions for carrying out the method or method elements thus forms a means for carrying out the method or method elements. Further, the elements of the apparatus embodiments described herein are examples of the following apparatus: the apparatus is used to implement the functions performed by the elements for the purpose of carrying out the invention.
As used herein, unless otherwise specified the use of the ordinal adjectives "first", "second", "third", etc., to describe a common object, merely indicate that different instances of like objects are being referred to, and are not intended to imply that the objects so described must be in a given sequence, 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 this description, will appreciate that other embodiments can be devised which do not depart from 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 present invention has been disclosed in an illustrative rather than a restrictive sense with respect to the scope of the invention, as defined in the appended claims.

Claims (10)

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 terminals, 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 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 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
and aggregating the cache data and/or the return value and returning the aggregated cache data and/or the return value to the request end.
2. The method of claim 1, wherein determining the cache type corresponding to the interface further comprises:
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 the request end;
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 or 2, wherein after obtaining the return value of the interface, further comprising the steps of:
and storing the return value and the corresponding parameter value into the cache server in an associated manner, wherein the return value is cache data, and the parameter value is a corresponding cache key value.
4. The method of any one of claims 1-3, wherein after obtaining the return value for the interface, further comprising 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 a uniform data format.
5. The method according to claim 4, wherein the step of converting the data format of the return value according to the conversion processing manner includes:
and calling a converter corresponding to the conversion processing mode to convert the data format of the return value.
6. The method according to claim 4 or 5, wherein the step of converting the data format of the return value further comprises:
and modifying the response result state code defined by the interface into a preset response result state code.
7. The method of any of claims 1-6, wherein determining the cache type corresponding to the interface 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 no cache.
8. An interface request processing system, comprising:
an interface management server adapted to perform the method of any one of claims 1-7;
one or more request terminals connected to the interface management server and adapted to send interface requests to the interface management server;
one or more service terminals connected to the interface management server and adapted to provide an interface; 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.
9. A computing device, comprising:
at least one processor; and
a memory storing program instructions, wherein the program instructions are configured 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-7.
10. 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 one of claims 1 to 7.
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 true CN113590699A (en) 2021-11-02
CN113590699B 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)

Cited By (1)

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

Citations (11)

* 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
US20120173907A1 (en) * 2011-12-30 2012-07-05 Jaideep Moses Method, apparatus, and system for energy efficiency and energy conservation including dynamic c0-state cache resizing
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

Patent Citations (11)

* 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
US20120173907A1 (en) * 2011-12-30 2012-07-05 Jaideep Moses Method, apparatus, and system for energy efficiency and energy conservation including dynamic c0-state cache resizing
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

Cited By (2)

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

Also Published As

Publication number Publication date
CN113590699B (en) 2023-12-01

Similar Documents

Publication Publication Date Title
CN111651464B (en) Data processing method, system and computing device
JP2023520851A (en) Blockchain message processing method, apparatus, computer device and computer program
CN107273213B (en) Calculation control method, network card and electronic equipment
CN113329069B (en) Instant messaging method, system and computing device
CN114172829B (en) Server health monitoring method and system and computing equipment
CN111177664B (en) Watermark information adding method, server and system
CN111526181B (en) Data request processing method and system and computing device
CN110795343A (en) Test system, test method and computing device
CN113590699B (en) Interface request processing method, system and computing device
CN111930283A (en) Message display method and computing device
CN111865676A (en) Configuration file update checking method, device, server and storage medium
CN111414383B (en) Data request method, data processing system and computing device
CN112465599B (en) Order processing method, order processing system and computing equipment
CN110784553B (en) Message encapsulation method, device and domain name resolution system
CN113312188A (en) Data processing method, data interaction system and computing equipment
CN111917573A (en) Monitoring method, monitoring system and computing device
CN111814029A (en) Data query method, system and computing device
CN113382180B (en) Picture processing method, computing device and readable storage medium
CN111913814B (en) Object copying method and computing device
CN115514665A (en) Service expansion method and device, electronic equipment and storage medium
CN114513500A (en) Method, device and system for batch installation of browser plug-ins and computing device
CN114338529A (en) Quintuple rule matching method and device
CN112738182A (en) Data pushing system, data pushing method and computing equipment
CN113300895A (en) Cable processing method and system and computing device
CN112671843A (en) Data request 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