A script deployment method, request processing method and device

By loading scripts on the management terminal of the Internet e-commerce website to the cache server and storing them to the configuration server, the problem of high resource waste and maintenance costs during the deployment of Lua scripts is solved, efficient script deployment and management is achieved, and user experience is improved. System availability.

CN111949275BActive Publication Date: 2024-11-12BEIJING QIERBULAITE TECH
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202010658699.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-09
Publication Date
2024-11-12
Estimated Expiration
2040-07-09

AI Technical Summary

Technical Problem

In the promotion and flash sale scenarios of large Internet e-commerce websites, the deployment process of existing Lua scripts has problems such as wasted resources, high maintenance costs, and poor user experience, including resource redundancy, unavailability and expansion caused by manual restart of services, resulting in service unavailability and expansion caused by service redundancy, manual restart of services, and The shrinkage process is opaque.

Method used

By loading the script to be deployed on the management terminal to the cache server, receiving the script mapping value, and associating the service interface identity and script mapping value to the configuration server, dynamic deployment and management of scripts are achieved, avoiding the redundancy of scripts on each server Restoration and manual restart processes are used to realize efficient storage and execution of scripts using technologies such as Redis and ZooKeeper.

Benefits of technology

It reduces system maintenance costs, improves deployment efficiency and user experience, avoids the problem of waste of resources and temporary unavailability of services in traditional deployment, and simplifies the scaling process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111949275B_ABST
    Figure CN111949275B_ABST
Patent Text Reader

Abstract

The present invention discloses a script deployment method, which is executed in a management terminal, and includes: loading a script to be deployed to a cache server, the script corresponding to a service interface of a target application; receiving a script mapping value returned by the cache server; and associating and storing the service interface identifier and the script mapping value to a configuration server. The present invention also discloses a corresponding request processing method, a service system, a computing device, and a readable storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of Internet technology, and in particular to a script deployment method, a request processing method and a device. Background Art

[0002] In the promotion and flash sale scenarios of large-scale Internet e-commerce websites, it is necessary to provide a high-performance dynamic interface to handle the sudden increase in concurrent user requests. In order to achieve high performance, pluggability, and high scalability of the interface, a preferred implementation method is to integrate the Lua script module on the Nginx server to implement dynamic interface response.

[0003] E-commerce websites frequently iterate versions according to the changing needs of business scenarios. Accordingly, Lua script codes also need to be frequently updated. At present, the update and deployment process of Lua scripts is as follows: First, the developer submits the written Lua script file to the code repository. Then, log in to the publishing system, select the module to be released, submit the online request, pull the latest script code from the warehouse, send the script copy instruction to the distributed server, and each application server (Nginx) copies the latest script code to the local. Finally, restart the Nginx proxy service on each server to make the latest script code effective.

[0004] The deployment process of the above Lua script has the following problems:

[0005] 1. Lua scripts applied to different systems are concentrated in one project. All systems that deploy Lua scripts will pull all Lua script codes to the local server, resulting in waste and redundancy of resources (theoretically, each system only needs to focus on the code related to itself);

[0006] 2. After the latest script code is pulled to the local server, developers need to manually restart all Nginx proxy services to make the latest script content effective. This process is prone to omissions, and the system maintenance cost is high. In addition, the restart of the Nginx service will cause the service of the machine hit by the request to be unavailable for a short period of time, which brings an unfriendly user experience;

[0007] 3. Due to the ever-changing e-commerce business scenarios, elastic expansion and contraction of distributed systems are inevitable. The expansion and contraction process is not transparent to developers, which will increase system maintenance costs and the difficulty of troubleshooting. Summary of the invention

[0008] To this end, the present invention provides a script deployment method, a request processing method and a device, in an effort to solve or at least alleviate the above problems.

[0009] According to a first aspect of the present invention, a script deployment method is provided, which is executed in a management terminal, and includes: loading a script to be deployed into a cache server, wherein the script corresponds to a service interface of a target application; receiving a script mapping value returned by the cache server; and associating a service interface identifier with the script mapping value and storing it in a configuration server.

[0010] Optionally, the script deployment method according to the present invention further includes the step of setting access parameters of the service interface corresponding to the script to limit the flow of the service interface.

[0011] Optionally, in the script deployment method according to the present invention, the script mapping value is a hash value generated by processing the script using the SHA-1 algorithm.

[0012] Optionally, in the script deployment method according to the present invention, the configuration server stores script mapping values ​​of service interfaces of multiple applications, and the method further comprises: associating and storing the target application identifier, the service interface identifier and the script mapping value in the configuration server.

[0013] Optionally, in the script deployment method according to the present invention, when the script is updated: the updated script is loaded into the cache server; the updated script mapping value returned by the cache server is received; and the script mapping value of the corresponding service interface stored in the configuration server is modified to the updated script mapping value.

[0014] According to a second aspect of the present invention, there is provided a request processing method, which is executed in a web page server, and includes: receiving an interface request sent by a client, the interface request including an interface identifier; determining a script mapping value corresponding to the interface identifier; sending the script mapping value to a cache server so that the cache server executes the corresponding script; receiving a script execution result returned by the cache server, and returning the execution result to the client.

[0015] Optionally, in the request processing method according to the present invention, the interface identifier is the address of the interface.

[0016] Optionally, in the request processing method according to the present invention, the step of determining the script mapping value corresponding to the interface identifier includes: sending the interface identifier to the configuration server, so that the configuration server determines the script mapping value corresponding to the interface identifier based on the correspondence between the preset service interface identifier and the script mapping value; and receiving the script mapping value returned by the configuration server.

[0017] Optionally, in the request processing method according to the present invention, the interface request also includes an application identifier, and the step of determining the script mapping value corresponding to the interface identifier further includes: sending the application identifier and the interface identifier to the configuration server, so that the configuration server determines the script mapping value corresponding to the interface identifier based on the correspondence between the service interface identifier and the script mapping value of the corresponding application; and receiving the script mapping value returned by the configuration server.

[0018] Optionally, in the request processing method according to the present invention, the interface includes a concurrent interface and a normal interface. When the interface request is a concurrent interface request, the script mapping value corresponding to the interface identifier is determined, the script mapping value is sent to the cache server so that the cache server executes the corresponding script, the script execution result returned by the cache server is received, and the execution result is returned to the client; when the interface request is a normal interface request, the interface request is sent to the business server so that the business server responds to the interface request, the request response result returned by the business server is received, and the response result is returned to the client.

[0019] According to a third aspect of the present invention, there is provided a service system, comprising a web page server and a cache server, wherein the web page server is adapted to receive an interface request from a client, the interface request comprising an interface identifier, determine a script mapping value corresponding to the interface identifier, and send the script mapping value to the cache server; the cache server is adapted to execute a script corresponding to the script mapping value, and return the script execution result to the web page server, so that the web page server returns the execution result to the client.

