Method, device and equipment for processing user access request and computer readable medium
By analyzing and verifying the application scenario service identification and input parameters in the user access request, the API gateway's traffic control is realized, which solves the problem that existing API gateways cannot effectively control traffic and improves the availability of applications.
Patent Information
- Application Number
- CN202411125509.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-15
- Publication Date
- 2024-12-13
AI Technical Summary
Existing API gateways cannot implement traffic control in multiple application scenarios, resulting in reduced application availability.
By receiving and analyzing user access requests, obtaining the service identification and input parameters of the application scenario in the access parameters, searching for verification conditions based on the verification type, verifying the input parameters, and forwarding the request to the application service when complying, otherwise intercepting the request. to achieve traffic limit.
The traffic control in a variety of application scenarios is realized, the availability of applications is improved, and the exceptions and overwhelming problems caused by non-compliance requests are avoided.
Smart Images

Figure CN119135622A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, device, equipment and computer-readable medium for processing user access requests. Background Art
[0002] An Application Programming Interface (API) gateway is located between a client and the services it depends on, and is used to connect two or more application systems.
[0003] In the microservice architecture, different business modules are subdivided into independent application systems. In order to achieve integration between application systems and communication with the outside world, an API gateway is added in the middle to assist the API call system.
[0004] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art: the use of an API gateway cannot achieve flow control in a variety of application scenarios, thereby reducing the availability of the application. Summary of the invention
[0005] In view of this, embodiments of the present invention provide a method, apparatus, device and computer-readable medium for processing user access requests, which can implement flow control in various application scenarios and improve application availability.
[0006] To achieve the above object, according to one aspect of an embodiment of the present invention, a method for processing a user access request is provided, comprising:
[0007] Receive and parse a user access request, and obtain access parameters in the user access request, wherein the access parameters include a service identifier of an application scenario and input parameters of the application scenario;
[0008] Searching for a verification condition of the verification type based on the service identifier of the application scenario and the verification type of the input parameter, and verifying the input parameter of the application scenario using the verification condition of the verification type;
[0009] If the input parameter verification of the application scenario is compliant, the user access request is forwarded to the application service corresponding to the service identifier of the application scenario.
[0010] Before receiving and parsing the user access request, the method further includes:
[0011] In the interactive interface, the service identifier and verification type of the application scenario are displayed, and verification conditions of the verification type are received and set, where the verification conditions of the verification type include the service identifier and verification type of the application scenario.
[0012] The receiving and parsing of the user access request, and obtaining the access parameters in the user access request, wherein the access parameters include the service identifier of the application scenario and the input parameters of the application scenario, include:
[0013] Receiving a user access request, and acquiring a data structure of the user access request based on a request identifier in the user access request;
[0014] According to the data structure of the user access request, the user access request is received to obtain access parameters in the user access request, where the access parameters include a service identifier of an application scenario and input parameters of the application scenario.
[0015] The searching for the verification condition of the verification type based on the service identifier of the application scenario and the verification type of the input parameter, and verifying the input parameter using the verification condition of the verification type, includes:
[0016] Searching for a verification condition of the verification type based on the service identifier of the application scenario and the verification type of the input parameter, wherein the verification condition of the verification type includes a user-defined function verification condition;
[0017] The input parameters are verified using the verification conditions of the verification type, and the verification results and verification prompt information of the input parameters are sent.
[0018] The verification result of the input parameter includes a verification violation, and the method further includes:
[0019] The verification prompt information is displayed, wherein the verification prompt information includes the verification condition of the verification type.
[0020] If all input parameters of the user access request are verified to be compliant, the user access request is forwarded to the application service corresponding to the service identifier of the application scenario, including:
[0021] If the input parameter verification of the user access request is compliant, the user access request is forwarded to the application service corresponding to the service identifier of the application scenario;
[0022] The user access request is processed in the application service according to the service identifier of the application scenario.
[0023] The method further comprises:
[0024] If the input parameter verification of the user access request violates the rules, the user access request is intercepted to implement access restriction of the user access request.
[0025] According to a second aspect of an embodiment of the present invention, there is provided a device for processing a user access request, comprising:
[0026] A receiving module, used to receive and parse a user access request, and obtain access parameters in the user access request, wherein the access parameters include a service identifier of an application scenario and input parameters of the application scenario;
[0027] A verification module, used to search for a verification condition of the verification type based on the service identifier of the application scenario and the verification type of the input parameter, and verify the input parameter of the application scenario using the verification condition of the verification type;
[0028] The forwarding module is used to verify that the input parameters of the application scenario are compliant, and then forward the user access request to the application service corresponding to the service identifier of the application scenario.
[0029] According to a third aspect of an embodiment of the present invention, there is provided an electronic device for processing a user access request, including:
[0030] one or more processors;
[0031] a storage device for storing one or more programs,
[0032] When the one or more programs are executed by the one or more processors, the one or more processors implement the above method.
[0033] According to a fourth aspect of an embodiment of the present invention, there is provided a computer-readable medium on which a computer program is stored, and when the program is executed by a processor, the method as described above is implemented.
[0034] One embodiment of the above invention has the following advantages or beneficial effects: receiving and parsing a user access request, obtaining access parameters in the user access request, the access parameters including the service identifier of the application scenario and the input parameters of the application scenario; searching for the verification condition of the verification type based on the service identifier of the application scenario and the verification type of the input parameters, and using the verification condition of the verification type to verify the input parameters of the application scenario; if the input parameters of the application scenario are verified to be compliant, the user access request is forwarded to the application service corresponding to the service identifier of the application scenario. The input parameters in the user access request can be verified based on the application scenario, so that flow control of multiple application scenarios can be achieved, and the availability of the application can be improved.
[0035] 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
[0036] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0037] Figure 1This is a schematic diagram of the API gateway processing user access requests;
[0038] Figure 2 is a main flow chart of a method for processing a user access request according to an embodiment of the present invention;
[0039] Figure 3 is a schematic diagram of a process of parsing a user access request to obtain input parameters according to an embodiment of the present invention;
[0040] Figure 4 is a schematic diagram of a process of verifying input parameters using verification conditions of a verification type according to an embodiment of the present invention;
[0041] Figure 5 is a schematic diagram of a process of forwarding a user access request to an application service according to an embodiment of the present invention;
[0042] Figure 6 is an interactive schematic diagram of a method for an application to process a user access request according to an embodiment of the present invention;
[0043] Figure 7 is a flow chart of a method for an application to process a user access request according to an embodiment of the present invention;
[0044] Figure 8 is a main structural diagram of an apparatus for processing a user access request according to an embodiment of the present invention;
[0045] Fig. 9 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0046] Fig.10 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0047] 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.
[0048] See also Figure 1 That is 100, Figure 1 This is a schematic diagram of the API gateway processing user access requests. The user sends a request to the API gateway, and the system application first verifies the input parameters of the request and then processes the data. Among them, the system application group provides a variety of application services, such as: express application services; merchant application services and basic application services.
[0049] The user sends a request directly to the application service, but the application service refuses to process the request because it does not pass through the API gateway.
[0050] In order to prevent applications from being overwhelmed by instantaneous traffic peaks and ensure high availability of applications, traffic restrictions are required. That is, according to indicators such as the number of requests, the number of concurrent threads of application services, and response time, the number of randomly arriving requests is adjusted to an appropriate traffic size or requests are restricted.
[0051] The API Gateway implements traffic restrictions in the following ways.
[0052] Method 1: Authentication, that is, judging whether the requesting user is a registered user. For unregistered users, the API gateway directly returns an error message, and the access request of unregistered users cannot reach the application server, thus achieving the purpose of limiting the flow.
[0053] Method 2: Restrict target users from accessing a certain API or route through the client, header, or URL parameters. That is, if it is known that some users have malicious or abnormal requests, add the user's network IP to the blacklist. When the blacklisted user tries to access the service again, the API gateway returns an error message, and the user's access request cannot reach the application server, achieving the purpose of current limiting.
[0054] Method 3: If the request frequency exceeds the limit within a certain period of time (seconds, minutes, hours, days, etc.), access to a certain API route will be restricted. That is, if the user's request frequency is abnormal within a specific period of time, access to the service will be restricted.
[0055] For example, by calculating the average order query frequency of each merchant in a certain period of time, it is calculated that the request is once within 1 second. If a user requests more than 100 times within 1 second during this period of time, the API gateway restricts access to achieve the purpose of limiting the flow.
[0056] The API Gateway cannot implement traffic restrictions for the following scenarios. The user access request frequency meets the threshold requirements, that is, the frequency has not exceeded the limit. However, the user access request is an illegal request, such as missing parameters and wrong parameter data types. There are many illegal user access requests, which can easily cause anomalies and overwhelm downstream services during peak application usage.
[0057] In summary, the use of API gateway cannot achieve traffic control in various application scenarios, thereby reducing the availability of the application.
[0058] In order to solve the problem that the API gateway cannot realize traffic control in various application scenarios, the following technical solution in the embodiment of the present invention can be adopted.
[0059] See also Figure 2 , Figure 2 It is a main flow chart of a method for processing a user access request according to an embodiment of the present invention, wherein access parameters of the user access request are verified using verification conditions of an application scenario to improve the compliance of the access parameters in the user access request. Figure 2 The technical solutions in can be implemented inside or outside the API gateway. Figure 2 As shown in 200, the following steps are specifically included:
[0060] S201: Receive and parse a user access request, and obtain access parameters in the user access request, where the access parameters include a service identifier of an application scenario and input parameters of the application scenario.
[0061] In an embodiment of the present invention, a user access request sent by a gateway is first received, and then the user access request is parsed. As an embodiment, the user access request is parsed according to the data structure of the user access request. The data structure of the user access request can be preset.
[0062] In one embodiment of the present invention, the verification condition is received and set through the interactive interface. Specifically, in the interactive interface, the service identifier and verification type of the application scenario are displayed, and the verification condition of the verification type is received and set, and the verification condition of the verification type includes the service identifier and verification type of the application scenario.
[0063] As an example, the verification condition of the verification type is set through the filter of the API gateway. That is, in the interactive interface, the service identifier and the verification type of the application scenario are displayed, and the verification condition of the verification type is received and set through the filter of the API gateway, and the verification condition of the verification identifier includes the service identifier and the verification type of the application scenario.
[0064] In one embodiment of the present invention, the following can be executed in the filter of the API gateway: Figure 2 As an example, the functions of the filter of the API gateway include one or more of the following: permission verification, security, authentication, current limiting, protocol conversion, error code unification, caching, logging, monitoring and alarming.
[0065] As an example, register a schema instance in advance in the API gateway to integrate with the implementation logic of the API gateway. Use the schema to set the validation conditions of the validation type, and then call the validation method of the schema to validate the input parameters using the validation conditions of the validation type. Using the schema, the input parameters can be validated from the API gateway using the validation conditions of the validation type in a timely manner, and the API gateway can be fully integrated.
[0066] See also Figure 3 That is 300, Figure 31 is a flow chart of parsing a user access request to obtain access parameters according to an embodiment of the present invention. Specifically, the following steps are included:
[0067] S301: Receive a user access request, and acquire a data structure of the user access request based on a request identifier in the user access request.
[0068] After receiving the user access request sent by the gateway, the identifier of the user access request is obtained. According to the request identifier in the user access request, the data structure of the user access request can be obtained. As an example, the data structure of the user access request includes a field position and a field type.
[0069] S302: Receive the user access request according to the data structure of the user access request and obtain access parameters in the user access request, where the access parameters include a service identifier of the application scenario and input parameters of the application scenario.
[0070] Based on the data structure of the user access request, the user access request is parsed, and then the user access request is received to obtain access parameters in the user access request, wherein the access parameters include the service identifier of the application scenario and the input parameters of the application scenario.
[0071] The application scenario is the usage scenario of the user's access request. As an example, the application scenario includes browsing pages, searching for information, and receiving information. The service identifier of the application scenario includes the identifier of the application scenario and the application service identifier corresponding to the application scenario. As an example, in the application scenario of browsing pages, the application service identifier is: A.
[0072] exist Figure 3 In the embodiment, the user access request is parsed to obtain the service identifier of the application scenario and the input parameters of the application scenario.
[0073] S202: Search for verification conditions of the verification type based on the service identifier of the application scenario and the verification type of the input parameter, and use the verification conditions of the verification type to verify the input parameter.
[0074] In an embodiment of the present invention, verification can be implemented for the verification type in the input parameter. As an example, the verification type includes one or more of the following: field type, field length, and field content. Among them, the field content includes sensitive words and / or illegal words, etc.
[0075] Specifically, based on the service identifier of the application scenario and the verification type of the input parameter, a verification condition of the verification type is searched. The verification condition is related to the application scenario and the verification type. Then, the input parameter is verified using the verification condition of the verification type.
[0076] See also Figure 4 That is 400, Figure 41 is a flow chart of checking input parameters using a check condition of a check type according to an embodiment of the present invention. Specifically, the following steps are included:
[0077] S401. Search for verification conditions of a verification type based on a service identifier of an application scenario and a verification type of an input parameter. The verification conditions of the verification type include a user-defined function verification condition.
[0078] The validation conditions are stored in the database, and the validation conditions of the validation type can be searched by applying the service identifier of the scenario and the validation type of the input parameter.
[0079] In one embodiment of the present invention, the verification type includes the field type, and the input parameters include the field name of the input parameter, whether the field name must have a value, the data type of the field name, and the length of the field name.
[0080] As an example, the field type of the input parameter includes one or more of the following: integer, float, array, regexp, object, method, email, number, date, url, hex, boolean, and string.
[0081] For the service identifier of the application scenario and the field type of each input parameter, the verification condition of the verification type is preset. As an example, for application scenario 1 and the field type of the input parameter includes integer, the verification condition of the preset field type includes the value range: 1 to 2. For application scenario 2 and the field type of the input parameter includes float, the verification condition of the preset field type includes the value range: retain two decimal places.
[0082] The check condition of the preset field type includes at least one of the following: non-empty check (required), blank character check (whitespace), range check (range), enumeration check (enum) and regular check (pattern).
[0083] In one embodiment of the present invention, the validation condition of the field type includes a custom function validation condition. As an embodiment, custom rule = {validator: function (rule, value, callback, source, options) {}}, and the above rule is used as the custom function validation condition.
[0084] In one embodiment of the present invention, the validation condition of the field type includes multiple validation sub-conditions. As an example, for the input parameter: children, validation sub-condition 1 and validation sub-condition 2 need to be satisfied. Verification sub-condition 1 includes: a non-empty array with a minimum length of 1, rule = [{type:'array',required:true,min:1}; validation sub-condition 2 includes: the first value of the array must be 10. rule = {validator:function(rule,value,callback){xxxx}}].
[0085] S402: Verify input parameters using verification conditions of the verification type, and send verification results and verification prompt information of the input parameters.
[0086] After obtaining the verification conditions of the verification type, you can use the verification conditions of the verification type to verify the input parameters, and send the verification results and verification prompt information of the input parameters. Verify each input parameter using the verification conditions of the verification type. The verification results of the input parameters include verification success and verification failure.
[0087] The verification prompt information is related to the verification result. As an example, the verification result of the input parameter includes verification success, and the verification prompt information includes "passed verification condition".
[0088] exist Figure 4 In the embodiment, the service identifier of the application scenario and the verification type of the input parameter are used to search for the verification condition of the verification type to verify the input parameter, thereby implementing the verification of the input parameter.
[0089] In one embodiment of the present invention, in order to improve the compliance of input parameters, when the verification result of the input parameters includes a verification violation, verification prompt information is displayed, and the verification prompt information includes a verification condition of the verification type. As an example, the verification prompt information is displayed in the user's interactive interface. In this way, when inputting parameters in the interactive interface again, the input parameters can be determined by referring to the verification condition of the verification type.
[0090] S203: If the input parameter verification of the application scenario is compliant, the user access request is forwarded to the application service corresponding to the service identifier of the application service.
[0091] If the input parameter verification of the application scenario is compliant, the user access request can be forwarded to the application service corresponding to the service identifier of the application service. As an example, if the input parameter verification compliance ratio of the application scenario is higher than the preset verification threshold, the input parameter verification of the application scenario is determined to be compliant. As an example, the preset verification threshold is 80%.
[0092] The user access request corresponding to the verified compliant input parameters is forwarded to the application service, so that when the application service processes the user request, the failure of processing the request due to incorrect input parameters is avoided.
[0093] See also Figure 5 That is 500, Figure 5 This is a flow chart of forwarding a user access request to an application service according to an embodiment of the present invention. Specifically, it includes the following steps:
[0094] S501: If the input parameter verification of the user access request is compliant, the user access request is forwarded to the application service corresponding to the service identifier of the application scenario.
[0095] After determining that the input parameter verification of the user access request is compliant, it means that the input parameter meets the verification conditions, and the user access request can be forwarded to the application service corresponding to the service identifier of the application scenario to execute the user access request in the application service.
[0096] S502: Process the user access request in the application service according to the service identifier of the application scenario.
[0097] After the application service receives the user access request, since the user access request belongs to the application scenario, in order to improve the accuracy of processing the user access request, the user access request is processed in the application service according to the service identifier of the application scenario. As an example, the service identifier of the application scenario is: buying goods, then the user access request is processed on the shopping page. As another example, the identifier of the application scenario is: selling goods, then the user access request is processed on the selling page.
[0098] exist Figure 5 In the embodiment, the user access request is processed according to the service identifier of the application scenario to improve the pertinence of processing the request.
[0099] In one embodiment of the present invention, if the input parameter check of the user access request violates the rules, the user access request is intercepted to implement access restriction of the user access request.
[0100] If the input parameter verification of the user access request violates the rules, it means that there is a high possibility of an operation error in the application service processing the user access request. In order to avoid operation failure, the user access request can be intercepted, and the user access request corresponding to the input parameter with the verification violation is prohibited from accessing the application service, so as to implement access restriction of the user access request.
[0101] See also Figure 6 That is 600, Figure 6 The diagram is an interactive diagram of a method for an application to process a user access request according to an embodiment of the present invention.
[0102] The user must first pass authentication. The purpose of authentication is to determine whether the user's access request comes from a legitimate user. If it is not a legitimate user, an error prompt will be directly returned. This can reduce the amount of data processed.
[0103] After authentication is successful, a user access request is sent to verify whether the request is compliant. If the user access request is compliant, the user access request is sent to the application service; if the user access request is not compliant, feedback is given to the user. The application service returns the processing result of the user access request to the user.
[0104] See also Figure 7 That is 700, Figure 7 The figure is a flowchart of a method for an application to process a user access request according to an embodiment of the present invention.
[0105] Figure 7 The user access request passes through the API gateway. The method of applying the user access request can be implemented inside the API gateway to verify the user access request. Verify the compliant user access request and then forward it to the corresponding application service. By verifying the user access request, intercept the non-compliant user access request and implement traffic restriction.
[0106] In the above-mentioned embodiment of the present invention, a user access request is received and parsed, and access parameters in the user access request are obtained, wherein the access parameters include a service identifier of an application scenario and input parameters of the application scenario; based on the service identifier of the application scenario and the verification type of the input parameters, a verification condition of the verification type is searched, and the input parameters of the application scenario are verified using the verification condition of the verification type; if the input parameters of the application scenario are verified to be compliant, the user access request is forwarded to the application service corresponding to the service identifier of the application scenario, so as to process the user access request in the application service. The input parameters in the user access request can be verified based on the application scenario, so that flow control of multiple application scenarios can be achieved, thereby improving the availability of the application.
[0107] Specifically, 1. The data verification of input parameters can be transferred to the API gateway layer for processing.
[0108] 2. Satisfy the business developers' requirements for limiting traffic in specific scenarios. In different application scenarios, adopt corresponding verification conditions.
[0109] 3. Ensure that the application server only processes valid and legal user access requests; unconventional and invalid user access requests can be intercepted and processed by the API gateway. In turn, the application service is not required to process dirty data.
[0110] Therefore, it is possible to implement traffic control in various application scenarios, effectively remove dirty data from applications, and improve application availability.
[0111] See also Figure 8 , Figure 8 is a schematic diagram of the main structure of the device for processing user access requests according to an embodiment of the present invention. The device for processing user access requests can be set in an API gateway. The device for processing user access requests can implement a method for processing user access requests, such as Figure 8 As shown in 800, the device for processing the user access request specifically includes:
[0112] The receiving module 801 is used to receive and parse a user access request, and obtain access parameters in the user access request, where the access parameters include a service identifier of an application scenario and input parameters of the application scenario;
[0113] A verification module 802, configured to search for a verification condition of the verification type based on the service identifier of the application scenario and the verification type of the input parameter, and verify the input parameter of the application scenario using the verification condition of the verification type;
[0114] The forwarding module 803 is used to verify that the input parameters of the application scenario are compliant, and then forward the user access request to the application service corresponding to the service identifier of the application scenario.
[0115] In one embodiment of the present invention, the receiving module 801 is specifically used to display the service identifier and verification type of the application scenario in the interactive interface, receive and set the verification conditions of the verification identifier, and the verification conditions of the verification type include the service identifier and verification type of the application scenario.
[0116] In one embodiment of the present invention, the receiving module 801 is specifically configured to receive a user access request and obtain a data structure of the user access request based on a request identifier in the user access request;
[0117] According to the data structure of the user access request, the user access request is received to obtain access parameters in the user access request, where the access parameters include a service identifier of an application scenario and input parameters of the application scenario.
[0118] In one embodiment of the present invention, the verification module 802 is specifically used to search for the verification condition of the verification type based on the service identifier of the application scenario and the verification type of the input parameter, and the verification condition of the verification type includes a custom function verification condition;
[0119] The input parameters are verified using the verification conditions of the verification type, and the verification results and verification prompt information of the input parameters are sent.
[0120] In one embodiment of the present invention, the verification result of the input parameter includes a verification violation, and the verification module 802 is specifically used to display the verification prompt information, and the verification prompt information includes the verification condition of the verification type.
[0121] In one embodiment of the present invention, the forwarding module 803 is specifically used to verify compliance of input parameters of the user access request, and then forward the user access request to the application service corresponding to the service identifier of the application scenario;
[0122] The user access request is processed in the application service according to the service identifier of the application scenario.
[0123] In one embodiment of the present invention, the forwarding module 803 is specifically configured to intercept the user access request if there is a violation in the input parameter verification of the user access request, so as to implement access restriction of the user access request.
[0124] Fig. 9 An exemplary system architecture 900 is shown to which the method for processing a user access request or the apparatus for processing a user access request according to an embodiment of the present invention can be applied.
[0125] like Fig. 9 As shown, system architecture 900 may include terminal devices 901, 902, 903, network 904 and server 905. Network 904 is used to provide a medium for communication links between terminal devices 901, 902, 903 and server 905. Network 904 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0126] Users can use terminal devices 901, 902, 903 to interact with server 905 through network 904 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 901, 902, 903, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only examples).
[0127] The terminal devices 901 , 902 , and 903 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers, etc.
[0128] The server 905 may be a server that provides various services, such as a backend management server (only an example) that provides support for shopping websites browsed by users using the terminal devices 901, 902, and 903. The backend management server may analyze and process the received data such as product information query requests, and feed back the processing results (such as target push information, product information - only an example) to the terminal device.
[0129] It should be noted that the method for processing user access requests provided in the embodiment of the present invention is generally executed by the server 905 , and accordingly, the device for processing user access requests is generally set in the server 905 .
[0130] It should be understood that Fig. 9 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.
[0131] Reference below Fig.10 , which shows a schematic diagram of the structure of a computer system 1000 of a terminal device suitable for implementing an embodiment of the present invention. Fig.10 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.
[0132] like Fig.10 As shown, the computer system 1000 includes a central processing unit (CPU) 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage part 1008 into a random access memory (RAM) 1003. In the RAM 1003, various programs and data required for the operation of the system 1000 are also stored. The CPU 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.
[0133] The following components are connected to the I / O interface 1005: an input section 1006 including a keyboard, a mouse, etc.; an output section 1007 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN card, a modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1010 as needed, so that a computer program read therefrom is installed into the storage section 1008 as needed.
[0134] 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 1009, and / or installed from the removable medium 1011. When the computer program is executed by the central processing unit (CPU) 1001, the above-mentioned functions defined in the system of the present invention are executed.
[0135] 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.
[0136] 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.
[0137] The modules involved in the embodiments of the present invention may be implemented in software or hardware. The modules described may also be set in a processor, for example, they may be described as: a processor including a receiving module, a verification module and a forwarding module. The names of these modules do not constitute a limitation on the modules themselves in some cases, for example, the receiving module may also be described as "used to receive and parse user access requests, obtain access parameters in the user access requests, and the access parameters include a service identifier of an application scenario and input parameters of the application scenario".
[0138] 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:
[0139] Receive and parse a user access request, and obtain access parameters in the user access request, wherein the access parameters include a service identifier of an application scenario and input parameters of the application scenario;
[0140] Searching for a verification condition of the verification type based on the service identifier of the application scenario and the verification type of the input parameter, and verifying the input parameter of the application scenario using the verification condition of the verification type;
[0141] If the input parameter verification of the application scenario is compliant, the user access request is forwarded to the application service corresponding to the service identifier of the application scenario.
[0142] According to the technical solution of the embodiment of the present invention, a user access request is received and parsed, and access parameters in the user access request are obtained, wherein the access parameters include the service identifier of the application scenario and the input parameters of the application scenario; based on the service identifier of the application scenario and the verification type of the input parameters, the verification condition of the verification type is searched, and the input parameters of the application scenario are verified using the verification condition of the verification type; if the input parameters of the application scenario are verified to be compliant, the user access request is forwarded to the application service corresponding to the service identifier of the application scenario. The input parameters in the user access request can be verified based on the application scenario, so that flow control of multiple application scenarios can be achieved, thereby improving the availability of the application.
[0143] The above specific implementation methods do not constitute limitations on the scope of protection of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention. It should be noted that in the technical solution disclosed in this disclosure, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
Claims
1. A method for processing a user access request, characterized in that: include: Receive and parse a user access request, and obtain access parameters in the user access request, wherein the access parameters include a service identifier of an application scenario and input parameters of the application scenario; Searching for a verification condition of the verification type based on the service identifier of the application scenario and the verification type of the input parameter, and verifying the input parameter of the application scenario using the verification condition of the verification type; If the input parameter verification of the application scenario is compliant, the user access request is forwarded to the application service corresponding to the service identifier of the application scenario.
2. The method for processing a user access request according to claim 1, characterized in that: Before receiving and parsing the user access request, the method further includes: In the interactive interface, the service identifier and verification type of the application scenario are displayed, and verification conditions of the verification type are received and set, where the verification conditions of the verification type include the service identifier and verification type of the application scenario.
3. The method for processing user access requests according to claim 1, characterized in that: The receiving and parsing of the user access request, and obtaining the access parameters in the user access request, wherein the access parameters include the service identifier of the application scenario and the input parameters of the application scenario, include: Receiving a user access request, and acquiring a data structure of the user access request based on a request identifier in the user access request; According to the data structure of the user access request, the user access request is received to obtain access parameters in the user access request, where the access parameters include a service identifier of an application scenario and input parameters of the application scenario.
4. The method for processing user access requests according to claim 1, characterized in that: The searching for the verification condition of the verification type based on the service identifier of the application scenario and the verification type of the input parameter, and verifying the input parameter using the verification condition of the verification type, includes: Searching for a verification condition of the verification type based on the service identifier of the application scenario and the verification type of the input parameter, wherein the verification condition of the verification type includes a user-defined function verification condition; The input parameters are verified using the verification conditions of the verification type, and the verification results and verification prompt information of the input parameters are sent.
5. The method for processing user access requests according to claim 4, characterized in that: The verification result of the input parameter includes a verification violation, and the method further includes: The verification prompt information is displayed, wherein the verification prompt information includes the verification condition of the verification type.
6. The method for processing user access requests according to claim 1, characterized in that: If all input parameters of the user access request are verified to be compliant, the user access request is forwarded to the application service corresponding to the service identifier of the application scenario, including: If the input parameter verification of the user access request is compliant, the user access request is forwarded to the application service corresponding to the service identifier of the application scenario; The user access request is processed in the application service according to the service identifier of the application scenario.
7. The method for processing user access requests according to claim 1, characterized in that: The method further comprises: If the input parameter verification of the user access request violates the rules, the user access request is intercepted to implement access restriction of the user access request.
8. A device for processing a user access request, characterized in that: include: A receiving module, used to receive and parse a user access request, and obtain access parameters in the user access request, wherein the access parameters include a service identifier of an application scenario and input parameters of the application scenario; A verification module, used to search for a verification condition of the verification type based on the service identifier of the application scenario and the verification type of the input parameter, and verify the input parameter of the application scenario using the verification condition of the verification type; The forwarding module is used to verify that the input parameters of the application scenario are compliant, and then forward the user access request to the application service corresponding to the service identifier of the application scenario.
9. An electronic device for processing a user access request, 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 7.
10. 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 7 is implemented.
