Interface access method and device
By setting up caching and current limiting measures in interface access methods and devices, the problem of script language high maintenance costs and high access volume causing service crashes in Internet interface development is solved, achieving efficient interface development and stability, and supporting multi-language Script engineers wrote to develop large website interfaces.
Patent Information
- Application Number
- CN202110047827.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-14
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2041-01-14
AI Technical Summary
In the existing technology, scripting languages are difficult to use for Internet interface development, resulting in high maintenance costs, low operating efficiency, and inability to effectively deal with service crashes caused by high visits.
Through interface access methods and devices, it supports scripts written in multiple languages, sets cache and current limiting measures, and achieves efficient processing and stability of the interface, including receiving access requests, determining cache and current limiting configurations, querying if the cache exists, and querying if it does not. If it exists, run the script and perform current limiting blocking and cache storage if necessary.
Support script engineers to develop large website interfaces, reduce operation and maintenance costs, prevent service crashes caused by excessive visits, and improve interface service processing efficiency.
Smart Images

Figure CN113778390B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to an interface access method and device. Background Art
[0002] Among the current scripting languages, dynamic languages such as Python are only suitable for script development. Due to its dynamic language characteristics, it has the advantages of being easy to learn, unconstrained, and able to be used arbitrarily compared to languages such as C++ and Java. However, due to the different programming ideas of different developers, sometimes the time spent on understanding far exceeds the time spent on writing code, which also leads to the disadvantages of high maintenance costs and low operating efficiency.
[0003] Internet interface development will magnify the above shortcomings. A script may only have dozens to more than a hundred lines, requiring fewer developers. However, the complexity of Internet interface development is far greater than script development, requiring dozens of people to write hundreds of thousands of lines of code. Different developers have different programming ideas, resulting in unimaginable maintenance costs in the later stage. Therefore, Internet companies generally do not use scripting languages for interface development. Summary of the invention
[0004] In view of this, an embodiment of the present invention provides an interface access method and device, which can at least solve the problem that scripting languages cannot be used for interface development in the prior art.
[0005] To achieve the above object, according to one aspect of an embodiment of the present invention, there is provided an interface access method, comprising:
[0006] receiving an access request to an interface address, determining an interface corresponding to the interface address, and determining whether to set a cache for the interface;
[0007] If a cache is set, the cache data is queried based on the input parameters in the access request, and the query results are obtained and returned;
[0008] If the cache is not set or the query result does not exist, the script of the interface is run to process the input parameters, obtain the running result and return it.
[0009] Optionally, the determining whether the interface is cached includes:
[0010] Obtaining whether the interface needs current limiting configuration, and if the current limiting configuration is yes, counting the current access volume to the interface;
[0011] Determine whether the access volume triggers the current limiting upper limit of the interface, and if so, perform current limiting and blocking operations on the access request;
[0012] If the current limiting configuration is no or the current limiting upper limit has not been reached, it is determined whether the interface is configured with a cache.
[0013] Optionally, obtaining and returning the running result further includes:
[0014] The cache configuration of the interface is obtained. If the cache configuration is yes, the operation result is stored in the cache; otherwise, no processing is performed.
[0015] Optionally, before receiving the access request to the interface address, the method further includes:
[0016] Receiving scripts written in multiple languages for the interface, and judging whether there is a historical script corresponding to the script in the server according to the name of the interface;
[0017] If it exists, replace the historical script with the script; or
[0018] If not, it is determined that the interface is newly added, a uniquely accessed interface address is generated for the interface, and the script is saved in the server.
[0019] Optionally, judging, according to the name of the interface, whether there is a historical script corresponding to the script in the server includes:
[0020] Perform a test on the script based on preset parameters to obtain a test result;
[0021] Performing stress testing on the script to obtain a stress testing result, and if the stress testing result meets a preset stress testing target, determining that the script has passed the stress testing;
[0022] When both the script test and the stress test are passed, it is determined whether there is a historical script corresponding to the script in the server according to the name of the interface.
[0023] To achieve the above object, according to another aspect of an embodiment of the present invention, an interface access device is provided, comprising:
[0024] A receiving module, used for receiving an access request to an interface address, determining an interface corresponding to the interface address, and determining whether to set a cache for the interface;
[0025] A query module, for querying cache data based on the input parameters in the access request if a cache is set, obtaining the query result and returning it;
[0026] The running module is used to run the script of the interface to process the input parameters if the cache is not set or the query result does not exist, obtain the running result and return it.
[0027] Optionally, the receiving module is used to:
[0028] Obtaining whether the interface needs current limiting configuration, and if the current limiting configuration is yes, counting the current access volume to the interface;
[0029] Determine whether the access volume triggers the current limiting upper limit of the interface, and if so, perform current limiting and blocking operations on the access request;
[0030] If the current limiting configuration is no or the current limiting upper limit has not been reached, it is determined whether the interface is configured with a cache.
[0031] Optionally, the running module is further used to: obtain the cache configuration of the interface, if the cache configuration is yes, store the running result in the cache, otherwise do not process it.
[0032] Optionally, an interface generation module is also included, for:
[0033] Receiving scripts written in multiple languages for the interface, and judging whether there is a historical script corresponding to the script in the server according to the name of the interface;
[0034] If it exists, replace the historical script with the script; or
[0035] If not, it is determined that the interface is newly added, a uniquely accessed interface address is generated for the interface, and the script is saved in the server.
[0036] Optionally, it also includes test run and stress testing modules for:
[0037] Perform a test on the script based on preset parameters to obtain a test result;
[0038] Performing stress testing on the script to obtain a stress testing result, and if the stress testing result meets a preset stress testing target, determining that the script has passed the stress testing;
[0039] When both the script test and the stress test are passed, it is determined whether there is a historical script corresponding to the script in the server according to the name of the interface.
[0040] To achieve the above objective, according to another aspect of an embodiment of the present invention, an interface access electronic device is provided.
[0041] The electronic device of an embodiment of the present invention includes: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement any of the above-mentioned interface access methods.
[0042] To achieve the above objective, according to another aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored, and when the program is executed by a processor, any of the above-mentioned interface access methods is implemented.
[0043] According to the solution provided by the present invention, one embodiment of the above invention has the following advantages or beneficial effects: using multiple languages to write interface scripts to support script engineers in developing large-scale website interfaces; setting current limiting measures for the interface to prevent the interface service from crashing due to excessive traffic, and setting caching measures to improve the interface service processing efficiency.
[0044] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0046] Figure 1 This is a main flow chart of an interface access method according to an embodiment of the present invention;
[0047] Figure 2 It is a flowchart of a specific interface access method according to an embodiment of the present invention;
[0048] Figure 3 is a flow chart of an optional interface access method according to an embodiment of the present invention;
[0049] Figure 4 This is a flowchart of running tests and stress tests on scripts;
[0050] Figure 5 is a schematic diagram of main modules of an interface access device according to an embodiment of the present invention;
[0051] Figure 6 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0052] Figure 7 It is a schematic diagram of the structure of a computer system of a mobile device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0053] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0054] See also Figure 1 , which shows a main flow chart of an interface access method provided by an embodiment of the present invention, comprising the following steps:
[0055] S101: receiving an access request to an interface address, determining an interface corresponding to the interface address, and determining whether to set a cache for the interface;
[0056] S102: If a cache is set, query cache data based on the input parameters in the access request, obtain the query result and return it;
[0057] S103: If the cache is not set or the query result does not exist, the script of the interface is run to process the input parameter, and the running result is obtained and returned.
[0058] In the above implementation, on May 19, 2020, the School Planning, Construction and Development Center of the Ministry of Education released a blockbuster news on its official website, "Notice on Organizing the Future School Innovation and Development Project-Research on Programming Curriculum System and Teaching Model". According to this notice, various places have arranged programming courses to enter primary school campuses, mainly using technologies such as Python. In addition, the core technology of children's robot programming, which has been popular all over the country in recent years, is also Python. It can be seen that there will be tens of millions more Python engineers in the future, and there is currently no solution to use Python for interface script development.
[0059] Thanks to the accelerated development of computer hardware, computers are now 100 to 500 times faster than in 1980, and are still doubling every 18 months. The rapid improvement of computer performance has changed the contradiction between programming languages from low-performance hardware and execution efficiency to the contradiction between rapidly changing market needs and inefficient development tools, so scripts are being learned and used by more and more people.
[0060] For steps S101 to S103, this solution accepts multiple ways to call the interface, and supports access to the interface address through methods such as http and microservices. For the specific method of generating the interface address, please refer to the subsequent Figure 3 The description shown is not repeated here.
[0061] To improve the efficiency of interface operation, you can set a cache for the interface to store the script execution results in the cache (the cache is the fastest access unit in the server). When processing the subsequent interface call request, you can directly read the script execution results from the cache without running the script again, thereby improving the request processing efficiency.
[0062] Therefore, when accessing an interface, first determine whether a cache is set for the interface. If so, directly query the corresponding cache data in the cache based on the input parameters in the access request (such as the interface for querying the weather requires the input of the region code), return the query results to the front end, and end the access. However, if no data is found, run the script of the interface to process the request input parameters and obtain the running results. In addition, the script developer can set whether the running results need to be cached. If configured to be yes, the running results will be saved in the cache, otherwise no processing will be done.
[0063] In addition, this solution proposes a flow-limiting measure to prevent a large number of accesses from causing system crashes. Specifically, it determines whether the called interface has set "interface needs flow-limiting". If the interface needs flow-limiting, it is necessary to count the current access volume to the interface and determine whether the access volume triggers the flow-limiting upper limit. If it triggers, it is necessary to block and wait for flow-limiting resources to be allocated. Otherwise, if the flow-limiting upper limit is not triggered or the flow-limiting blocking ends and there are access resources, continue to perform subsequent operations. For the overall information, see Figure 2 shown.
[0064] Among them, flow control is an operation to reduce the pressure of interface service when the number of visits to the interface is too large at the same time. Usually, it manifests as system lag or downtime. To ensure that the system will not have problems, the access volume is limited. Developers can set the upper limit of access volume according to their own business needs, for example, setting a limit of 100,000 visits per second.
[0065] The method provided in the above embodiment generates a unique access address for the interface, sets current limiting measures to prevent the interface service from crashing due to excessive access volume, and sets cache measures to improve the interface service processing efficiency.
[0066] See also Figure 3 , shows a schematic flow chart of an optional interface access method according to an embodiment of the present invention, comprising the following steps:
[0067] S301: receiving scripts written in multiple languages for interfaces, and judging whether there is a historical script corresponding to the script in the server according to the name of the interface;
[0068] S302: If it exists, replace the historical script with the script;
[0069] S303: If it does not exist, determine that the interface is newly added, generate a unique access interface address for the interface, and save the script to the server;
[0070] S304: receiving an access request to an interface address, determining an interface corresponding to the interface address, and determining whether to set a cache for the interface;
[0071] S305: If a cache is set, query cache data based on the input parameters in the access request, obtain the query result and return it;
[0072] S306: If the cache is not set or the query result does not exist, the script of the interface is run to process the input parameter, and the running result is obtained and returned.
[0073] In the above embodiment, for steps S304 to S306, see Figure 1 The description of steps S101 to S103 is not repeated here.
[0074] This solution breaks down an Internet interface into two parts: business logic and supporting services. Business logic refers to the actual work that this interface needs to do, such as querying user information in the database; supporting services refer to other services that support the interface function and meet the requirements of Internet companies. This implementation mainly describes business logic.
[0075] For step S301, it is found in actual work that business logic accounts for 20% of the entire development, and supporting services account for 80%. Therefore, the overall design is as follows:
[0076] 1. The business logic is handed over to the script engineer to develop specific logic scripts, which can be written in different code languages;
[0077] 2. Build a support service (platform) that can handle all support services and package the business logic scripts developed by script engineers and upload them to various servers.
[0078] During the interface development phase, the script needs to be tested with parameters, and the test results are used to check whether it runs successfully. Usually, it is only run once. In addition, the script needs to be stress tested. Developers can set stress test targets based on self-examination demand scenarios. For example, during the Double Eleven period, hundreds of millions of people may visit the same homepage at the same time. After the stress test, the access response time and number of visits per second (TP99's QPS) are obtained. In order to test whether the interface can still run stably when dozens or even millions of people visit at the same time, stress testing must be performed multiple times. For details, see Figure 4 shown.
[0079] If the test results and stress test results meet the requirements, the script is determined to have passed the test. For scripts that have passed the test, they can be published to the server. Considering that different script versions may cause different script names, first determine whether the corresponding historical script already exists on the server based on the name of the interface. If it does, it indicates an update and directly replaces the historical scripts on all servers with this script. Otherwise, it indicates a new addition and generates a unique accessible interface address for the interface through the domain name address generation system.
[0080] It should also be noted that when the server is restarted, the scripts in the server are usually cleared, and the interfaces are all newly added, that is, the latest scripts of all interfaces need to be stored again on all servers. In actual operation, multiple servers are usually selected to load balance the service pressure of the same interface, so the scripts need to be saved on all servers.
[0081] In the method provided in the above embodiment, the script needs to be run tested and stress tested during the development phase, and the results are used to check whether it runs successfully. Only scripts that pass the test can set the interface access address.
[0082] The method provided by the embodiment of the present invention supports script developers to develop Internet interfaces. They only need to hand over business logic later, which greatly reduces operation and maintenance costs and meets the requirements for Internet interface development. The constructed support service platform can dynamically generate online accessible interfaces for script developers who are not familiar with the underlying and hardware knowledge, and complete the interface development work by simply testing and running the script. The platform can automatically complete complex billion-level access strategies such as packaging, uploading, performance optimization, current limiting, multi-threading, version blocking, network breaking, and disaster recovery.
[0083] See also Figure 5 , shows a schematic diagram of main modules of an interface access device 600 provided in an embodiment of the present invention, including:
[0084] The receiving module 501 is used to receive an access request to an interface address, determine an interface corresponding to the interface address, and determine whether to set a cache for the interface;
[0085] A query module 502 is used to query cache data based on the input parameters in the access request if a cache is set, obtain the query result and return it;
[0086] The running module 503 is used to run the script of the interface to process the input parameters if the cache is not set or the query result does not exist, obtain the running result and return it.
[0087] In the implementation device of the present invention, the receiving module 501 is used to:
[0088] Obtaining whether the interface needs current limiting configuration, and if the current limiting configuration is yes, counting the current access volume to the interface;
[0089] Determine whether the access volume triggers the current limiting upper limit of the interface, and if so, perform current limiting and blocking operations on the access request;
[0090] If the current limiting configuration is no or the current limiting upper limit has not been reached, it is determined whether the interface is configured with a cache.
[0091] In the implementation device of the present invention, the operation module 503 is also used for:
[0092] The cache configuration of the interface is obtained. If the cache configuration is yes, the operation result is stored in the cache; otherwise, no processing is performed.
[0093] The implementation device of the present invention further includes an interface generation module 504 (not shown in the figure), which is used to:
[0094] Receiving scripts written in multiple languages for the interface, and judging whether there is a historical script corresponding to the script in the server according to the name of the interface;
[0095] If it exists, replace the historical script with the script; or
[0096] If not, it is determined that the interface is newly added, a uniquely accessed interface address is generated for the interface, and the script is saved in the server.
[0097] The device for implementing the present invention further includes a test operation and stress testing module 505 (not shown in the figure), which is used to:
[0098] Perform a test on the script based on preset parameters to obtain a test result;
[0099] Performing stress testing on the script to obtain a stress testing result, and if the stress testing result meets a preset stress testing target, determining that the script has passed the stress testing;
[0100] When both the script test and the stress test are passed, it is determined whether there is a historical script corresponding to the script in the server according to the name of the interface.
[0101] In addition, the specific implementation content of the device described in the embodiment of the present invention has been described in detail in the method described above, so the repeated content will not be described again here.
[0102] Figure 6 An exemplary system architecture 600 is shown in which embodiments of the present invention may be applied.
[0103] like Figure 6 As shown, the system architecture 600 may include terminal devices 601, 602, 603, a network 604 and a server 605 (just an example). The network 604 is used to provide a medium for communication links between the terminal devices 601, 602, 603 and the server 605. The network 604 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0104] The user can use the terminal devices 601, 602, 603 to interact with the server 605 through the network 604 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 601, 602, 603.
[0105] The terminal devices 601, 602, 603 may be various electronic devices having display screens and supporting web browsing, and the server 605 may be a server providing various services.
[0106] It should be noted that the method provided in the embodiment of the present invention is generally executed by the server 605 , and accordingly, the device is generally set in the server 605 .
[0107] It should be understood that Figure 6 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.
[0108] Reference below Figure 7 , which shows a schematic diagram of the structure of a computer system 700 of a terminal device suitable for implementing an embodiment of the present invention. Figure 7 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0109] like Figure 7 As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage part 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0110] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed, so that a computer program read therefrom is installed into the storage section 708 as needed.
[0111] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the central processing unit (CPU) 701, the above-mentioned functions defined in the system of the present invention are executed.
[0112] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0113] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0114] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be set in a processor, for example, it may be described as: a processor includes a receiving module, a query module, and an operation module. The names of these modules do not constitute a limitation on the modules themselves in some cases, for example, the query module may also be described as a "cache query module".
[0115] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes:
[0116] receiving an access request to an interface address, determining an interface corresponding to the interface address, and determining whether to set a cache for the interface;
[0117] If a cache is set, the cache data is queried based on the input parameters in the access request, and the query results are obtained and returned;
[0118] If the cache is not set or the query result does not exist, the script of the interface is run to process the input parameters, obtain the running result and return it.
[0119] According to the technical solution of the embodiment of the present invention, interface scripts are written in multiple languages to support script engineers in developing large-scale website interfaces; current limiting measures are set for the interface to prevent the interface service from crashing due to excessive traffic, and caching measures are set to improve the interface service processing efficiency.
[0120] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. An interface access method, characterized in that: include: Receive an access request to an interface address, determine an interface corresponding to the interface address, and determine whether a cache is set for the interface, including: obtaining whether a current limiting configuration is required for the interface, and if the current limiting configuration is yes, counting the current access volume to the interface; determining whether the access volume triggers the current limiting upper limit of the interface, and if so, performing a current limiting blocking operation on the access request; if the current limiting configuration is no or the current limiting upper limit has not been reached, determining whether a cache is set for the interface; If a cache is set, the cache data is queried based on the input parameters in the access request, and the query results are obtained and returned; If the cache is not set or the query result does not exist, the script of the interface is run to process the input parameters, obtain the running result and return it.
2. The method according to claim 1, characterized in that: The obtaining and returning of the operation result also includes: The cache configuration of the interface is obtained. If the cache configuration is yes, the operation result is stored in the cache; otherwise, no processing is performed.
3. The method according to claim 1, characterized in that Before receiving the access request to the interface address, the method further includes: Receiving scripts written in multiple languages for the interface, and judging whether there is a historical script corresponding to the script in the server according to the name of the interface; If it exists, replace the historical script with the script; or If not, it is determined that the interface is newly added, a uniquely accessed interface address is generated for the interface, and the script is saved in the server.
4. The method according to claim 3, characterized in that The step of judging, according to the name of the interface, whether there is a historical script corresponding to the script in the server includes: Perform a test on the script based on preset parameters to obtain a test result; Performing stress testing on the script to obtain a stress testing result, and if the stress testing result meets a preset stress testing target, determining that the script has passed the stress testing; When both the script test and the stress test are passed, it is determined whether there is a historical script corresponding to the script in the server according to the name of the interface.
5. An interface access device, characterized in that: include: A receiving module is used to receive an access request to an interface address, determine an interface corresponding to the interface address, and determine whether a cache is set for the interface, including: obtaining whether a current limiting configuration is required for the interface, and if the current limiting configuration is yes, counting the current access volume to the interface; determining whether the access volume triggers the current limiting upper limit of the interface, and if so, performing a current limiting blocking operation on the access request; if the current limiting configuration is no or the current limiting upper limit has not been reached, determining whether a cache is set for the interface; A query module, for querying cache data based on the input parameters in the access request if a cache is set, obtaining the query result and returning it; The running module is used to run the script of the interface to process the input parameters if the cache is not set or the query result does not exist, obtain the running result and return it.
6. The device according to claim 5, characterized in that Also included are interface generation modules for: Receiving scripts written in multiple languages for the interface, and judging whether there is a historical script corresponding to the script in the server according to the name of the interface; If it exists, replace the historical script with the script; or If not, it is determined that the interface is newly added, a uniquely accessed interface address is generated for the interface, and the script is saved in the server.
7. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 4.
8. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Data query method and device
CN109684358A
Database access method, apparatus and device
CN110795485A
Data processing method and system and interface service platform
CN112187908A
Offline mode in IDE for seamless service-oriented-architecture-based application development
US8359574B1
Webpage advertisement Anti-shielding method, content distribution network and client
WO2019134219A1