[0020] According to a fourth aspect of the present invention, there is provided a computing device, comprising: at least one processor; and a memory storing program instructions, wherein when the program instructions are read and executed by the processor, the computing device executes the above-mentioned script deployment method or the above-mentioned request processing method.

[0021] According to a fifth aspect of the present invention, a readable storage medium storing program instructions is provided. When the program instructions are read and executed by a computing device, the computing device executes the above-mentioned script deployment method or the above-mentioned request processing method.

[0022] According to the script deployment method and request processing method of the present invention, the script corresponding to the service interface is stored in a cache server (Redis server), and the service interface identifier and the script mapping value are associated and stored in a configuration server (ZooKeeper server). When the web server receives an interface request sent by a client, the script mapping value corresponding to the current request is determined according to the corresponding relationship between the service interface identifier and the script mapping value stored in the configuration server, and then the script mapping value is sent to the cache server so that the cache server executes the corresponding script and returns the script execution result.

[0023] In the technical solution of the present invention, the script is only stored in the cache server, and unnecessary redundant script files are no longer stored in the web server, thereby reducing the hardware overhead of the web server (Nginx server).

[0024] When deploying scripts, you only need to load the script to be deployed to the cache server, and associate the service interface identifier with the script mapping value and store it on the configuration server. There is no need to restart the web server, and the deployment process is unaware of the developer, which greatly improves deployment efficiency, facilitates maintenance and management, reduces the probability of developer operation errors and maintenance costs, and avoids the problem of temporary unavailability of services caused by traditional manual restart of services, thereby improving user experience.

[0025] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] To achieve the above and related purposes, certain illustrative aspects are described herein in conjunction with the following description and accompanying drawings, which indicate various ways in which the principles disclosed herein can be practiced, and all aspects and their equivalents are intended to fall within the scope of the claimed subject matter. The above and other purposes, features and advantages of the present disclosure will become more apparent by reading the following detailed description in conjunction with the accompanying drawings. Throughout the present disclosure, the same reference numerals generally refer to the same parts or elements.

[0027] Figure 1 A schematic diagram of a service system 100 according to an embodiment of the present invention is shown;

[0028] Figure 2 A schematic diagram showing a script deployment and request processing process according to an embodiment of the present invention is shown;

[0029] Figure 3 A schematic diagram of a service system 300 according to another embodiment of the present invention is shown;

[0030] Figure 4 A schematic diagram showing a script deployment and request processing process according to another embodiment of the present invention is shown;

[0031] Figure 5 A flowchart of a script deployment method 500 according to an embodiment of the present invention is shown;

[0032] Figure 6 A flowchart of a request processing method 600 according to an embodiment of the present invention is shown;

[0033] Figure 7 A schematic diagram showing a request processing process according to an embodiment of the present invention;

[0034] Figure 8 A schematic diagram of a computing device 200 according to one embodiment of the present invention is shown. DETAILED DESCRIPTION

[0035] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0036] In view of the problems existing in the prior art, the present invention provides a script deployment method, and based on the deployed script, provides a request processing method, thereby improving the script deployment efficiency, reducing the system maintenance cost, and improving the user experience.

[0037] Figure 1 FIG. 1 is a schematic diagram of a service system 100 according to an embodiment of the present invention. The script deployment method and request processing method of the present invention can be applied to Figure 1 In the scene shown.

[0038] like Figure 1 As shown, the service system 100 includes a management terminal 110, a cache server 120, a configuration server 130, a web server 140 and a client 150. It should be noted that Figure 1 The service system 100 shown is only exemplary. In specific practical situations, the service system may include different numbers of management terminals, cache servers, configuration servers, web servers and clients. The present invention does not limit the number of management terminals, cache servers, configuration servers, web servers and clients included in the service system.

[0039] The management terminal 110 is a terminal device used by script deployment personnel (such as developers, operation and maintenance personnel, etc.), which can be, for example, a personally configured computer such as a desktop computer and a laptop computer, or a mobile terminal such as a mobile phone, a tablet computer, a multimedia player, a smart wearable device, or an Internet of Things (IoT) device such as a smart TV, a smart access control system, and industrial control equipment, but is not limited to these.

[0040] The cache server 120, configuration server 130, and web server 140 can be any device with communication, storage, and computing capabilities. For example, they can be implemented as servers, workstations, etc. with any hardware configuration, or as personal computers such as desktop computers and laptops. In some cases, they can also be implemented as mobile phones, tablet computers, smart wearable devices, and other devices.

[0041] The client 150 is a terminal device used by the user, which can be, for example, a personal computer such as a desktop computer or a laptop computer, or a mobile terminal such as a mobile phone, a tablet computer, a multimedia player, a smart wearable device, or an Internet of Things (IoT) device such as a smart TV, a smart access control system, and industrial control equipment, but is not limited thereto.

[0042] The client 150 has a client application or a browser application deployed therein, and the user can access the client application on the client 150 or access the corresponding web page through the browser application. The web server 140 is a server corresponding to the client application or web page, and is used to provide method and data calls to the application or web page.

[0043] In an embodiment of the present invention, the script deployment personnel performs corresponding operations on the management terminal 110 to enable the management terminal 110 to execute the script deployment method 500 of the present invention, load the script to be deployed to the cache server 120, receive the script mapping value returned by the cache server 120, and associate the service interface identifier and script mapping value corresponding to the script with each other and store them in the configuration server 130.

