CN112988385A - Request processing method, device, system, storage medium and electronic equipment - Google Patents

Request processing method, device, system, storage medium and electronic equipment Download PDF

Info

Publication number
CN112988385A
CN112988385A CN202110297390.3A CN202110297390A CN112988385A CN 112988385 A CN112988385 A CN 112988385A CN 202110297390 A CN202110297390 A CN 202110297390A CN 112988385 A CN112988385 A CN 112988385A
Authority
CN
China
Prior art keywords
server
access request
upgrading
request
target
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.)
Pending
Application number
CN202110297390.3A
Other languages
Chinese (zh)
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.)
Beijing Jingdong Tuoxian Technology Co Ltd
Original Assignee
Beijing Jingdong Tuoxian Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Tuoxian Technology Co Ltd filed Critical Beijing Jingdong Tuoxian Technology Co Ltd
Priority to CN202110297390.3A priority Critical patent/CN112988385A/en
Publication of CN112988385A publication Critical patent/CN112988385A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The disclosure provides a request processing method, a request processing device, a request processing system, a computer readable storage medium and an electronic device, and belongs to the technical field of computers. The method comprises the following steps: receiving an access request sent by a client; searching an upgrading rule of a target application associated with the access request in a pre-configured upgrading rule base; matching the access request with the upgrading rule of the target application to determine a target server of the access request, wherein the target server comprises an upgrading server of an upgrading application of a deployed target application and an upgrading server of an upgrading application of an undeployed target application; and sending the access request to the target server, and processing the access request through the target server. The method and the device can improve the running stability of the micro-service application and simplify the upgrading process of the micro-service application.

Description

