CN114390108B - Method and system for processing user service request - Google Patents

Method and system for processing user service request Download PDF

Info

Publication number
CN114390108B
CN114390108B CN202111487461.2A CN202111487461A CN114390108B CN 114390108 B CN114390108 B CN 114390108B CN 202111487461 A CN202111487461 A CN 202111487461A CN 114390108 B CN114390108 B CN 114390108B
Authority
CN
China
Prior art keywords
user
service
data
proxy gateway
service request
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111487461.2A
Other languages
Chinese (zh)
Other versions
CN114390108A (en
Inventor
王洪磊
揭震
马超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sina Technology China Co Ltd
Original Assignee
Sina Technology China Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sina Technology China Co Ltd filed Critical Sina Technology China Co Ltd
Priority to CN202111487461.2A priority Critical patent/CN114390108B/en
Publication of CN114390108A publication Critical patent/CN114390108A/en
Application granted granted Critical
Publication of CN114390108B publication Critical patent/CN114390108B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 

Abstract

The invention discloses a method and a system for processing a user service request, which are used for solving the problem of poor flexibility in processing the user service request. Comprising the following steps: the proxy gateway monitors user flow data received by the input port and sends the user flow data to a service route matched with the input port; the middleware of the service route configuration monitors the user flow data passing through the service route and sends a matching result to the proxy gateway; if the matching result represents that the user flow data is matched with the target middleware rule, the proxy gateway executes matched processing operation on the user service request according to the target middleware rule; if the matching result indicates that the user flow data does not have the matched middleware rule, the proxy gateway sends the user flow data to a server with matched service routes, and responds to the user service request according to the data fed back by the server. According to the scheme, matched processing operation is executed on the request matched with the target middleware rule through monitoring the data, so that the request processing flexibility is improved.

Description

Method and system for processing user service request
Technical Field
The present invention relates to the field of communications, and in particular, to a method and system for processing a user service request.
Background
In the field of communications, services are often deployed in a number of different forms. For example, there are services deployed using a physical environment, services deployed using a virtual machine, and services deployed using a container. These differently deployed services are dispersed in different environments and it is difficult to achieve uniform management and configuration. For services deployed in different forms, if business functions are to be added, plug-in functions are often required to be developed based on the deployment form, business function application is realized through the system, and the flexibility is poor due to the limitation of the deployment form.
How to improve the flexibility of processing the user service request is a technical problem to be solved by the application.
Disclosure of Invention
An object of the embodiments of the present application is to provide a method and a system for processing a user service request, so as to solve the problem of poor flexibility in processing the user service request.
In a first aspect, a method for processing a user service request is provided, including:
the proxy gateway monitors user flow data received by an input port, wherein the user flow data comprises a user service request;
the proxy gateway sends the user flow data to a service route matched with the input port;
The middleware of the service route configuration monitors the user flow data passing through the service route and sends a matching result of whether the user flow data matches a target middleware rule to the proxy gateway;
if the matching result represents that the user flow data is matched with the target middleware rule, the proxy gateway executes matched processing operation on the user service request according to the target middleware rule;
and if the matching result indicates that the user flow data does not have the matched middleware rule, the proxy gateway sends the user flow data to a server with matched service route, and responds to a user service request according to the data fed back by the server.
In a second aspect, a system for processing a user service request is provided, comprising:
an input port for receiving user traffic data, the user traffic data comprising a user service request;
a proxy gateway in communication connection with the input port monitors user flow data received by the input port and sends the user flow data to a service route matched with the input port;
The service route is configured with middleware, monitors user flow data passing through the service route, and sends a matching result of whether the user flow data matches a target middleware rule to the proxy gateway;
if the matching result represents that the user flow data is matched with the target middleware rule, the proxy gateway executes matched processing operation on the user service request according to the target middleware rule;
and if the matching result indicates that the user flow data does not have the matched middleware rule, the proxy gateway sends the user flow data to a server with matched service route, and responds to a user service request according to the data fed back by the server.
In the embodiment of the application, monitoring user flow data received by an input port through a proxy gateway, wherein the user flow data comprises a user service request; the proxy gateway sends the user flow data to a service route matched with the input port; the middleware of the service route configuration monitors the user flow data passing through the service route and sends a matching result of whether the user flow data matches a target middleware rule to the proxy gateway; if the matching result represents that the user flow data is matched with the target middleware rule, the proxy gateway executes matched processing operation on the user service request according to the target middleware rule; and if the matching result indicates that the user flow data does not have the matched middleware rule, the proxy gateway sends the user flow data to a server with matched service route, and responds to a user service request according to the data fed back by the server. According to the scheme, the matched processing operation is executed on the request matched with the preset middleware rule by monitoring the data, so that the request processing flexibility is improved. The middleware rule can be flexibly set according to requirements, the middleware can judge and match the user flow data passing through the service route in a monitoring mode, the middleware hot loading can be supported, the middleware rule can be increased or decreased under the condition that the whole system is not restarted, and negative influence on the user flow data in the receiving and transmitting process is avoided.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the invention and do not constitute a limitation on the invention. In the drawings:
fig. 1 is one of the flow diagrams of a method of handling a user service request according to an embodiment of the present invention.
FIG. 2 is a second flow chart of a method of handling a user service request according to an embodiment of the present invention.
FIG. 3 is a third flow chart of a method of handling a user service request according to an embodiment of the present invention.
FIG. 4 is a flow chart of a method of handling a user service request according to an embodiment of the present invention.
Fig. 5 is a flow chart of a method of handling a user service request according to an embodiment of the present invention.
FIG. 6 is a flow chart of a method of handling a user service request according to an embodiment of the present invention.
Fig. 7 is a schematic diagram of a system architecture for processing a user service request according to an embodiment of the present invention.
FIG. 8 is a second schematic diagram of a system for handling user service requests according to an embodiment of the present invention.
FIG. 9 is a third exemplary system architecture for handling user service requests according to one embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention. The reference numerals in the present application are only used to distinguish the steps in the scheme, and are not used to limit the execution sequence of the steps, and the specific execution sequence controls the description in the specification.
In the field of communications, unified management of services deployed in different forms is often required. For example, in the process of service migration containers, because some services cannot be deployed using container environments, the services are scattered in different environments, and meanwhile, different environments need to use different agents or gateways to perform load balancing and traffic management on the services, so that the management efficiency is low, and more manpower and time are required to be consumed. In order to solve the problems in the prior art, the embodiment of the application provides a method for processing a user service request, which is used for gateways compatible with various environments, can be used for automatically acting to uniformly manage services deployed in different forms, and is beneficial to controlling the flow of a domain and mastering service conditions in practical application.
In order to solve the problems in the prior art, an embodiment of the present application provides a method for processing a user service request, as shown in fig. 1, including:
s11: the proxy gateway monitors user traffic data received by the input port, wherein the user traffic data comprises a user service request.
The step may be performed by a proxy gateway, which may be an electronic component with data processing functionality, in particular a computer, a mobile phone, a server, etc.
The input port may receive user traffic data, which may be traffic data from a user terminal, through a wired or wireless manner. The user traffic data includes a user service request for requesting to provide a service to the client. Specifically, the user service request may carry an identifier of the requested service, which is used to characterize information such as a specific service type and content to be requested, and the user service request may be used to instruct the server to provide a corresponding service.
In this step, the proxy gateway listens for user traffic data received at the input port. The proxy gateway can be in communication connection with a plurality of input ports, and monitors user flow data received by the plurality of input ports.
Optionally, the input ports are preconfigured with protocol types, and each input port is configured to receive a user service request of a matched protocol type. The user service request in the user traffic data includes at least one of: hypertext transfer http protocol service request, transfer control tcp protocol service request, user datagram udp protocol service request.
In order to receive the user service requests of the multiple types of protocols, the input port in the scheme can be preconfigured with the corresponding type of protocol, and the name of the set port and the configured protocol type are associated in advance. For example, pre-configuration of input ports includes:
Entrypoints:
http:
Port:80
https:
Port:443
Tcp10900:
Port:10900
Udp53:
Port:53
wherein, "http: port:80", which means that the protocol corresponding to the port with the port name of http is the http protocol, and the port number is 80; "https: port: 443' indicates that the protocol corresponding to the port with the port name https is https protocol, and the port number is 443; "Tcp10900: port:10900 "denotes that the protocol corresponding to the port with the port name Tcp10900 is Tcp protocol, and the port number is 10900; "Udp53: port:53 "indicates that the protocol corresponding to the port whose port name is Udp53 is the Udp protocol, and the port number is 53.
S12: the proxy gateway sends the user traffic data to a service route that matches the input port.
The input port may preset a matched service route, and correspondingly, the type of the service route is matched with the type of the input port. For example, tcp input ports match tcp service routes, http input ports match http service routes, udp input ports match udp service routes, and so on.
In this step, the user traffic data is sent to the matched service route through the input port. The matching relationship between the input port and the service route may be preset through the proxy gateway. Wherein one input port may be matched with multiple service routes.
S13: and the middleware of the service route configuration monitors the user flow data passing through the service route and sends a matching result of whether the user flow data matches a target middleware rule to the proxy gateway.
The middleware can be preconfigured to the service route in a binding mode, and middleware rules are preset in the middleware. The middleware rule is used for carrying out preset processing operation on user flow data conforming to the rule. Wherein, the middleware can be arranged in the service route through the form of a plug-in. When middleware rules need to be added, deleted or modified, the middleware rules can be implemented by configuring middleware. The modified configuration can be applied through hot loading, the whole system is not required to be restarted, and negative influence on the received and transmitted user flow data is avoided.
Optionally, the middleware matched with the service route may be preset with a plurality of middleware rules. Alternatively, the service route may match multiple middleware, each of which is pre-configured with a middleware rule.
And the middleware monitors the user traffic data passing through the service route, judges whether a target middleware rule matched with the user traffic data exists, generates a matching result and sends the matching result to the proxy gateway. Wherein, if there is a matching target middleware rule, the generated matching result may include a matching processing operation, so that the proxy gateway performs processing according to the matching operation of the target middleware rule.
S14: and if the matching result represents that the user traffic data is matched with the target middleware rule, the proxy gateway executes matched processing operation on the user service request according to the target middleware rule.
And the middleware performs matching calculation on the user traffic data passing through the service route and the middleware rule, and if the user traffic data passing through the service route hits the target middleware rule, the proxy gateway performs corresponding processing on the user traffic data according to the matched processing operation. The target middleware rule specifically comprises preset user flow data conditions and corresponding processing operations, and if the middleware identifies the user flow data conforming to the target middleware rule, the proxy gateway is informed to execute the processing according to the corresponding processing operations through the matching result.
In practical application, the middleware rule may only include a preset user traffic data condition, and when the user traffic data meets the preset user traffic data condition, it is determined that the user traffic data hits the target middleware rule. The proxy gateway may then be instructed to perform the matched processing operations according to the function of the middleware that the target middleware rule matches.
For example, assume that a first middleware corresponding to a service route is used to identify blacklisted users, a second middleware is used to identify risky users, and a third middleware is used to identify false requests.
And then, the first middleware monitors the user flow data passing through the service route according to the preset blacklist user, and if the user flow data hit by the blacklist user, namely the user flow data come from the user side of the blacklist user, a corresponding matching result is generated to instruct the proxy gateway to reject the service request.
The second middleware can monitor the user traffic data passing through the service route according to the risk user, and if the user traffic data hit the risk user, namely the user traffic data come from the user end of the risk user, a corresponding matching result is generated so as to instruct the proxy gateway to execute the current limiting or other types of limiting operation on the user traffic data.
The third middleware can monitor the user flow data passing through the service route according to the error request rule, and if the user service request in the user flow data is monitored to be incomplete or illegal, a corresponding matching result is generated to instruct the proxy gateway to request retry to the user terminal, so as to instruct the user terminal to resend the user service request.
S15: and if the matching result indicates that the user flow data does not have the matched middleware rule, the proxy gateway sends the user flow data to a server with matched service route, and responds to a user service request according to the data fed back by the server.
The service route may preset a matched server. Alternatively, the number of servers matching one service route may be plural, and different servers may be used to provide different service functions. In practical applications, service routing and server matching may be performed based on preset input ports. The input port and the service route can be in a many-to-many matching relationship, and the service route and the server can also be in a many-to-many matching relationship.
And if the matching result indicates that the user traffic data does not have the matching middleware rule, the user traffic data is sent to the matched server based on the service route so as to request the server to provide the back-end service required by the user. After receiving the user traffic data, the server can provide service according to the specific content of the user service request and feed back the data representing the provision of the corresponding service, and if the proxy gateway receives the data fed back by the server, the data fed back by the server can be sent to the user terminal so as to respond to the user service request.
In some cases, the server may refuse to provide service due to anomalies or illegitimate user service requests. At this time, the server may feed back data refusing to provide the service. If the proxy gateway receives the data of refusing service fed back by the server, the data fed back by the server can be sent to the user side to respond to the user service request.
In the embodiment of the application, monitoring user flow data received by an input port through a proxy gateway, wherein the user flow data comprises a user service request; the proxy gateway sends the user flow data to a service route matched with the input port; the middleware of the service route configuration monitors the user flow data passing through the service route and sends a matching result of whether the user flow data matches a target middleware rule to the proxy gateway; if the matching result represents that the user flow data is matched with the target middleware rule, the proxy gateway executes matched processing operation on the user service request according to the target middleware rule; and if the matching result indicates that the user flow data does not have the matched middleware rule, the proxy gateway sends the user flow data to a server with matched service route, and responds to a user service request according to the data fed back by the server. According to the scheme, the matched processing operation is executed on the request matched with the preset middleware rule by monitoring the data, so that the request processing flexibility is improved. The middleware rule can be flexibly set according to requirements, the middleware can judge and match the user flow data passing through the service route in a monitoring mode, the middleware hot loading can be supported, the middleware rule can be increased or decreased under the condition that the whole system is not restarted, and negative influence on the user flow data in the receiving and transmitting process is avoided.
An alternative method of configuring service routing and servers is provided below. In practical applications, service routing and server configuration may be performed based on configured input ports. For example, the configuration of service routing and servers includes:
the above section is configured for binding service routes and servers to ingress http. Where routers represent a list of routes bound to http, where the route name is my-router, which contains the rule to configure the host field in the http protocol and has the value gotest. Cn, while the router is bound to the service under the name my-service.
The above services represent definitions of a plurality of services: wherein, the my-service represents the name of a service, which comprises a loadbalance configuration item, a servers configuration item and a real server address, namely the address of the back-end service.
middlewres represents a middleware configuration where black and white listing restrictions of ip, total number of traffic displays, qps restrictions, etc. can be implemented. middleware binds to a service route and traffic passing through the matching service route is computed once by middleware to match whether the target middleware rule is hit. If the data is hit, the data can be refused to return according to the function of the middleware, the flow is transferred to other back-end services, and the operations such as retrying the request or not returning the data are performed.
Based on the solution provided in the foregoing embodiment, optionally, as shown in fig. 2, the method further includes:
s21: the proxy gateway obtains service registration data, wherein the service registration data comprises an identification of a service to be registered.
The service registration data in this step may come from a registrar, and in practical application, a required registrar may be selected according to the requirement. For example, a distributed key value storage system etcd registry, a file registry, an http interface registry or a cloud native registry can be selected. Wherein the service registration data may be from one registrar or a plurality of registrars. The service registration data includes an identifier of the service to be registered, where the identifier is used to distinguish between different services, and may specifically characterize the name of the service.
Based on the solution provided in the foregoing embodiment, optionally, the service registration data includes at least one of: registration data of the etcd registrar, registration data of the file registrar, registration data of the http interface registrar, registration data of the cloud native registrar.
S22: the proxy gateway configures a service route according to the identification of the service to be registered, wherein the service route configured by the service to be registered is configured with middleware and an input port matched based on a protocol type.
For a service to be registered, configuring a service route based on an identification of the service to be registered in the step, wherein the service route is configured with middleware and an input port. Service registration is performed through the identification of the service to be registered, and service routing is configured for the service, and accordingly, the configuration of the input port and the middleware for the service is also realized because the service routing is preconfigured with the middleware and the input port.
By the scheme provided by the embodiment of the application, the service deployed in various forms can be uniformly registered. According to the scheme, the specific deployment form of the service is not required to be distinguished, and the service registration can be realized only by communicating the registered service with the proxy gateway in the scheme, so that the service can be provided based on the user service request.
Optionally, in order to uniformly perform service registration and service management, a format rule of registration may be preset, where the registration rule may be dynamic/http/routers/myrouter/rule Host ("example. Com"), the registration rule indicates that a new route myrouter is generated, and its rule is matching example. Com.
The rule bound to the input port may be dynamic/http/routers/myrutter/entaypoints/0 http, indicating that the route myrutter is bound to the input port http.
The rule for middleware registration may be dynamic/http/routers/myrouter/middlewares/0auth, meaning that auth this middleware is bound to myrouter.
The rule for service registration may be dynamic/http/routers/myrouter/service myservice, indicating that the name of the service is myservice binding to myrouter-a service route.
dynamic/http/services/myservice/loadbalancers/servers/0/url http:// ip: port/bind to myservice.
Registration may also be implemented for different registrars based on different rules, e.g., by monitoring changes in the file by the service registrar as it registers, generating data in registration rule format, and submitting it to the reverse proxy and dynamic gateway component. When registering through the http interface, the dynamic back-end service registry monitors all data of the http interface, generates data in a registration rule format, and submits the data to the reverse proxy and the dynamic gateway component. When the cloud primary registration is performed, the dynamic back-end service registry monitors the change of the ingress resource of kubernetes, generates data in a registration rule format, and submits the data to the reverse proxy and the dynamic gateway component. In practical application, the registration rule can be preset according to practical requirements.
Based on the solution provided in the foregoing embodiment, optionally, as shown in fig. 3, the method further includes:
s31: the proxy gateway generates a log according to the received user service request and the processing result of the user service request, wherein the log comprises at least one of the time of receiving the user service request, the time of finishing processing the user service request, the domain name of the user service request and the identity of the user service request.
In this step, the proxy gateway can record the time when the user service request is received by monitoring the user traffic data, and after the server feeds back the data based on the user service request, the proxy gateway can also record the time when the service is fed back. In addition, various information such as domain name, identity mark and the like of the user service request can be recorded. The information is recorded and stored in a log form, so that data analysis can be conveniently performed or the reasons of the abnormality can be conveniently searched when the abnormality occurs.
Optionally, the proxy gateway may also send the above various information to the log logger for storage, so as to reduce the performance required by the proxy gateway to consume. Specifically, the proxy gateway sends various information such as the time of receiving the user service request, the time of finishing processing the user service request, the domain name of the user service request, the identity of the user service request and the like to the log recorder, and the log recorder generates a log according to a preset format. For example, a record log in json format may be generated and written to storage.
Based on the solution provided in the foregoing embodiment, optionally, as shown in fig. 4, in step S15, if the matching result indicates that the user traffic data does not have a matching middleware rule, the proxy gateway sends the user traffic data to a server with a matched service route, and responds to a user service request according to data fed back by the server, where the step includes:
s41: and the proxy gateway sends the user flow data to a load balancer so as to instruct the load balancer to send the user flow data to a server matched with the service route according to a preset load balancing algorithm.
In this embodiment, the load balancer may be connected between the proxy gateway and the server, for implementing a load balancing function. Specifically, the proxy gateway may send the user traffic data to the load balancer, or may send the user service request and the matched server identification to the load balancer. The matched server identifier refers to an identifier of a server matched with a service route of the user service request, and is used for indicating the load balancer to select a proper service back end so as to execute forwarding of the user service request. And selecting the back-end service contained in the server by the load balancer based on a preset load balancing algorithm, and then sending a user service request to the selected back-end service to wait for the feedback data of the back-end service.
S42: and if the server feedback data sent by the load balancer is received within the preset time, the proxy gateway sends the server feedback data to a user terminal corresponding to the user service request.
S43: and if the server feedback data sent by the load balancer is not received within the preset time, the proxy gateway sends a timeout message to the user terminal corresponding to the user service request.
In general, the backend service executes the service according to the received user service request, if the service is executed successfully, the backend service feeds back data representing the successfully executed service, and if the service is executed failed, the backend service feeds back data representing the unsuccessfully executed service. If the data fed back by the server is received within the preset time, the data can be forwarded to the user side corresponding to the user service request, so that the response of the user service request is realized. If the data fed back by the server is not received within the preset time, transmission interruption, server abnormality, server busy and the like may occur, and at this time, timeout information may be sent to the user end corresponding to the user service request. The user terminal may send again a user service request to request the service again.
Based on the solution provided in the foregoing embodiment, optionally, as shown in fig. 5, before step S11, the method further includes:
s51: the proxy gateway verifies the configuration integrity of the input ports.
This step may be performed by the proxy gateway or by a static configurator communicatively coupled to the proxy gateway in order to reduce the load on the proxy gateway.
The configuration integrity of the input ports may specifically include the configuration of the input ports themselves, such as whether the protocol type of the input port is properly configured. In addition, it may also include whether the input port properly configures the service route and the server. Further, it may also be determined whether the configured service route and server are available, whether there is an anomaly, and the like.
S52: and if the configuration of the input port is complete, the proxy gateway monitors the user flow data received by the input port.
If the above step checks to determine that the configuration of the input port is complete, it indicates that the input port can correctly receive the user traffic data and correctly process the user service request therein. In the case of a complete configuration of the input port, the input port may be enabled and user traffic data received by the input port may be monitored by the server.
Based on the solution provided in the foregoing embodiment, optionally, as shown in fig. 6, before step S11, the method further includes:
s61: the proxy gateway verifies whether the servers for which the service routes match are connected.
In practical application, there may be multiple servers with matched service routes, and in this scheme, services deployed in different modes can normally provide services under the condition that proxy gateways are connected. In order to provide normal service, the communication between the service route and the server is checked in this step.
S62: and if the configuration of the input port is complete and the servers with matched service routes are communicated, the proxy gateway monitors the user flow data received by the input port.
If the service route and the server are communicated normally, the communication between the service route and the server is indicated to be normal, and the server can perform data receiving and transmitting with the service route. In addition, the configuration of the input port is complete, which indicates that the input port can normally receive the user data traffic and normally transmit the user data traffic to the service route. At this time, the whole system is indicated to run normally, and the user request can be processed normally.
By the scheme provided by the embodiment of the application, before processing the user service request, configuration of the input port and connectivity between the server and the service route are checked, so that normal system communication is ensured.
In order to solve the problems in the prior art, an embodiment of the present application provides a system for processing a user service request, as shown in fig. 7, including:
an input port 71 for receiving user traffic data, the user traffic data comprising a user service request;
a proxy gateway 72 communicatively connected to the input port 71, monitors user traffic data received by the input port 71, and sends the user traffic data to a service route 73 matched with the input port 71;
the service route 73 is configured with a middleware 74, monitors user traffic data passing through the service route 73, and sends a matching result of whether the user traffic data matches a target middleware rule to the proxy gateway 72;
if the matching result characterizes the matching of the user traffic data with the target middleware rule, performing, by the proxy gateway 72, a matched processing operation on the user service request according to the target middleware rule;
if the matching result indicates that the user traffic data does not have a matching middleware rule, the proxy gateway 72 sends the user traffic data to a server 74 matched with the service route 73, and responds to a user service request according to the data fed back by the server 75.
According to the system provided by the embodiment of the application, the proxy gateway monitors the user flow data received by the input port, wherein the user flow data comprises a user service request; the proxy gateway sends the user flow data to a service route matched with the input port; the middleware of the service route configuration monitors the user flow data passing through the service route and sends a matching result of whether the user flow data matches a target middleware rule to the proxy gateway; if the matching result represents that the user flow data is matched with the target middleware rule, the proxy gateway executes matched processing operation on the user service request according to the target middleware rule; and if the matching result indicates that the user flow data does not have the matched middleware rule, the proxy gateway sends the user flow data to a server with matched service route, and responds to a user service request according to the data fed back by the server. According to the scheme, the matched processing operation is executed on the request matched with the preset middleware rule by monitoring the data, so that the request processing flexibility is improved. The middleware rule can be flexibly set according to requirements, the middleware can judge and match the user flow data passing through the service route in a monitoring mode, the middleware hot loading can be supported, the middleware rule can be increased or decreased under the condition that the whole system is not restarted, and negative influence on the user flow data in the receiving and transmitting process is avoided.
Based on the solution provided in the foregoing embodiment, optionally, as shown in fig. 8, the system further includes:
a service register 81 communicatively connected to the proxy gateway 72, for obtaining service registration data, where the service registration data includes an identifier of a service to be registered; configuring a service route according to the identification of the service to be registered, wherein the service route is preconfigured with middleware and an input port matched based on a protocol type;
at least one of the following registrars 82, which are communicatively connected to the service registrar 81: etcd registrar, file registrar, http interface registrar, yun Yuansheng registrar, each providing corresponding registration data.
Accordingly, the service registration data includes at least one of: registration data of the etcd registrar, registration data of the file registrar, registration data of the http interface registrar, registration data of the cloud native registrar.
By the scheme provided by the embodiment of the application, the service deployed in various forms can be uniformly registered. According to the scheme, the specific deployment form of the service is not required to be distinguished, and the service registration can be realized only by communicating the registered service with the proxy gateway in the scheme, so that the service can be provided based on the user service request.
Optionally, as shown in fig. 9, a load balancer 91 may be further connected between the proxy gateway and the server, so as to implement service allocation according to a preset load balancing rule. The system provided by the embodiment of the application can further comprise a static configurator, a route configurator, a log recorder, a monitor and the like which are connected with the processing communication.
The static configurator can be used for checking whether the configuration file format is correct, checking whether the configuration of an entry exists, checking whether the configuration of log collection exists, checking whether the format of log collection exists, checking whether the configuration of the collection exists, and checking the intervals of the dynamic back-end service registry for pulling data of various registerers, the service addresses of various registerers and the like, so that the communication of all components is smooth, and the availability of all components is ensured.
The route matcher can be used for judging whether a corresponding service route exists after the proxy gateway receives the user service request, if so, selecting a matched service route, returning to the proxy gateway for further processing, and sending the service bound by the request to the load balancer for service distribution. If no route is available, a corresponding error message is returned.
The log recorder can be used for assisting the proxy gateway to record the starting time of the request, and the like, the back-end service processing is completed when the request is returned, and simultaneously records the domain name, ua, user ip address and other data of the request, and if the static configurator is configured in json format, the data is converted into json format and written into a file.
The monitor may be configured to calculate all requests passing through the input port, record http state codes of the requests respectively, add 1 to the corresponding total number of http states for each request, and add label to the state codes to indicate which route is, where specific records may be as follows:
Httpcode200{router:my-router,service:my-service,entrypoint:http}1001
Httpcode301{router:my-router,service:my-service}1002
by the system provided by the embodiment of the application, various service discovery modes can be supported, and log recording and log configuration can be automatically realized. And moreover, based on the control of the flow supported by the middleware, the deployment service using various environments is supported, and unified flow management and automatic monitoring can be realized. The system provided by the embodiment of the application can rapidly and simply deploy the gateway and the proxy, is compatible with services deployed in various forms, and can conveniently realize the functions of flow control, black-white list and the like.
The method steps provided by the method embodiments may also be implemented by each component in the system provided by the embodiment of the present application. Alternatively, the apparatus provided in the embodiments of the present application may further include other modules besides the foregoing components, so as to implement the method steps provided in the foregoing method embodiments. The device provided by the embodiment of the application can achieve the technical effects achieved by the embodiment of the method.
Preferably, the embodiment of the present invention further provides an electronic device, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor, where the computer program when executed by the processor implements each process of the above embodiment of a method for processing a user service request, and the same technical effects can be achieved, and for avoiding repetition, a description is omitted herein.
The embodiment of the invention also provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor, implements the above-mentioned processes of the method embodiment for processing a user service request, and can achieve the same technical effects, so that repetition is avoided, and no further description is given here. Among them, a computer readable storage medium such as Read-Only Memory (ROM), random access Memory (Random Access Memory RAM), magnetic disk or optical disk, and the like.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises an element.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and changes may be made to the present application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. which are within the spirit and principles of the present application are intended to be included within the scope of the claims of the present application.

Claims (10)

1. A method of processing a user service request, comprising:
the proxy gateway monitors user flow data received by an input port, wherein the user flow data comprises a user service request;
the proxy gateway sends the user flow data to a service route matched with the input port;
the middleware of the service route configuration monitors the user flow data passing through the service route and sends a matching result of whether the user flow data matches a target middleware rule to the proxy gateway;
if the matching result represents that the user flow data is matched with the target middleware rule, the proxy gateway executes matched processing operation on the user service request according to the target middleware rule;
and if the matching result indicates that the user flow data does not have the matched middleware rule, the proxy gateway sends the user flow data to a server with matched service route, and responds to a user service request according to the data fed back by the server.
2. The method of claim 1, wherein the input port matches a protocol type of a user service request, the user service request in the user traffic data comprising at least one of: hypertext transfer http protocol service request, transfer control tcp protocol service request, user datagram udp protocol service request.
3. The method of claim 2, further comprising:
the proxy gateway acquires service registration data, wherein the service registration data comprises an identification of a service to be registered;
the proxy gateway configures a service route according to the identification of the service to be registered, wherein the service route configured by the service to be registered is configured with middleware and an input port matched based on a protocol type.
4. The method of claim 3, wherein the service registration data comprises at least one of: registration data of the etcd registrar, registration data of the file registrar, registration data of the http interface registrar, registration data of the cloud native registrar.
5. The method of any one of claims 1-4, further comprising:
the proxy gateway generates a log according to the received user service request and the processing result of the user service request, wherein the log comprises at least one of the time of receiving the user service request, the time of finishing processing the user service request, the domain name of the user service request and the identity of the user service request.
6. The method according to any one of claims 1-4, wherein if the matching result characterizes that the user traffic data does not have a matching middleware rule, sending, by the proxy gateway, the user traffic data to a server for which the service route matches, and responding to a user service request according to data fed back by the server, comprising:
The proxy gateway sends the user traffic data to a load balancer to instruct the load balancer to send the user traffic data to a server matched with the service route according to a preset load balancing algorithm;
if the server feedback data sent by the load balancer is received within the preset time, the proxy gateway sends the server feedback data to a user terminal corresponding to a user service request;
and if the server feedback data sent by the load balancer is not received within the preset time, the proxy gateway sends a timeout message to the user terminal corresponding to the user service request.
7. The method of any of claims 1-4, further comprising, prior to listening for user traffic data received at the input port:
the proxy gateway checks the configuration integrity of the input port;
and if the configuration of the input port is complete, the proxy gateway monitors the user flow data received by the input port.
8. The method of claim 7, further comprising, before the proxy gateway listens for user traffic data received at an input port:
the proxy gateway checks whether the servers with the matched service routes are communicated;
And if the configuration of the input port is complete and the servers with matched service routes are communicated, the proxy gateway monitors the user flow data received by the input port.
9. A system for processing a user service request, comprising:
an input port for receiving user traffic data, the user traffic data comprising a user service request;
a proxy gateway in communication connection with the input port monitors user flow data received by the input port and sends the user flow data to a service route matched with the input port;
the service route is configured with middleware, monitors user flow data passing through the service route, and sends a matching result of whether the user flow data matches a target middleware rule to the proxy gateway;
if the matching result represents that the user flow data is matched with the target middleware rule, the proxy gateway executes matched processing operation on the user service request according to the target middleware rule;
and if the matching result indicates that the user flow data does not have the matched middleware rule, the proxy gateway sends the user flow data to a server with matched service route, and responds to a user service request according to the data fed back by the server.
10. The system as recited in claim 9, further comprising:
the service register is in communication connection with the proxy gateway and is used for acquiring service registration data, wherein the service registration data comprises an identification of a service to be registered; configuring a service route according to the identification of the service to be registered, wherein the service route is preconfigured with middleware and an input port matched based on a protocol type;
at least one of the following registers in communication with the service registry: etcd registrar, file registrar, http interface registrar, yun Yuansheng registrar, each providing corresponding registration data.
CN202111487461.2A 2021-12-07 2021-12-07 Method and system for processing user service request Active CN114390108B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111487461.2A CN114390108B (en) 2021-12-07 2021-12-07 Method and system for processing user service request

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111487461.2A CN114390108B (en) 2021-12-07 2021-12-07 Method and system for processing user service request

Publications (2)

Publication Number Publication Date
CN114390108A CN114390108A (en) 2022-04-22
CN114390108B true CN114390108B (en) 2024-03-12

Family

ID=81195249

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111487461.2A Active CN114390108B (en) 2021-12-07 2021-12-07 Method and system for processing user service request

Country Status (1)

Country Link
CN (1) CN114390108B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7849502B1 (en) * 2006-04-29 2010-12-07 Ironport Systems, Inc. Apparatus for monitoring network traffic
CN109802919A (en) * 2017-11-16 2019-05-24 中移(杭州)信息技术有限公司 A kind of web page access interception method and device
CN110493352A (en) * 2019-08-30 2019-11-22 南京联创互联网技术有限公司 A kind of unified gateway service system and its method of servicing based on WEB middleware
CN111510478A (en) * 2020-04-07 2020-08-07 支付宝(杭州)信息技术有限公司 Request processing method, device and system and electronic equipment
CN111857974A (en) * 2020-07-30 2020-10-30 江苏方天电力技术有限公司 Service access method and device based on load balancer
CN112995151A (en) * 2021-02-08 2021-06-18 腾讯科技(深圳)有限公司 Access behavior processing method and device, storage medium and electronic equipment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010048989A1 (en) * 2008-10-28 2010-05-06 Telefonaktiebolaget Lm Ericsson (Publ) User and traffic data retention in lawful interception
EP3678348A1 (en) * 2019-01-04 2020-07-08 Ping Identity Corporation Methods and systems for data traffic based adpative security

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7849502B1 (en) * 2006-04-29 2010-12-07 Ironport Systems, Inc. Apparatus for monitoring network traffic
CN109802919A (en) * 2017-11-16 2019-05-24 中移(杭州)信息技术有限公司 A kind of web page access interception method and device
CN110493352A (en) * 2019-08-30 2019-11-22 南京联创互联网技术有限公司 A kind of unified gateway service system and its method of servicing based on WEB middleware
CN111510478A (en) * 2020-04-07 2020-08-07 支付宝(杭州)信息技术有限公司 Request processing method, device and system and electronic equipment
CN111857974A (en) * 2020-07-30 2020-10-30 江苏方天电力技术有限公司 Service access method and device based on load balancer
CN112995151A (en) * 2021-02-08 2021-06-18 腾讯科技(深圳)有限公司 Access behavior processing method and device, storage medium and electronic equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于Esper和Nagios的网络监控系统设计与实现;蔡昭权 等;计算机工程与科学;20120915(第09期);全文 *

Also Published As

Publication number Publication date
CN114390108A (en) 2022-04-22

Similar Documents

Publication Publication Date Title
US9935829B1 (en) Scalable packet processing service
US7257817B2 (en) Virtual network with adaptive dispatcher
US8024469B1 (en) System and method for connecting network sockets between applications
US7899047B2 (en) Virtual network with adaptive dispatcher
JP2021524090A (en) Selectively provide mutual transport layer security using alternate server names
CN107770138B (en) Method for specifying IP address, proxy server and client
US20110282936A1 (en) Device and service management based on layer 2 through layer 7 device attributes
US8386614B2 (en) Network connection manager
US20220174588A1 (en) Method for evaluating the devices of a network infrastructure for deploying a virtualised function
CN114205342B (en) Service debugging routing method, electronic equipment and medium
CN111064804B (en) Network access method and device
US20080244514A1 (en) Scriptable object model for network based services
CN112751897A (en) Load balancing method, device, medium and equipment
CN110113440A (en) A kind of request responding method, device and terminal
US10257254B2 (en) Method and associated server for providing user-friendly operation
CN110661673B (en) Heartbeat detection method and device
CN114390044A (en) File uploading method, system, device and storage medium
CN114390108B (en) Method and system for processing user service request
CN111147285B (en) Cloud security product unified management method
CN110855528B (en) Message processing method and test equipment
CN116126462A (en) Method and device for service deployment in virtual scene and cloud server
CN115378944A (en) Network system, service grid configuration method, storage medium and electronic equipment
US10924575B2 (en) Automatic network management system and methods
CN110943975B (en) Service registration method, device, computer equipment and storage medium
CN108933794B (en) Method, device, equipment and server for joining enterprise policy

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20230316

Address after: Room 501-502, 5/F, Sina Headquarters Scientific Research Building, Block N-1 and N-2, Zhongguancun Software Park, Dongbei Wangxi Road, Haidian District, Beijing, 100193

Applicant after: Sina Technology (China) Co.,Ltd.

Address before: 100080 7th floor, Sina headquarters scientific research building, plot n-1 and n-2, Zhongguancun Software Park Phase II (West Expansion), Dongbeiwang West Road, Haidian District, Beijing

Applicant before: Sina.com Technology (China) Co.,Ltd.

GR01 Patent grant
GR01 Patent grant