[0044] In an embodiment of the present invention, the cache server 120 is used to store and execute scripts. Generally, there are multiple cache servers 120 in the service system 100, and the multiple cache servers 120 provide storage services to the outside in a cluster manner (such as Figure 1 According to one embodiment, a Redis service is deployed in the cache server 120. Redis is a data storage system located in memory, which can provide high-performance storage services. Accordingly, the cache server 120 is implemented as a Redis server, and the cache server cluster is implemented as a Redis server cluster.

[0045] In an embodiment of the present invention, the script stored in the cache server 120 corresponds to a service interface in the application, and the service interface can be called to provide corresponding services to users. After storing the script, the cache server 120 generates a mapping value (such as a hash value, etc.) of the script, and the configuration server 130 is used to store the corresponding relationship between the service interface identifier (Key) corresponding to the script and the script mapping value (Hash), that is, the configuration server 130 stores multiple sets of Key-Hash key-value pairs.

[0046] According to an embodiment, the configuration server 130 stores the correspondence between the service interface identifiers of multiple applications and the script mapping values. For example, application A deploys three service interfaces A1 to A3, whose service interface identifiers are Key_A1, Key_A2, and Key_A3, and whose script mapping values ​​are Hash_A1, Hash_A2, and Hash_A3; application B deploys two service interfaces B1 and B2, whose service interface identifiers are Key_B1 and Key_B2, and whose script mapping values ​​are Hash_B1 and Hash_B2. Then the configuration server 130 can store the script mapping values ​​of application A and application B separately, for example, as shown in the following table:

[0047] Application A Application B Key_A1-Hash_A1 Key_B1-Hash_B1 Key_A2-Hash_A2 Key_B2-Hash_B2 Key_A3-Hash_A3

[0048] In an embodiment of the present invention, the configuration server 130 is used to store the corresponding relationship between the service interface identifier corresponding to the script and the script mapping value. Generally, there are multiple configuration servers 130 in the service system 100, and the multiple configuration servers 130 provide configuration services to the outside in a cluster manner (such as Figure 1 According to an embodiment, a ZooKeeper service is deployed in the configuration server 130, and ZooKeeeper can provide coordination services for distributed applications. Accordingly, the configuration server 130 is implemented as a ZooKeeper server, and the configuration server cluster is implemented as a ZooKeeper server cluster.

[0049] In an embodiment of the present invention, based on the script stored in the cache server 120 and the correspondence between the service interface identifier and the script mapping value stored in the configuration server 130, the web page server 140 can execute the request processing method 600 of the present invention, receive the interface request initiated by the client 150, and return the request response result to the client 150.

[0050] Typically, the service system 100 includes a plurality of web servers 140, and the plurality of web servers 140 provide web services to the outside in a cluster manner (eg Figure 1 According to one embodiment, the web server 140 is deployed with an Nginx service, which can provide high-performance web services and can also implement functions such as reverse proxy, load balancing, and HTTP cache. Accordingly, the web server 140 is implemented as an Nginx server, and the web server cluster is implemented as an Nginx server cluster.

[0051] Specifically, in an embodiment of the present invention, the web server 140 receives an interface request sent by the client 150, and the interface request includes an interface identifier. Subsequently, the script mapping value corresponding to the interface request is determined according to the correspondence between the service interface identifier and the script mapping value stored in the configuration server 130. Subsequently, the script mapping value is sent to the cache server 120 so that the cache server 120 executes the corresponding script, and the script execution result returned by the cache server 120 is received, and the execution result is returned to the client 150.

[0052] exist Figure 1 In the service system 100 shown, the script deployment process is as follows: Steps S11 to S13:

[0053] First, in step S11 , the management terminal 110 loads a script to be deployed to the cache server 120 , where the script corresponds to a service interface of a target application.

[0054] According to an embodiment, in step S11, the management terminal 110 may also set access parameters of the service interface corresponding to the script to be deployed, so as to limit the flow of the service interface.

[0055] Subsequently, in step S12, the cache server 120 loads the script to be deployed into the local memory, generates a script mapping value for the script, and returns the script mapping value to the management terminal 110. The script mapping value may be, for example, a hash value (i.e., a hash value) generated by processing the script using the SHA-1 algorithm, but is not limited thereto.

[0056] Subsequently, in step S13 , the management terminal 110 receives the script mapping value returned by the cache server 120 , and associates the service interface identifier with the script mapping value and stores it in the configuration server 130 .

[0057] According to an embodiment, mapping values ​​of service interfaces of multiple applications are stored in the configuration server 130 , and the management terminal 110 further associates and stores the target application identifier, the service interface identifier, and the script mapping value in the configuration server 130 .

[0058] Based on the above steps S11 to S13, when the script is updated, the management terminal 110 only needs to load the updated script to the cache server 120, receive the updated script mapping value returned by the cache server 120, and modify the script mapping value of the corresponding service interface stored in the configuration server 130 to the above updated script mapping value. There is no need to do too much maintenance at the access layer, which greatly simplifies the publishing and execution process.

[0059] After the above steps S11 to S13, the deployment of the script can be completed. Based on the deployed script, the web server 140 can execute the request processing method of the present invention. The request processing process is as follows: Steps S21 to S23:

[0060] In step S21, the web server 140 receives an interface request sent by the client, the interface request including an interface identifier. The interface identifier may be, for example, an address of the interface (eg, a URL address), but is not limited thereto.

[0061] Subsequently, in step S22 , the web page server 140 determines the script mapping value corresponding to the interface identifier, and sends the script mapping value to the cache server 120 .

[0062] According to an embodiment, step S22 further includes: the web server 140 sends the interface identifier to the configuration server 130, the configuration server 130 determines the script mapping value corresponding to the interface identifier according to the correspondence between the preset service interface identifier and the script mapping value, and returns the script mapping value to the web server 140. Accordingly, the web server 140 receives the script mapping value returned by the configuration server 130.

[0063] According to an embodiment, the interface request also includes an application identifier, and step S22 further includes: the web server 140 sends the application identifier and the interface identifier to the configuration server 130, and the configuration server 130 determines the script mapping value corresponding to the interface identifier according to the corresponding relationship between the service interface identifier of the corresponding application and the script mapping value, and returns the script mapping value to the web server 140. Accordingly, the web server 140 receives the script mapping value returned by the configuration server 130.

[0064] Subsequently, in step S23 , the cache server 120 executes the script corresponding to the script mapping value, and returns the script execution result to the web page server 140 , so that the web page server 140 returns the execution result to the client 150 to complete the interface response.

[0065] According to an embodiment, a script queue to be executed is stored in the cache server 120 , and the cache server 120 executes each script in sequence according to the order in the script queue.

[0066] Figure 2 A schematic diagram showing a script deployment and request processing process according to an embodiment of the present invention is shown. Figure 1 The service system 100 shown in the figure includes steps 1 to 10.

[0067] In step 1, the developer logs in to the management system on the management terminal (i.e. Figure 2The management system can provide the function of loading scripts into the Redis cache service cluster.

[0068] Then, in step 2, the developer selects the target application corresponding to the script to be deployed on the management system, enters the script content, and loads the script into the Redis cache service cluster (corresponding to Figure 1 In the memory of the cache server 120 in the cache server 120). For example, the script can be loaded into the Redis cache service cluster through the jedis.scriptLoad command.

[0069] Then, in step 3, the script mapping value (i.e. Figure 2 The hash value in ).

[0070] Then, in step 4, the target application identifier, the service interface identifier corresponding to the script, and the script mapping value are associated and stored in the zookeeper configuration center (corresponding to Figure 1 Configuration server 130 in).

[0071] Then, in step 5, the Internet user initiates an interface request through the client, and accordingly, the nginx proxy server (corresponding to Figure 1 The web page server in receives the interface request, where the interface request includes an interface identifier and an application identifier.

[0072] Then, in step 6, the nginx proxy server sends the application identifier and the interface identifier to the zookeeper configuration center.

[0073] Then, in step 7, the zookeeper configuration center determines the script mapping value (hash value) corresponding to the current interface identifier according to the pre-stored correspondence between the service interface identifiers of each application and the script mapping value, and returns the script mapping value to the nginx proxy server.

[0074] Then, in step 8, the nginx proxy server passes the script mapping value hash to the Redis cache service cluster through the EVALSHA (hash) command, and requests the Redis cache service cluster to execute the corresponding script.

[0075] Then, in step 9, the Redis cache service cluster executes the corresponding script and returns the execution result to the nginx proxy server.

[0076] Then, in step 10, the nginx proxy server returns the execution result to the client.

[0077] Figure 3FIG. 3 is a schematic diagram of a service system 300 according to another embodiment of the present invention. Figure 1 The difference between the service system 100 shown is that the service system 300 further includes a service server 160 .

[0078] The business server 160 can be any device with communication, storage and computing capabilities. For example, it can be implemented as a server, workstation, etc. with any hardware configuration, or it can be implemented as a personal computer such as a desktop computer and a notebook computer. In some cases, it can also be implemented as a mobile phone, tablet computer, smart wearable device, etc.

[0079] exist Figure 3 In the service system 300 shown, the web server 140 , the cache server 120 , and the business server 160 are used to respond to the interface request sent by the client 150 .

[0080] Specifically, the web server 140 receives an interface request sent by the client 150. There are two types of interfaces: one is a concurrent interface, and the number of concurrent interface requests may increase dramatically instantly, such as a product flash sale interface, a risk control interface, a sales volume interface, etc.; the other is a common interface, and the number of requests is usually relatively stable and will not increase dramatically instantly, such as a user login interface, a product search interface, etc.

[0081] The interface includes a concurrent interface and a common interface. Accordingly, the interface request sent by the client includes a concurrent interface request and a common interface request.

[0082] exist Figure 3 In the service system 300 shown, the script to be deployed is the script corresponding to the concurrent interface, and the script deployment process is similar to the aforementioned steps S11 to S13, namely:

[0083] The management terminal 110 loads the script to be deployed to the cache server 120, and the script corresponds to a concurrent interface of the target application. The cache server 120 loads the script of the concurrent interface to be deployed into the local memory, generates a script mapping value of the script, and returns the script mapping value to the management terminal 110. The management terminal 110 receives the script mapping value returned by the cache server 120, and associates the concurrent interface identifier and the script mapping value and stores them in the configuration server 130.

[0084] exist Figure 3 In the service system 300 shown, after receiving the interface request sent by the client, the web server 140 divides the interface request according to the type of the interface request (concurrent interface request or common interface request) to achieve a quick response to the interface request.

[0085] Specifically, when the interface request is a concurrent interface request, the web server 140 first determines the script mapping value corresponding to the interface identifier, and then sends the script mapping value to the cache server 120 so that the cache server 120 executes the corresponding script. Subsequently, the web server 140 receives the script execution result returned by the cache server 120, and returns the execution result to the client 150, thereby completing the interface response.

[0086] Since the script is cached in the memory of the cache server 120 , the cache server 120 can quickly read and execute the script, thereby achieving a fast response to concurrent interface requests.

[0087] When the interface request is a common interface request, the web server 140 sends the interface request to the business server 160 so that the business server 160 responds to the interface request. Subsequently, the web server 140 receives the request response result returned by the business server 160 and returns the response result to the client 150, thereby completing the interface response.

[0088] Figure 4 A schematic diagram showing a script deployment and request processing process according to an embodiment of the present invention is shown. Figure 3 The service system 300 is shown.

[0089] Figure 4 The script deployment process in is as follows:

[0090] The developer logs in to the backend management system on the management terminal and performs corresponding operations in the backend management system to load the Lua script of the concurrent interface to be deployed into the cache server (Redis server) and receive the script mapping value (i.e. hash value) returned by the cache server. Then, the hash value of the script and the corresponding concurrent interface identifier are stored in the configuration center (corresponding to Figure 3 Configuration server 130 in Figure 4 In the example, module A and module B are two application modules, key is the concurrent interface identifier, and hash is the script mapping value.

[0091] Figure 4 The request processing process in is as follows:

[0092] The load balancing server (Nginx server) receives the interface request sent by the client.

[0093] If the interface request is a concurrent interface request, such as a flash sale interface request, a risk control interface request, a sales interface request, etc., the load balancing server sends the concurrent interface identifier (key) to the configuration center in order to obtain the hash value corresponding to the concurrent interface request from the configuration center. Subsequently, the obtained hash value is sent to the cache server, which executes the script corresponding to the hash value and returns the script execution result to the load balancing server. The load balancing server further returns the execution result to the client, thereby completing the concurrent interface response.

[0094] If the interface request is a common interface request, such as a login interface request, a product search interface request, or other regular requests, the load balancing server forwards the current interface request to the business server, which responds to the interface request and returns the request response result to the load balancing server. The load balancing server further returns the request response result to the client, thus completing the common interface response.

[0095] Figure 5 FIG. 5 is a flowchart of a script deployment method 500 according to an embodiment of the present invention. The method 500 is executed in the management terminal 110. Figure 5 As shown, the method 500 starts at step S510 .

[0096] In step S510, a script to be deployed is loaded into a cache server, where the script corresponds to a service interface of a target application.

[0097] According to an embodiment, in step S510, access parameters of the service interface corresponding to the script to be deployed may also be set so as to limit the flow of the service interface.

[0098] In step S520, a script mapping value returned by the cache server is received. The script mapping value may be, for example, a hash value generated by processing the script using the SHA-1 algorithm, but is not limited thereto.

[0099] According to one embodiment, a management system is installed in the management terminal, and the management system can provide a function of loading Lua scripts into the Redis cache server. Developers can select the target application to be published in the management system, such as the Lua instruction content string (i.e., the script content), and then submit it, so that the Lua script can be loaded into the Redis cache server and the script mapping value returned by the Redis cache server can be received. The sample code of this process is as follows:

[0100] / / Tool class initialization

[0101] Jedis jedis = new Jedis ("127.0.0.1", 6379); / / redis address and connection port

[0102] jedis.auth("hank"); / / Authenticate the password

[0103] StringBuffer scriptBuffer = new StringBuffer("");

[0104] scriptBuffer.append("\n");

[0105] / / Assemble the Lua string

[0106] scriptBuffer.append("local key = KEYS[1]\n");

[0107] scriptBuffer.append("local limit = tonumber(ARGV[1])\n");

[0108] scriptBuffer.append("local expire_time = ARGV[2]\n");

[0109] scriptBuffer.append("local is_exists = redis.call('EXISTS', key)\n");

[0110] scriptBuffer.append("if is_exists == 1 then\n");

[0111] scriptBuffer.append("if redis.call('INCR', key) > limit then\n");

[0112] scriptBuffer.append("return 0\n");

[0113] scriptBuffer.append("else\n");

[0114] scriptBuffer.append("return 1\n");

[0115] scriptBuffer.append("end\n");

[0116] scriptBuffer.append("else\n");

[0117] scriptBuffer.append("redis.call('SET',key,1)\n");

[0118] scriptBuffer.append("redis.call('EXPIRE',key,expire_time)\n");

[0119] scriptBuffer.append("return 1\n");

[0120] scriptBuffer.append("end\n");

[0121] / / Calculate the sha1 value (ie hash value)

[0122] String scriptSHA1=jedis.scriptLoad(scriptBuffer.toString());

[0123] System.out.println("=========scriptSHA========"+scriptSHA1);

[0124] / / Execute the lua script

[0125] / / Set access parameters. The maximum number of accesses to the IP address 127.0.0.1 within 20 milliseconds is 10.

[0126] Object result=jedis.sevalsha(scriptSHA1,1,"rate.limit:127.0.0.1","10","20");

[0127] / / Print operation results

[0128] System.out.println(result);

[0129] / / Release resources

[0130] jedis.disconnect();

[0131] Then, in step S530, the service interface identifier and the script mapping value are associated and stored in the configuration server.

[0132] According to an embodiment, mapping values ​​of service interfaces of multiple applications are stored in the configuration server, and the management terminal further associates and stores the target application identifier, the service interface identifier and the script mapping value in the configuration server.

[0133] Based on the above steps S510 to S530, when the script is updated, the management terminal only needs to load the updated script to the cache server, receive the updated script mapping value returned by the cache server, and modify the script mapping value of the corresponding service interface stored in the configuration server to the above updated script mapping value. The sample code for script update is as follows:

[0134] Jedis jedis=new Jedis("127.0.0.1",6379);

[0135] jedis.auth("hank");

[0136] String scriptSHA1=jedis.scriptLoad(scriptBuffer.toString());

[0137] After the above steps S510 to S530, the deployment of the script is completed. Subsequently, the web server 140 is configured accordingly. Specifically, the Nginx service is configured to process the interface request from the client through the content_by_lua_block method, and the hash value of the script is executed in the Lua code block using the EVALSHA() form, where the hash value reads the configuration content in the configuration server 130 according to different applications. The sample code for configuring the web server 140 is as follows:

[0138]

[0139] After the web page server 140 is configured as above, the web page server 140 can execute the request processing method 600 of the present invention based on the deployed script.

[0140] Figure 6 FIG. 6 is a flowchart of a request processing method 600 according to an embodiment of the present invention. The method 600 is executed in the web server 140. Figure 6 As shown, the method 600 starts at step S610 .

[0141] In step S610, an interface request sent by a client is received, the interface request including an interface identifier. According to an embodiment, the interface identifier is an address of the interface.

[0142] In step S620, a script mapping value corresponding to the interface identifier is determined.

[0143] According to an embodiment, in step S620, the web page server sends the interface identifier to the configuration server so that the configuration server determines the script mapping value corresponding to the interface identifier according to the correspondence between the preset service interface identifier and the script mapping value; and receives the script mapping value returned by the configuration server.

[0144] According to one embodiment, the interface request also includes an application identifier, and step S620 further includes: the web page server sends the application identifier and the interface identifier to the configuration server, so that the configuration server determines the script mapping value corresponding to the interface identifier based on the correspondence between the service interface identifier of the corresponding application and the script mapping value; and, receives the script mapping value returned by the configuration server.

[0145] In step S630, the script mapping value is sent to the cache server so that the cache server executes the corresponding script.

[0146] In step S640, the script execution result returned by the cache server is received, and the execution result is returned to the client.

[0147] According to an embodiment, a cache server stores a script queue to be executed, and the cache server executes each script in sequence according to the order in the script queue, and returns the execution result to the web server, which further responds the execution result to the client. The sample code of this process is as follows:

[0148] / / Tool initialization

[0149] Jedis jedis=new Jedis("127.0.0.1",6379);

[0150] jedis.auth("hank");

[0151] / / Execute SHA value

[0152] String scriptSHA="4868632eeb226817a5d05995bd1da2523dbe15d3";

[0153] Object result=jedis.evalsha(scriptSHA,1,"rate.limit:127.0.0.1","10","20");

[0154] / / Print out the operation results

[0155] System.out.println("=============== "+result);

[0156] / / Release resources

[0157] jedis.disconnect();

[0158] According to an embodiment, the interface includes a concurrent interface and a common interface, and accordingly, the interface request includes a concurrent interface request and a common interface request. In order to improve the interface response speed, after receiving the interface request sent by the client, the web server divides the interface request according to the type of the interface request (concurrent interface request or common interface request) to achieve a quick response to the interface request. Specifically:

[0159] For concurrent interface requests, they are processed by the cache server in accordance with the aforementioned steps S630 and S640 to achieve a fast response to concurrent interface requests, namely: the web page server determines the script mapping value corresponding to the interface identifier, sends the script mapping value to the cache server so that the cache server executes the corresponding script, receives the script execution result returned by the cache server, and returns the execution result to the client.

[0160] For a common interface request, the web server sends the interface request to the business server so that the business server responds to the interface request, receives the request response result returned by the business server, and returns the response result to the client.

[0161] Figure 7 FIG. 2 is a schematic diagram showing a request processing process according to an embodiment of the present invention. Figure 7 As shown, the Nginx server (corresponding to the aforementioned web server 140) receives the interface request sent by the client and distributes the request according to the interface type.

[0162] For concurrent interface requests, the Nginx server obtains the script mapping value (hash value) from the configuration server according to the interface address, and then passes the hash value to the Redis cache server through the EVALSHA (hash) command, requesting the Redis cache server to execute the corresponding Lua script. The Lua script is queued for execution in the Redis cache server. After the script is executed, the Redis cache server returns the execution result to the Nginx server, and the Nginx server further returns the execution result to the client, thus completing the interface response.

[0163] For common interface requests (i.e. Figure 7 The Nginx server forwards the interface request to the business server, and the tomcat instance in the business server processes the interface request and returns the request response result to the Nginx server. The Nginx server further returns the response result to the client, thereby completing the interface response.

[0164] In the embodiment of the present invention, the management terminal 110 and the web server 140 can be implemented as any computing device with communication, storage and computing capabilities. Figure 8 FIG. 2 is a schematic diagram of a computing device 200 according to an embodiment of the present invention. It should be noted that: Figure 8 The computing device 200 shown is only an example. In practice, the computing device used to implement the script deployment method and request processing method of the present invention can be any type of device, and its hardware configuration can be different from the above. Figure 8 The computing device 200 shown is the same as Figure 8 The computing device 200 shown is different. In practice, the computing device used to implement the script deployment method and request processing method of the present invention can be Figure 8 The hardware components of the computing device 200 shown are increased or deleted, and the present invention does not limit the specific hardware configuration of the computing device.

[0165] like Figure 8 As shown, in a basic configuration 202, computing device 200 typically includes a system memory 306 and one or more processors 204. A memory bus 308 may be used for communication between processor 204 and system memory 206.

[0166] Depending on the desired configuration, the processor 204 can be any type of processor, including but not limited to: a microprocessor (μP), a microcontroller (μC), a digital information processor (DSP), or any combination thereof. The processor 204 can include one or more levels of cache such as a primary cache 210 and a secondary cache 212, a processor core 214, and registers 216. An example processor core 214 can include an arithmetic logic unit (ALU), a floating point unit (FPU), a digital signal processing core (DSP core), or any combination thereof. An example memory controller 218 can be used with the processor 204, or in some implementations, the memory controller 218 can be an internal part of the processor 204.

[0167] Depending on the desired configuration, the system memory 206 can be any type of memory, including but not limited to: volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory, etc.) or any combination thereof. The physical memory in the computing device generally refers to the volatile memory RAM, and the data in the disk needs to be loaded into the physical memory before it can be read by the processor 204. The system memory 206 may include an operating system 220, one or more applications 222, and program data 224. In some embodiments, the application 222 may be arranged to execute instructions on the operating system by one or more processors 204 using program data 224. The operating system 220 may be, for example, Linux, Windows, etc., which includes program instructions for processing basic system services and performing tasks that depend on hardware. The application 222 includes program instructions for implementing various user-desired functions, and the application 222 may be, for example, a browser, instant messaging software, a software development tool (such as an integrated development environment IDE, a compiler, etc.), etc., but is not limited thereto. When the application 222 is installed in the computing device 200, a driver module may be added to the operating system 220.

[0168] When the computing device 200 starts running, the processor 204 reads and executes the program instructions of the operating system 220 from the memory 306. The application 222 runs on the operating system 220, and uses the interface provided by the operating system 220 and the underlying hardware to implement various functions desired by the user. When the user starts the application 222, the application 222 is loaded into the memory 206, and the processor 204 reads and executes the program instructions of the application 222 from the memory 206.

[0169] The 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. Example output devices 242 include a graphics processing unit 248 and an audio processing unit 250. They can 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 may include a serial interface controller 254 and a parallel interface controller 356, which may be configured to facilitate communication with external devices such as input devices (e.g., keyboards, mice, pens, voice input devices, touch input devices) or other peripherals (e.g., printers, scanners, etc.) via one or more I / O ports 258. Example communication devices 246 may include a network controller 260, which may be arranged to facilitate communication with one or more other computing devices 262 via a network communication link via one or more communication ports 264.

[0170] A network communication link can be an example of a communication medium. Communication media can generally be embodied as computer-readable instructions, data structures, program modules in a modulated data signal such as a carrier wave or other transmission mechanism, and can include any information delivery medium. A "modulated data signal" can be a signal in which one or more of its data sets or its changes can be carried out in a manner that encodes information in the signal. As non-limiting examples, communication media can include wired media such as a wired network or a dedicated line network, and various wireless media such as sound, radio frequency (RF), microwave, infrared (IR) or other wireless media. The term computer-readable medium used herein can include both storage media and communication media.

[0171] In the computing device 200 according to the present invention, the application 222 includes instructions for executing the script deployment method 500 or the request processing method 600 of the present invention, and the instructions can instruct the processor 204 to execute the script deployment method 500 or the request processing method 600 of the present invention to achieve efficient script deployment and request response. Specifically:

[0172] When the application 222 includes instructions for executing the script deployment method 500 of the present invention, the computing device 200 can be implemented as the aforementioned management terminal 110, loading the script to be deployed to the cache server 120, receiving the script mapping value returned by the cache server 120, and associating the service interface identifier and the script mapping value corresponding to the script and storing them in the configuration server 130, thereby completing the script deployment.

[0173] When the application 222 includes instructions for executing the request processing method 600 of the present invention, the computing device 200 can be implemented as the aforementioned web page server 140, which receives an interface request sent by the client 150, and the interface request includes an interface identifier. Subsequently, the script mapping value corresponding to the interface request is determined according to the correspondence between the service interface identifier and the script mapping value stored in the configuration server 130. Subsequently, the script mapping value is sent to the cache server 120 so that the cache server 120 executes the corresponding script, and receives the script execution result returned by the cache server 120, and returns the execution result to the client 150, thereby completing the request response.

[0174] The present invention makes the following improvements to the application publishing, execution, and maintenance process of integrating Lua modules in Nginx:

[0175] 1) The Lua script content is stored in the shared distributed cache Redis in the form of text instead of being stored in the remote code repository as a file;

[0176] 2) After each code update, we only need to use the client to load() the script content to the Redis cluster. At the same time, we retain the hash value returned by load(), and the subsequent script code execution is bridged through the hash value;

[0177] 3) The returned hash value is configured to the Zookeeper configuration center for maintenance according to different application systems;

[0178] 4) In this way, the same application system in a distributed environment only needs to share the same hash value configured in Zookeeper. They only care about the content related to themselves, and there is no need to redundantly store a large number of irrelevant files on the local server;

[0179] 5) After receiving the HTTP / TCP request from the user, the Nginx server uses the content_by_lua_block method to delegate the request to the Lua code block for processing;

[0180] 6) The Lua script logic is executed in the Lua code block through EVALSHA (hash value) and the request processing result is returned to the remote consumer;