Request processing method, device, system, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a request processing method, a request processing apparatus, a request processing system, a computer-readable storage medium, and an electronic device.
Background
With the development of computer technology and the like, the micro-service architecture is widely applied as a service-oriented software development technology due to the advantages of high development efficiency, strong expandability and the like. Each service developed through the microservice architecture has its own processing and lightweight communication mechanism, and can be deployed on a single or multiple servers.
In order to optimize the processing capacity of the service and improve the service use experience, the micro-service application is often required to be upgraded. However, during upgrading, the conventional method needs to stop service for updating, which directly affects the use of the user, so that the access request of the user cannot be processed normally, and the user experience is poor.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present disclosure, and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
The present disclosure provides a request processing method, a request processing apparatus, a request processing system, a computer-readable storage medium and an electronic device, so as to at least improve the problem that an access request cannot be normally processed in the upgrade process of a micro-service application in the prior art to a certain extent.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows, or in part will be obvious from the description, or may be learned by practice of the disclosure.
According to a first aspect of the present disclosure, there is provided a request processing method, the method comprising: receiving an access request sent by a client; searching an upgrading rule of a target application associated with the access request in a pre-configured upgrading rule base; matching the access request with the upgrading rule of the target application, and determining a target server of the access request, wherein the target server comprises an upgrading server of the upgrading application of the deployed target application and an upgrading server of the upgrading application of the undeployed target application; and sending the access request to the target server, and processing the access request through the target server.
In an exemplary embodiment of the disclosure, after receiving an access request sent by a client, the method further includes: and searching any one or more upgrading rules in the upgrading rule base cached by the distributed configuration center for the upgrading rule of the target application associated with the access request.
In an exemplary embodiment of the disclosure, in finding an upgrade rule of a target application associated with the access request, the method further includes: and when the upgrading rule of the target application is not found, determining that the target server of the access request is the unequipped server.
In an exemplary embodiment of the present disclosure, the matching the access request and the upgrade rule of the target application to determine a target server of the access request includes: analyzing the request parameter of the access request, and determining whether the request parameter is matched with the upgrading rule; when the request parameter is determined to be matched with the upgrading rule of the target application, determining that the target server of the access request is the upgrading server; and when the request parameter is determined not to be matched with the upgrading rule of the target application, determining that the target server of the access request is the non-upgraded server.
In an exemplary embodiment of the disclosure, the access request includes an Http request, and after determining that a target server of the access request is the upgrade server, the method further includes: and sending the Http request to the upgrade server according to the domain name of the upgrade server.
In an exemplary embodiment of the disclosure, the API gateway requests that, after determining that the target server of the access request is the upgrade server, the method further includes: and sending the API gateway request to the upgrading server according to the group name of the upgrading server, wherein the group name is the unique identifier of the upgrading server.
In an exemplary embodiment of the disclosure, when the access request is processed by the target server, the method further comprises: when the access request processed by the upgrading server is abnormal, the access request is sent to the server which is not upgraded; processing the access request by the non-upgraded server.
According to a second aspect of the present disclosure, there is provided a request processing apparatus applied to a request processing system, the apparatus including: the receiving module is used for receiving an access request sent by a client; the searching module is used for searching an upgrading rule of the target application associated with the access request in a pre-configured upgrading rule base; the matching module is used for matching the access request with the upgrading rule of the target application and determining a target server of the access request, wherein the target server comprises an upgrading server of the upgrading application of the deployed target application and an upgrading server of the upgrading application of the undeployed target application; and the sending module is used for sending the access request to the target server and processing the access request through the target server.
In an exemplary embodiment of the disclosure, after receiving an access request sent by a client, the apparatus is further configured to search for an upgrade rule of a target application associated with the access request from any one or more upgrade rules in the upgrade rule base cached by the distributed configuration center.
In an exemplary embodiment of the disclosure, when searching for the upgrade rule of the target application associated with the access request, the apparatus is further configured to determine that the target server of the access request is the non-upgraded server when the upgrade rule of the target application is not found.
In an exemplary embodiment of the disclosure, the matching module is configured to parse a request parameter of the access request, determine whether the request parameter matches the upgrade rule, determine that a target server of the access request is the upgrade server when it is determined that the request parameter matches the upgrade rule of the target application, and determine that the target server of the access request is the non-upgrade server when it is determined that the request parameter does not match the upgrade rule of the target application.
In an exemplary embodiment of the disclosure, the access request includes an Http request, and after determining that a target server of the access request is the upgrade server, the sending module is further configured to send the Http request to the upgrade server according to a domain name of the upgrade server.
In an exemplary embodiment of the disclosure, after determining that a target server of the access request is the upgrade server, the sending module is further configured to send the API gateway request to the upgrade server according to a packet name of the upgrade server, where the packet name is a unique identifier of the upgrade server.
In an exemplary embodiment of the disclosure, when the access request is processed by the target server, the sending module is further configured to send the access request to the non-upgraded server when an abnormality occurs in processing the access request by the upgraded server, and process the access request by the non-upgraded server.
According to a third aspect of the present disclosure, there is provided a request processing system, the system comprising: the client is used for generating an access request and sending the access request to the server; a server, the server comprising: the receiving unit is used for receiving the access request sent by the client; the rule management unit is used for storing the upgrade rules in the pre-configured upgrade rule base; the matching unit is used for searching an upgrading rule of a target application associated with the access request in the upgrading rule base and matching the access request with the upgrading rule of the target application to determine a target server of the access request, wherein the target server comprises an upgrading server of the upgrading application of the deployed target application and an upgrading server of the upgrading application of the undeployed target application; and the target server is used for processing the access request.
In an exemplary embodiment of the present disclosure, the rule management unit includes: the configuration management unit is used for storing the upgrading rules in the upgrading rule base; the distributed configuration center is used for caching any one or more upgrading rules when the any one or more upgrading rules in the upgrading rule base are issued, so that the matching unit searches the upgrading rule of the target application associated with the access request according to the any one or more upgrading rules.
In an exemplary embodiment of the present disclosure, the access request includes an Http request, and the matching unit includes: and the interceptor is used for searching an upgrading rule of a target application associated with the Http request in the upgrading rule base and matching the Http request with the upgrading rule to determine a target server of the Http request.
In an exemplary embodiment of the present disclosure, the access request includes an API gateway request, and the matching unit includes: and the filter is used for searching an upgrading rule of a target application associated with the API gateway request in the upgrading rule base and matching the API gateway request with the upgrading rule to determine a target server of the API gateway request.
According to a fourth aspect of the present disclosure, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements any one of the request processing methods described above.
According to a fifth aspect of the present disclosure, there is provided an electronic device comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform any one of the request processing methods described above via execution of the executable instructions.
The present disclosure has the following beneficial effects:
according to the request processing method, the request processing device, the request processing system, the computer readable storage medium and the electronic device in the present exemplary embodiment, when receiving an access request from a client, an upgrade rule of a target application associated with the access request is searched in a pre-configured upgrade rule base, and a target server of the access request is determined by matching the access request with the upgrade rule of the target application, so as to send the access request to the target server to process the access request through the target server, wherein the target server includes an upgrade server of an upgrade application of a deployed target application and an non-upgrade server of an upgrade application of a non-deployed target application. On one hand, the target server of the access request is determined, so that the access request can be sent to the corresponding server, such as an upgraded server or a non-upgraded server, the normal operation of a user during the application upgrading period is not influenced, the possibility of rollback or retesting and online when the application upgrading is online in a problem is avoided, and the running stability of the application is improved; on the other hand, the upgrading rule is configured in advance, so that the application upgrading process can be simplified, an operator can select the application upgrading time by himself, and the efficiency and the flexibility of application upgrading are improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure. It is apparent that the drawings in the following description are only some embodiments of the present disclosure, and that other drawings can be obtained from those drawings without inventive effort for a person skilled in the art.
FIG. 1 illustrates an architecture diagram of a request processing system to which the present exemplary embodiment applies;
FIG. 2 illustrates an interface diagram of a configuration management unit in the exemplary embodiment;
FIG. 3 is a diagram illustrating the issuance of an upgrade rule in the exemplary embodiment;
FIG. 4 illustrates an architecture diagram of another request processing system as applied in the exemplary embodiment;
FIG. 5 illustrates a flow chart of a request processing method in the exemplary embodiment;
FIG. 6 illustrates a sub-flow diagram of a request processing method in the exemplary embodiment;
FIG. 7 shows a flow chart of another request processing method in the exemplary embodiment;
fig. 8 is a block diagram showing a structure of a request processing apparatus in the present exemplary embodiment;
FIG. 9 illustrates a computer-readable storage medium for implementing the above-described method in the present exemplary embodiment;
fig. 10 shows an electronic device for implementing the above method in the present exemplary embodiment.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
Fig. 1 shows a schematic diagram of an exemplary system architecture to which the technical solutions in the exemplary embodiments of the present disclosure may be applied.
As shown in fig. 1, a request processing system 100 may include: client 110 and server 120, wherein server 120 includes: a receiving unit 121, a rule management unit 122, a matching unit 123 and a target server 124. The client 110 is a terminal device used by a user initiating an access request, and may be, for example, a computer, a mobile phone, and the like, the client 110 may connect with the server 120 through the network 130 and send the access request to the server 120, and the server 120 may be configured to receive and process the access request sent by the client. Specifically, in the server 120, the receiving unit 121 may be configured to receive an access request of a client, the rule management unit 122 may be configured to store all upgrade rules in a pre-configured upgrade rule base, the matching unit 123 may be configured to search, in the upgrade rule base, an upgrade rule of a target application associated with the access request, and match the access request and the upgrade rule of the target application to determine a target server of the access request, and the target server 124 is a background server for processing the access request. In this exemplary embodiment, the target server 124 may include an upgrade server of an upgrade application of a deployed target application and an un-upgrade server of an upgrade application of an un-deployed target application, where the target application is a microserver application associated with an access request of a client, and the upgrade application may be more sophisticated software than the target application, for example, an application program that repairs part of bugs in the target application, or an application program that adds new functions.
It should be understood that the number of clients, servers, such as the receiving unit, the rule management unit, the matching unit and the target server in fig. 1 is merely illustrative. There may be any number of clients and servers, according to implementation needs, for example, a target server in a server may be a server cluster composed of a plurality of servers.
In an alternative embodiment, the rule management unit 122 may include a configuration management unit and a distributed configuration center. The configuration management unit is a program environment for providing rule configuration and storage service, and can be used for storing the upgrade rules in the pre-configured upgrade rule base; the distributed configuration center may be a distributed system supporting multiple environments (or multiple groups), and may be configured to, when issuing any one or more upgrade rules in the upgrade rule base, cache any one or more upgrade rules, so that the matching unit searches, according to any one or more upgrade rules, for an upgrade rule of a target application associated with the access request. For example, referring to fig. 2, a user may configure the upgrade rule of each microservice application in the interface of the configuration management unit shown in fig. 2, after the configuration is completed, the upgrading rule issuing function in the configuration management unit interface can be selected to complete the one-key issuing of the upgrading rule, meanwhile, according to the system information and system key of the service system to be upgraded in the upgrading rule, and the domain name of the distributed configuration center and the namespace it creates, etc. generates a URL (Uniform Resource Locator), then, the request parameters are packaged by a put method in an Http Protocol (hypertext Transfer Protocol) to execute a push request, the upgrade rule is pushed to a distributed configuration center, so that the matching unit can directly search the upgrading rule of the target application associated with the access request from the distributed configuration center.
The speed of determining the upgrading rule of the target application can be improved by caching the issued upgrading rule in the distributed configuration center, so that the processing efficiency of the access request is improved; meanwhile, the user can pre-configure the upgrade rule in the configuration management platform and can select a proper time to release the upgrade rule, so that the preparation work and the release work before the application upgrade are independent, and an operator can select any time to perform the application upgrade, thereby improving the flexibility and the convenience of the application upgrade.
Further, as shown in fig. 3, the configuration management unit may include a system management subunit, a rule management subunit, and an upgrade rule issuing subunit according to the content of data stored in the configuration management unit and the functions of the modules. The system management subunit can store system information of one or more service systems in the micro-service application to be upgraded, such as attribute information of a system number, a system name, a system leader, an operator, operation time, a current version number and the like; the rule management subunit can store the upgrade rule, and can specifically set according to the service content and the like of the micro-service application; the upgrade rule issuing subunit may be configured to issue system information and rule information of the service system to be upgraded, for example, the system information may include a task name of an upgrade task issued this time, system information of the service system to be upgraded, and upgrade rule information corresponding to the system information. When the upgrading rule is issued, the upgrading rule issuing subunit can be used for pushing the system information and the rule information of the service system to be upgraded to the distributed configuration center through an Http request.
In an alternative embodiment, the access request of the client may include an Http request, i.e., an access request initiated by an application installed on the client. At this time, the matching unit may include an interceptor, configured to search an upgrade rule of a target application associated with the Http request in an upgrade rule base, and match the Http request with the upgrade rule to determine a target server of the Http request. In this exemplary embodiment, the interceptor may be generated by Struts2 (a Web application framework based on the MVC design pattern), and may perform interception on an object before or after the action is performed.
In an alternative embodiment, the access request of the client may also be an API gateway (API gateway) request, that is, an access request received through a unified portal provided on the system boundary for external access to the internal interface service. At this time, the matching unit may include a filter, configured to search an upgrade rule of a target application associated with the API gateway request in the upgrade rule base, and match the API gateway request and the upgrade rule to determine a target server of the API gateway request.
Fig. 4 is a schematic diagram of another request processing system in the exemplary embodiment, and as shown, the request processing system 100 may include: client 110, server 120, and domain name resolution node 140. The client 110 may be configured to send an access request to the server 120, the domain name resolution node 140 may be configured to send the access request to the server 120 according to information such as a domain name of the access request, and the server 120 may be configured to receive and process the access request. As shown, the server 120 may further include: a virtual IP address node 410, a first gateway node 420, a filter 430, an upgrade server 440, an unequipped server 450, and a reverse proxy server 460, a second gateway node 470, an interceptor 480. The virtual IP address node 410 may send the access request to a corresponding node according to the type of the access request, such as an Http request or an API gateway request; the first gateway node 420 and the second gateway node 470 may be configured to forward the access request to a corresponding matching unit, such as a filter or an interceptor, according to a corresponding request type; filter 430 may be used to determine whether the received API gateway request matches the upgrade rule of the target application and determine the target server of the API gateway request; the reverse proxy server 460 may be a Nginx proxy server (a high-performance Http server/reverse proxy server and email proxy server), and may be configured to forward the access request; interceptor 480 may be configured to determine whether the received Http request matches the upgrade rules of the target application and determine a target server for the Http request.
When the client 120 sends an access request to the server 120, the domain name resolution node 410 may determine a target address of the access request by resolving the access request, and transmit the access request to the server 120 through a network or the like. The virtual IP address node 410 may send an API gateway request to the first gateway node 430 and an Http request to the reverse proxy server 460 according to the type of the access request, and perform the following processes:
after the first gateway node 420 receives the API gateway request, the API gateway request may be sent to the filter 430, so that the filter 430 determines whether the API gateway request matches the upgrade rule of the target application, and when determining that the API gateway request matches the upgrade rule of the target application, sends the API gateway request to the upgrade server 440 for processing, and when determining that the API gateway request does not match the upgrade rule of the target application, sends the API gateway request to the non-upgrade server 450 for processing.
After the reverse proxy server 460 receives the Http request, the server with the current lower load may be determined according to the load conditions of the upgraded server and the non-upgraded server, and the Http request is sent to the second gateway node 470 corresponding to the server with the lower load. The second gateway node 470 may send the received Http request to the interceptor 480, so that the interceptor 480 determines whether the Http request matches the upgrade rule of the target application, and when determining that the Http request matches the upgrade rule of the target application, sends the Http request to the upgrade server 440 for processing, and when determining that the Http request does not match the upgrade rule of the target application, sends the Http request to the non-upgrade server 450 for processing.
By the request processing system, when the receiving unit receives the access request, the matching unit can determine the target servers of the access request, such as the upgraded server and the non-upgraded server, so that the target servers process the access request, flexible deployment of application upgrade is realized, and normal use of the application can be maintained in the application upgrade process.
With the increasing number of service scenarios, sometimes it is necessary to upgrade the same microservice application according to different rules, for example, according to the region where the accessing user is located, the application upgrade is performed on the user in a certain specific region first, and then the full upgrade is performed on other users, that is, the microservice application facing all users is upgraded. In the traditional method, the upgrading rule can be configured in the original business logic code for application upgrading, under the mode, the application upgrading still faces the difficulty of service stopping, the normal use of a user is influenced, and because the content of the original code logic is changed, the correctness of the whole code logic needs to be tested every time the code is modified in the testing process, the upgrading efficiency is low, and the maintenance cost is high.
In view of one or more of the foregoing problems, exemplary embodiments of the present disclosure also provide a request processing method applied to a request processing system. Fig. 5 shows a flow of the request processing method, which may include the following steps S510 to S540:
step S510, receiving an access request sent by the client.
The access request may be a request sent by a user through a client to obtain certain service content, and the access request may include multiple types according to the service content, for example, the access request may be a request for the user to access a certain resource, or may be a request for a specific service application performed by the user using an application program, such as a request for issuing and using a network resource.
When a user initiates an access request through a client, a server can receive the access request, analyze the access request, obtain message data in the access request, and determine information of the client initiating the request and resource information requested to be accessed by the client according to the message data.
Step S520, searching for an upgrade rule of the target application associated with the access request in a pre-configured upgrade rule base.
The upgrade rule base may be a rule database, and may be configured to store the upgrade rule for each microservice application, which is configured in advance by an operator. For each microservice application, it may include multiple business systems, each of which may be used to perform a particular task, e.g., a query business system, a business handling system, a customer service system, etc. may be included in a microservice application. At this time, the upgrade rule of each micro service application may also include an upgrade rule of one or more business systems. The target application may be a microservice application to which the client requests access.
By searching a target application associated with the access request and an upgrading rule of the target application in a pre-configured upgrading rule base, whether the version of the target application is updated or not can be predetermined; meanwhile, compared with the method for upgrading the application by modifying the service logic code in the prior art, the method can simplify the process of upgrading the application by configuring the upgrading rule, avoid the possibility of rollback or retesting and online when the online upgrading of the application has problems, and improve the efficiency of upgrading the application. In addition, all the upgrading rules of the micro-service application are uniformly stored in the upgrading rule base, so that the uniform management and maintenance of all the upgrading rules can be realized, and the application upgrading efficiency is further improved.
In an optional implementation manner, after receiving the access request of the client, the upgrade rule of the target application associated with the access request may be searched from any one or more upgrade rules in the upgrade rule base cached by the distributed configuration center. By obtaining the upgrade rule of the target application from the distributed configuration center, the efficiency of obtaining the upgrade rule can be improved.
Step S530, the access request is matched with the upgrading rule of the target application, and the target server of the access request is determined.
The target servers may include an upgrade server that has deployed an upgrade application of the target application and an unemplified server that has not deployed an upgrade application of the target application. The upgrading server and the non-upgrading server belong to the components of the micro-service application server and can be used for processing the access request of the client, and the difference is that the upgrading server can process the access request through the upgrading application, and the non-upgrading server can only process the access request through the target application, namely the non-upgrading application.
After the upgrade rule of the target application is obtained, the access request and the upgrade rule of the target application can be matched, whether the access request and the upgrade rule of the target application are matched or not is judged, and the target server of the access request is determined according to the judgment result. For example, whether the address matches the address information in the upgrade rule may be determined according to a request address of the access request, and when determining that the address matches the address information, it is determined that a target server of the access request is an upgraded server, otherwise, it is determined that the target server of the access request is an unequified server. It should be noted that, according to the service requirement, the upgrade of the target application may include a plurality of upgrade policies, for example, a local upgrade may be performed for users in a region, or an upgrade may be performed for a specific resource type. Therefore, whether the access request is matched with the upgrade rule of the target application may also be implemented according to whether the address of the access request is matched with the address of the upgrade rule, or according to whether the content of the resource requested to be accessed by the access request is matched with the content of the resource in the upgrade rule, which is not particularly limited in this exemplary embodiment.
In an alternative embodiment, referring to fig. 6, step S530 can be implemented by the following steps S610 to S630:
step S610, parsing the request parameter of the access request, and determining whether the request parameter matches the upgrade rule. The request parameter may be key information for determining the target server in the access request, and may be different parameter information according to the specific content of the upgrade rule, for example, in the upgrade rule configured according to the region, the request parameter may be address information of the access request.
By analyzing the request parameters of the access request, the request parameters related to the upgrade rule in the access request can be extracted and matched with the upgrade rule to obtain a matching result.
Step S620, when the request parameter is determined to be matched with the upgrading rule of the target application, the target server of the access request is determined to be an upgrading server.
When the request parameter of the access request is matched with the upgrading rule of the target application, the access request is proved to be in accordance with the configuration requirement of the upgrading rule, and the access request can be processed by adopting the upgraded micro-service application, so that the target server of the access request can be determined to be the upgrading server.
Step S630, when it is determined that the request parameter does not match the upgrade rule of the target application, determining that the target server of the access request is an un-upgraded server.
When the request parameter of the access request is not matched with the upgrading rule of the target application, the access request is not in accordance with the configuration requirement of the upgrading rule, and only the micro-service application before upgrading is allowed to be adopted to process the access request, so that the target server of the access request can be determined to be an unequified server.
Through the steps of S610 to S630, whether the target server of the access request is the upgrade server or the non-upgrade server can be determined according to the access request and the upgrade rule, which not only meets the upgrade requirement of the application, but also meets the normal access of the user, and improves the operation stability of the application.
According to the way of sending the access request by the client, the access request may include any one of an Http request and an API gateway request, and for different types of access requests, the way of determining the target server of the access request may also be different. For example, for the Http request, that is, an access request initiated by an application program installed on a client, an upgrade rule of a target application may be read through a distributed configuration center, and parameter information related to the upgrade rule in each service system of the target application is obtained and matched with a request parameter in the Http request, so as to determine a target server of the Http request; for another example, for the API gateway request, that is, the access request received through the unified entry provided on the system boundary for external access to the internal interface service, the request service may be invoked through the remote procedure service, the upgrade rule of the target application and the parameter information related to the upgrade rule in each service system of the target application are read from the distributed configuration center, and the upgrade rule is matched with the request parameter in the API gateway request, so as to determine the target server of the API gateway request.
Further, in an optional implementation manner, after determining that the target server of the Http request is the upgrade server, the Http request may be sent to the upgrade server according to the domain name of the upgrade server. Specifically, the header information of the Http request may be transmitted, an IP Address (Internet Protocol Address) of the Http request may be determined in a routing manner, and the Http request may be sent to the upgrade server.
In an optional implementation manner, after determining that the target server of the API gateway request is the upgrade server, the API gateway request may be sent to the upgrade server according to the packet name of the upgrade server. The group name may be a unique identifier of the upgrade server, and may be composed of numbers, characters, and the like. For example, the API gateway request may be sent to the upgrade server using a generalized calling technique of a particular remote procedure call protocol. Specifically, the generalized invocation technique of the remote procedure call protocol may include the following procedures:
(1) instantiating the generalized service, creating a user configuration object, setting the attributes of the user configuration object, including class name, registration configuration information, protocol type, and group name of an upgrade server of the remote procedure call service, and designating the generalized call identifier as a future, and then invoking the user configuration object to complete the service instantiation. The packet name of the upgrade server and the specific type of the remote procedure call service request may form a unique identifier indicating a specific remote procedure call service, and the unique identifier may be stored in a hash structure.
(2) And acquiring the name, the type and the parameter value of the requested method from the message object of the remote procedure call service request, and transmitting the parameter information to the instantiated generalized service to obtain the initial result value of the service response.
(3) According to the name of the class object in the user configuration object, loading the class object in the user configuration object by using a class.
In an optional implementation manner, when the upgrade rule of the target application associated with the access request is searched, if the upgrade rule of the target application is not found, it is indicated that the target application is not upgraded currently, and therefore, it may be determined that the target server of the access request is an unequipped server.
By determining the target server of the access request, whether the processing server suitable for the access request is an upgrade server or a non-upgrade server can be distinguished, and it is ensured that a user can normally access the target application when the application is upgraded.
Step S540, the access request is sent to the target server group, so as to be processed by the target server group.
In the exemplary embodiment, the target server may include an upgraded server and an uneupgraded server, and therefore, the access request may be processed by the upgraded server or the uneupgraded server, that is, even in the application upgrade process, the access request of the client may be normally received and processed, and the stability of the system may be improved.
In order to improve the access success rate of the client, in an optional implementation, when the access request is processed by the target server, the following method may be further performed:
and when the access request processed by the upgrading server is abnormal, sending the access request to the server which is not upgraded, and processing the access request by the server which is not upgraded. Thus, even when the access request cannot be normally processed due to a problem with the upgrade application, the access request can be processed by the non-upgraded server. By the method, when the upgrading application is on line and has a problem, the access request can be timely switched to the application which is not upgraded for processing, and the normal access of the user in the application upgrading process is ensured.
Fig. 7 shows a flow of another request processing method in the present exemplary embodiment, and as shown, may include the following steps S701 to S711:
step S701, in the process that the server runs the target application, an access request sent by the client is received. Wherein the target application represents the application program before upgrading.
The server side runs the target application by calling a package file of the target application, such as War package (a file packaged by a JavaScript program), and running the target application.
Step S702, the server side obtains the upgrade rule in the upgrade rule base cached by the distributed configuration center, and finds out the upgrade rule of the target application associated with the access request.
Step S703, the server determines the type of the access request according to the received access request. For example, the server may determine the source of the access request according to the sending address of the access request, and the like, so as to determine the type of the access request.
In step S704, the server determines that the access request is an Http request.
Step S705, the server determines that the access request is an API gateway request.
Step S706, the server determines whether the Http request matches the upgrade rule of the target application, if so, step S708 is executed, and if not, the access request is sent to the target application, that is, the application program before upgrade is processed.
Step S707, the server determines whether the API gateway request matches the upgrade rule of the target application, if so, step S709 is executed, and if not, the access request is sent to the target application, that is, the application program before upgrade is processed.
Specifically, in step S706 and step S707, the server determines whether the access request matches the upgrade rule of the target application by parsing a request parameter, such as an address, a port number, etc., in the access request and matching the request parameter with the upgrade rule of the target application to determine whether the access request matches the upgrade rule of the target application.
In step S708, the server determines that the target server of the Http request is an upgrade server, and performs step S710 to process the Http request through the upgrade server.
In step S709, the server determines that the target server of the API gateway request is an upgrade server, and executes step S711 to process the API gateway request through the upgrade server.
Step S710, the Http request is processed by the upgrade server.
Step S711, the API gateway request is processed by the upgrade server.
After the processing is completed, the upgrade server may send an access request, such as the processing result of the Http request or the API gateway request, to the client, so that the client displays a corresponding page or executes a corresponding operation according to the processing result.
In summary, according to the request processing method in the exemplary embodiment, when receiving an access request from a client, an upgrade rule of a target application associated with the access request is searched in a preconfigured upgrade rule base, and a target server of the access request is determined by matching the access request with the upgrade rule of the target application, so that the access request is sent to the target server to process the access request through the target server, where the target server includes an upgrade server of an upgrade application in which the target application is deployed and an un-upgrade server of an upgrade application in which the target application is not deployed. On one hand, the target server of the access request is determined, so that the access request can be sent to the corresponding server, such as an upgraded server or a non-upgraded server, the normal operation of a user during the application upgrading period is not influenced, the possibility of rollback or retesting and online when the application upgrading is online in a problem is avoided, and the running stability of the application is improved; on the other hand, the upgrading rule is configured in advance, so that the application upgrading process can be simplified, an operator can select the application upgrading time by himself, and the efficiency and the flexibility of application upgrading are improved.
The present exemplary embodiment also provides a request processing apparatus, which may be applied to a request processing system, and as shown in fig. 8, the request processing apparatus 800 may include: a receiving module 810, which may be configured to receive an access request sent by a client; a searching module 820, configured to search, in a preconfigured upgrade rule base, an upgrade rule of a target application associated with the access request; the matching module 830 may be configured to match the access request with an upgrade rule of the target application, and determine a target server of the access request, where the target server includes an upgrade server of an upgrade application in which the target application is deployed and an unequipped server of an upgrade application in which the target application is not deployed; the sending module 840 may be configured to send the access request to the target server, and process the access request through the target server.
In an exemplary embodiment of the disclosure, after receiving the access request sent by the client, the request processing apparatus 800 may further be configured to search for the upgrade rule of the target application associated with the access request from any one or more upgrade rules in the upgrade rule base cached by the distributed configuration center.
In an exemplary embodiment of the present disclosure, when searching for the upgrade rule of the target application associated with the access request, the request processing apparatus 800 may further be configured to determine that the target server of the access request is an un-upgraded server when the upgrade rule of the target application is not found.
In an exemplary embodiment of the disclosure, the matching module 830 may be configured to parse the request parameter of the access request and determine whether the request parameter matches the upgrade rule, determine that the target server of the access request is an upgraded server when it is determined that the request parameter matches the upgrade rule of the target application, and determine that the target server of the access request is an unequipped server when it is determined that the request parameter does not match the upgrade rule of the target application.
In an exemplary embodiment of the disclosure, the access request includes an Http request, and after determining that a target server of the access request is an upgrade server, the sending module 840 may further be configured to send the Http request to the upgrade server according to a domain name of the upgrade server.
In an exemplary embodiment of the disclosure, after determining that a target server of the access request is an upgrade server, the sending module 840 may further be configured to send the API gateway request to the upgrade server according to a packet name of the upgrade server, where the packet name is a unique identifier of the upgrade server.
In an exemplary embodiment of the disclosure, when the access request is processed by the target server, the sending module 840 may further be configured to send the access request to the non-upgraded server when an exception occurs in the processing of the access request by the upgraded server, and process the access request by the non-upgraded server.
The specific details of each module in the above apparatus have been described in detail in the method section, and details of an undisclosed scheme may refer to the method section, and thus are not described again.
As will be appreciated by one skilled in the art, aspects of the present disclosure may be embodied as a system, method or program product. Accordingly, various aspects of the present disclosure may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
Exemplary embodiments of the present disclosure also provide a computer-readable storage medium having stored thereon a program product capable of implementing the above-described method of the present specification. In some possible embodiments, various aspects of the disclosure may also be implemented in the form of a program product comprising program code for causing a terminal device to perform the steps according to various exemplary embodiments of the disclosure described in the above-mentioned "exemplary methods" section of this specification, when the program product is run on the terminal device.
Referring to fig. 9, a program product 900 for implementing the above method according to an exemplary embodiment of the present disclosure is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
Program product 900 may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
The exemplary embodiment of the present disclosure also provides an electronic device capable of implementing the above method. An electronic device 1000 according to such an exemplary embodiment of the present disclosure is described below with reference to fig. 10. The electronic device 1000 shown in fig. 10 is only an example and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 10, the electronic device 1000 may be embodied in the form of a general purpose computing device. The components of the electronic device 1000 may include, but are not limited to: the at least one processing unit 1010, the at least one memory unit 1020, a bus 1030 connecting different system components (including the memory unit 1020 and the processing unit 1010), and a display unit 1040.
Wherein the storage unit 1020 stores program code that may be executed by the processing unit 1010 such that the processing unit 1010 performs the steps according to various exemplary embodiments of the present disclosure described in the above-mentioned "exemplary methods" section of this specification. For example, the processing unit 1010 may perform the method steps shown in fig. 5-7, and so on.
The memory unit 1020 may include readable media in the form of volatile memory units, such as a random access memory unit (RAM)1021 and/or a cache memory unit 1022, and may further include a read-only memory unit (ROM) 1023.
Storage unit 1020 may also include a program/utility 1024 having a set (at least one) of program modules 1025, such program modules 1025 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 1030 may be any one or more of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, and a local bus using any of a variety of bus architectures.
The electronic device 1000 may also communicate with one or more external devices 1100 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 1000, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 1000 to communicate with one or more other computing devices. Such communication may occur through input/output (I/O) interfaces 1050. Also, the electronic device 1000 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the internet) via the network adapter 1060. As shown, the network adapter 1060 communicates with the other modules of the electronic device 1000 over the bus 1030. It should be appreciated that although not shown, other hardware and/or software modules may be used in conjunction with the electronic device 1000, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functions of two or more modules or units described above may be embodied in one module or unit, according to exemplary embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Furthermore, the above-described figures are merely schematic illustrations of processes included in methods according to exemplary embodiments of the present disclosure, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the exemplary embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to make a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) execute the method according to the exemplary embodiments of the present disclosure.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