[0181] The improved process of the present invention will bring the following benefits:

[0182] 1) The original maintenance of the script file itself was changed to a combination of the backend system, configuration center, and Redis cluster, making the release process more standardized and convenient;

[0183] 2) Omit the download process of Lua code to increase the publishing speed;

[0184] 3) Script files are no longer stored in a decentralized manner, but are maintained centrally, which saves space and avoids differences in script file content on different servers due to unknown reasons, thus reducing the probability of errors;

[0185] 4) It eliminates the need to manually restart Nginx on many servers, reducing the probability of errors made by developers;

[0186] 5) Script hot deployment achieved through shared cache avoids temporary service unavailability caused by traditional service restart and improves user experience;

[0187] 6) Different modules of different applications are maintained in isolation to facilitate management.

[0188] A8. The method as described in A6 or 7, wherein the step of determining the script mapping value corresponding to the interface identifier comprises:

[0189] Sending the interface identifier to a configuration server so that the configuration server determines the script mapping value corresponding to the interface identifier according to a preset correspondence relationship between the service interface identifier and the script mapping value; and

[0190] Receives the script map value returned by the configuration server.

[0191] A9. The method as described in any one of A6-8, wherein the interface request further includes an application identifier, and the step of determining the script mapping value corresponding to the interface identifier further includes:

[0192] Sending the application identifier and the interface identifier to a configuration server, so that the configuration server determines the script mapping value corresponding to the interface identifier according to the corresponding relationship between the service interface identifier of the corresponding application and the script mapping value; and

[0193] Receives the script map value returned by the configuration server.

[0194] A10. The method as described in any one of A6-9, wherein the interface includes a concurrent interface and a common interface,

[0195] When the interface request is a concurrent interface request, determining a script mapping value corresponding to the interface identifier, sending the script mapping value to a cache server so that the cache server executes a corresponding script, receiving a script execution result returned by the cache server, and returning the execution result to the client;

[0196] When the interface request is a common interface request, the interface request is sent to the business server so that the business server responds to the interface request, a request response result returned by the business server is received, and the response result is returned to the client.

[0197] A12. The system as described in A11, wherein the interface identifier is an address of the interface.

[0198] A13. The system as described in A11 or 12, further comprising a configuration server, wherein the configuration server stores a correspondence between the service interface identifier and the script mapping value.

[0199] The web page server is further adapted to send the interface identifier to the configuration server;

[0200] The configuration server is adapted to determine the script mapping value corresponding to the interface identifier according to a preset correspondence relationship between the service interface identifier and the script mapping value, and return the script mapping value to the web page server.

[0201] A14. A system as described in any one of A11-13, wherein the interface request further includes an application identifier, and the configuration server further stores a correspondence between service interface identifiers of multiple applications and script mapping values,