Claims (14)

1. A request processing method is applied to a request processing system, and the method comprises the following steps:
receiving an access request sent by a client;
searching an upgrading rule of a target application associated with the access request in a pre-configured upgrading rule base;
matching the access request with the upgrading rule of the target application, and determining a target server of the access request, wherein the target server comprises an upgrading server of the upgrading application of the deployed target application and an upgrading server of the upgrading application of the undeployed target application;
and sending the access request to the target server, and processing the access request through the target server.
2. The method of claim 1, wherein after receiving the access request sent by the client, the method further comprises:
and searching any one or more upgrading rules in the upgrading rule base cached by the distributed configuration center for the upgrading rule of the target application associated with the access request.
3. The method of claim 1, wherein in finding an upgrade rule for a target application associated with the access request, the method further comprises:
and when the upgrading rule of the target application is not found, determining that the target server of the access request is the unequipped server.
4. The method of claim 1, wherein matching the access request with the upgrade rule of the target application to determine the target server of the access request comprises:
analyzing the request parameter of the access request, and determining whether the request parameter is matched with the upgrading rule;
when the request parameter is determined to be matched with the upgrading rule of the target application, determining that the target server of the access request is the upgrading server; and
and when the request parameter is determined not to be matched with the upgrading rule of the target application, determining that the target server of the access request is the non-upgraded server.
5. The method of claim 4, wherein the access request comprises an Http request, and wherein after determining that the target server of the access request is the upgrade server, the method further comprises:
and sending the Http request to the upgrade server according to the domain name of the upgrade server.
6. The method of claim 4, wherein the API gateway requests that, after determining that the target server of the access request is the upgrade server, the method further comprises:
and sending the API gateway request to the upgrading server according to the group name of the upgrading server, wherein the group name is the unique identifier of the upgrading server.
7. The method of claim 1, wherein in processing the access request by the target server, the method further comprises:
when the access request processed by the upgrading server is abnormal, the access request is sent to the server which is not upgraded;
processing the access request by the non-upgraded server.
8. A request processing apparatus, applied to a request processing system, the apparatus comprising:
the receiving module is used for receiving an access request sent by a client;
the searching module is used for searching an upgrading rule of the target application associated with the access request in a pre-configured upgrading rule base;
the matching module is used for matching the access request with the upgrading rule of the target application and determining a target server of the access request, wherein the target server comprises an upgrading server of the upgrading application of the deployed target application and an upgrading server of the upgrading application of the undeployed target application;
and the sending module is used for sending the access request to the target server and processing the access request through the target server.
9. A request processing system, the system comprising:
the client is used for generating an access request and sending the access request to the server;
a server, the server comprising:
the receiving unit is used for receiving the access request sent by the client;
the rule management unit is used for storing the upgrade rules in the pre-configured upgrade rule base;
the matching unit is used for searching an upgrading rule of a target application associated with the access request in the upgrading rule base and matching the access request with the upgrading rule of the target application to determine a target server of the access request, wherein the target server comprises an upgrading server of the upgrading application of the deployed target application and an upgrading server of the upgrading application of the undeployed target application;
and the target server is used for processing the access request.
10. The system of claim 9, wherein the rule management unit comprises:
the configuration management unit is used for storing the upgrading rules in the upgrading rule base;
the distributed configuration center is used for caching any one or more upgrading rules when the any one or more upgrading rules in the upgrading rule base are issued, so that the matching unit searches the upgrading rule of the target application associated with the access request according to the any one or more upgrading rules.
11. The system of claim 9, wherein the access request comprises an Http request, and wherein the matching unit comprises:
and the interceptor is used for searching an upgrading rule of a target application associated with the Http request in the upgrading rule base and matching the Http request with the upgrading rule to determine a target server of the Http request.
12. The system of claim 9, wherein the access request comprises an API gateway request, and wherein the matching unit comprises:
and the filter is used for searching an upgrading rule of a target application associated with the API gateway request in the upgrading rule base and matching the API gateway request with the upgrading rule to determine a target server of the API gateway request.
13. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method of any one of claims 1 to 7.
14. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the method of any of claims 1-7 via execution of the executable instructions.
CN202110297390.3A 2021-03-19 2021-03-19 Request processing method, device, system, storage medium and electronic equipment Pending CN112988385A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110297390.3A CN112988385A (en) 2021-03-19 2021-03-19 Request processing method, device, system, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110297390.3A CN112988385A (en) 2021-03-19 2021-03-19 Request processing method, device, system, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN112988385A true CN112988385A (en) 2021-06-18