[0202] The web page server is further adapted to send the interface identifier and the application identifier to a configuration server;

[0203] The configuration server is adapted to determine the script mapping value corresponding to the interface identifier according to the corresponding relationship between the service interface identifier and the script mapping value of the corresponding application, and return the script mapping value to the web page server.

[0204] A15. A system as described in any one of A11-14, wherein the interface includes a concurrent interface and a common interface, and the system further includes a business server,

[0205] When the interface request is a concurrent interface request:

[0206] The web page server is adapted to send the script mapping value corresponding to the interface identifier to the cache server;

[0207] The cache server is adapted to execute the script corresponding to the script mapping value, and return the script execution result to the web page server, so that the web page server returns the execution result to the client;

[0208] When the interface request is a common interface request:

[0209] The web page server is adapted to send the interface request to the business server;

[0210] The business server is adapted to respond to the interface request and return the request response result to the web page server, so that the web page server returns the response result to the client.

[0211] A16. A system as described in any one of A11-15, wherein the cache server stores a script queue to be executed, and the cache server executes each script in sequence according to the order in the script queue.

[0212] A17. The system as described in A13 further includes a management terminal, wherein the management terminal is suitable for:

[0213] Loading the script to be deployed to the cache server, and receiving the script mapping value returned by the cache server, wherein the script corresponds to a service interface of the target application; and

[0214] The service interface identifier and the script mapping value are associated and stored in the configuration server.

[0215] A18. The system as described in A17, wherein the management terminal is further suitable for configuring access parameters of the service interface corresponding to the script to limit the flow of the service interface.

[0216] A19. A system as described in A17 or 18, wherein the script mapping value is a hash value generated by processing the script using the SHA-1 algorithm.

[0217] A20. A system as described in any one of A17-19, wherein the management terminal is further adapted to:

[0218] The target application identifier, the service interface identifier and the script mapping value are associated and stored in the configuration server.

[0219] A21. A system as described in any one of A17-20, wherein the management terminal is further adapted to:

[0220] When the script is updated, the updated script is loaded to the cache server;

[0221] receiving the updated script map value returned by the cache server; and

[0222] The script mapping value of the corresponding service interface stored in the configuration server is modified to the updated script mapping value.

[0223] The various techniques described herein may be implemented in combination with hardware or software, or a combination thereof. Thus, the method and apparatus of the present invention, or some aspects or parts of the method and apparatus of the present invention may be in the form of program codes (i.e., instructions) embedded in a tangible medium, such as a removable hard disk, a USB flash drive, a floppy disk, a CD-ROM, or any other machine-readable storage medium, wherein when the program is loaded into a machine such as a computer and executed by the machine, the machine becomes a device for practicing the present invention.

[0224] In the case where the program code is executed on a programmable computer, the computing device 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. The memory is configured to store the program code; the processor is configured to execute the script deployment method or request processing method of the present invention according to the instructions in the program code stored in the memory.

[0225] By way of example and not limitation, readable media include readable storage media and communication media. Readable storage media stores information such as computer readable instructions, data structures, program modules or other data. Communication media generally embody computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and include any information transfer medium. Any combination of the above is also included within the scope of readable media.

[0226] In the description provided herein, algorithms and displays are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the examples of the present invention. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages ​​can be utilized to implement the content of the present invention described herein, and the above description of specific languages ​​is for the purpose of disclosing the best mode of the present invention.

[0227] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

[0228] 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 the devices described in the embodiment, or alternatively may be located in one or more devices different from the devices in the examples. The modules in the foregoing examples may be combined into one module or may be divided into multiple submodules.

[0229] In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present invention and form different embodiments. For example, in the claims below, any one of the claimed embodiments may be used in any combination.

[0230] In addition, some of the embodiments are described herein as methods or combinations of method elements that can be implemented by a processor of a computer system or by other devices that perform the functions. Therefore, a processor with necessary instructions for implementing the method or method elements forms a device for implementing the method or method elements. In addition, the elements described herein of the device embodiments are examples of devices for implementing the functions performed by the elements for the purpose of implementing the invention.

[0231] As used herein, unless otherwise specified, the use of ordinal numbers "first," "second," "third," etc. to describe common objects merely indicates that different instances of similar objects are involved, and is not intended to imply that the objects so described must have a given order in time, space, order, or in any other manner.

[0232] Although the present invention has been described according to a limited number of embodiments, it will be apparent to those skilled in the art, with the benefit of the above description, that other embodiments may be envisioned within the scope of the invention thus described. In addition, it should be noted that the language used in this specification is selected primarily for readability and teaching purposes, rather than for explaining or defining the subject matter of the present invention. Therefore, many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the appended claims. The disclosure of the present invention is illustrative and not restrictive with respect to the scope of the present invention, and the scope of the present invention is defined by the appended claims.

Claims