Family

ID=76334159

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110297390.3A Pending CN112988385A (en) 2021-03-19 2021-03-19 Request processing method, device, system, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN112988385A (en)

Similar Documents

Publication Publication Date Title
US10412176B2 (en) Website access method, apparatus, and website system
JP5288334B2 (en) Virtual appliance deployment system
CN110086895A (en) Domain name analytic method, device, medium and electronic equipment
EP3103023B1 (en) Private cloud connected device cluster architecture
US20210224091A1 (en) Sharable link for remote computing resource access
US10623262B2 (en) Methods and systems to adjust a monitoring tool and auxiliary servers of a distributed computing system
US10574724B2 (en) Automatic discovery of management nodes and generation of CLI using HA module
CN111708702A (en) Simulation test method, client, server, system and readable storage medium
CN110858172A (en) Automatic test code generation method and device
CN111258627A (en) Interface document generation method and device
CN111427701A (en) Workflow engine system and business processing method
US11637914B2 (en) Multiple geography service routing
CN114553960A (en) Data caching method, device, equipment and storage medium
CN114285659B (en) Reverse proxy method, device, equipment and storage medium
CN114489622A (en) Js application, electronic device, and storage medium
CN112491940B (en) Request forwarding method and device of proxy server, storage medium and electronic equipment
CN109347936A (en) Implementation method, system, storage medium and the electronic equipment of Redis agent client
CN112394907A (en) Container-based delivery system construction method, application delivery method and delivery system
US20230088115A1 (en) Generating early hints informational responses at an intermediary server
CN112948733B (en) Interface maintenance method, device, computing equipment and medium
CN112988385A (en) Request processing method, device, system, storage medium and electronic equipment
CN115480877A (en) External exposure method and device of application service in multi-cluster environment
CN114584545A (en) Data management method, device, system, storage medium and electronic equipment
CN114579167A (en) Method, device and storage medium for downloading application upgrade file
CN115220640A (en) Method, electronic device and computer program product for processing data

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