1. A script deployment method, executed in a management terminal, comprising: Loading a script to be deployed to a cache server, wherein the script corresponds to a service interface of a target application; Receive the script mapping value returned by the cache server; The service interface identifier and the script mapping value are associated and stored in a configuration server, where the script mapping values ​​of the service interfaces of multiple applications are stored; The method further comprises: storing the target application identifier, the service interface identifier and the script mapping value in association with each other in a configuration server; The service interface includes a concurrent interface and a common interface. The request data of the concurrent interface includes a sudden surge. The cache server is connected to a web server. After receiving an interface request from a client, the web server distributes the interface request according to the type of the interface request, including: When the interface request is a concurrent interface request, determining a script mapping value corresponding to the service interface identifier, sending the script mapping value to a cache server so that the cache server executes a corresponding script, receiving a script execution result returned by the cache server, and returning the script execution result to the client; When the interface request is a common interface request, sending the interface request to the business server so that the business server responds to the interface request, receiving the request response result returned by the business server, and returning the response result to the client; The interface request also includes an application identifier, and the step of determining a script mapping value corresponding to the service interface identifier includes: The application identifier and the service interface identifier are sent to a configuration server, so as to receive a script mapping value corresponding to the service interface identifier determined by the configuration server according to a correspondence between the service interface identifier and the script mapping value of the corresponding application.

2. The method according to claim 1, further comprising the steps of: The access parameters of the service interface corresponding to the script are set to limit the flow of the service interface.

3. The method of claim 1, wherein: The script mapping value is a hash value generated by processing the script using the SHA-1 algorithm.

4. The method according to any one of claims 1 to 3, wherein: When the script is updated: Load the updated script to the cache server; Receive the updated script mapping value returned by the cache server; as well as The script mapping value of the corresponding service interface stored in the configuration server is modified to the updated script mapping value.

5. A request processing method, executed in a web server, comprising: Receive an interface request from a client, wherein the interface request includes a service interface identifier; Determine a script mapping value corresponding to the service interface identifier; Sending the script mapping value to the cache server so that the cache server executes the corresponding script; Receive the script execution result returned by the cache server, and return the execution result to the client, the cache server is in communication with the management terminal, the management terminal is in communication with the configuration server, the configuration server stores script mapping values ​​of service interfaces of multiple applications, and the management terminal is suitable for associating the target application identifier, the service interface identifier and the script mapping value and storing them in the configuration server; The service interface includes a concurrent interface and a common interface. The request data of the concurrent interface includes a sudden surge. The cache server is connected to a web server. After receiving an interface request from a client, the web server distributes the interface request according to the type of the interface request, including: When the interface request is a concurrent interface request, determining a script mapping value corresponding to the service interface identifier, sending the script mapping value to a cache server so that the cache server executes a corresponding script, receiving a script execution result returned by the cache server, and returning the execution result to the client; When the interface request is a common interface request, sending the interface request to the business server so that the business server responds to the interface request, receiving the request response result returned by the business server, and returning the response result to the client; The interface request also includes an application identifier, and the step of determining a script mapping value corresponding to the service interface identifier includes: The application identifier and the service interface identifier are sent to a configuration server, so as to receive a script mapping value corresponding to the service interface identifier determined by the configuration server according to a correspondence between the service interface identifier and the script mapping value of the corresponding application.

6. The method of claim 5, wherein: The service interface identifier is the address of the service interface.

7. A service system, comprising a web server, a cache server, a management terminal, a configuration server and a web server, wherein: The webpage server is adapted to receive an interface request from a client, the interface request including a service interface identifier, determine a script mapping value corresponding to the service interface identifier, and send the script mapping value to a cache server; The cache server is adapted to execute the script corresponding to the script mapping value, and return the script execution result to the web page server, so that the web page server returns the execution result to the client; The configuration server stores script mapping values ​​of service interfaces of multiple applications, and the management terminal is adapted to associate the target application identifier, the service interface identifier and the script mapping value and store them in the configuration server; The service interface includes a concurrent interface and a common interface, the request data of the concurrent interface includes a case of instantaneous surge, the cache server is connected to a web server, and the web server is adapted to divert the interface request according to the type of the interface request after receiving the interface request from the client, including: When the interface request is a concurrent interface request, determining a script mapping value corresponding to the service interface identifier, sending the script mapping value to a cache server so that the cache server executes a corresponding script, receiving a script execution result returned by the cache server, and returning the execution result to the client; When the interface request is a common interface request, sending the interface request to the business server so that the business server responds to the interface request, receiving the request response result returned by the business server, and returning the response result to the client; The interface request also includes an application identifier, and the step of determining a script mapping value corresponding to the service interface identifier includes: The application identifier and the service interface identifier are sent to a configuration server, so as to receive a script mapping value corresponding to the service interface identifier determined by the configuration server according to a correspondence between the service interface identifier and the script mapping value of the corresponding application.

8. The system of claim 7, wherein: The service interface identifier is the address of the interface.

9. The system of claim 8, wherein: The configuration server stores the corresponding relationship between the service interface identifier and the script mapping value. The web page server is further adapted to send the service interface identifier to the configuration server; The configuration server is adapted to determine the script mapping value corresponding to the service interface identifier according to a preset correspondence relationship between the service interface identifier and the script mapping value, and return the script mapping value to the web page server.

10. The system according to any one of claims 7 to 9, wherein: The cache server stores a script queue to be executed, and the cache server executes each script in sequence according to the order in the script queue.

11. The system of claim 10, wherein: The management terminal is suitable for: The script to be deployed is loaded into the cache server, and a script mapping value returned by the cache server is received, wherein the script corresponds to a service interface of the target application.

12. The system of claim 11, wherein: The management terminal is also suitable for configuring access parameters of the service interface corresponding to the script to limit the flow of the service interface.

13. The system of claim 12, wherein: The script mapping value is a hash value generated by processing the script using the SHA-1 algorithm.

14. The system of claim 13, wherein: The management terminal is also suitable for: When the script is updated, the updated script is loaded to the cache server; Receive the updated script mapping value returned by the cache server; as well as The script mapping value of the corresponding service interface stored in the configuration server is modified to the updated script mapping value.

15. A computing device comprising: at least one processor and a memory storing program instructions; When the program instructions are read and executed by the processor, the computing device executes the script deployment method according to any one of claims 1 to 4 or the request processing method according to claim 5 or 6.

16. A readable storage medium storing program instructions, which, when read and executed by a computing device, enables the computing device to execute the script deployment method according to any one of claims 1 to 4 or the request processing method according to claim 5 or 6.

Citation Information

Patent Citations

  • Automatic script operation method and device

    CN104423948A

  • Service processing method and device based on rule file and server

    CN107948314A

  • Dynamic current limiting method, Nginx server, storage medium and device

    CN108073465A

  • Redis-based request processing method, server, and computer-readable storage medium

    CN109189576A

  • Cache file updating methods and devices, computer equipment and memory medium

    CN109413159A