CN113760533A - Service processing method and device - Google Patents

Service processing method and device Download PDF

Info

Publication number
CN113760533A
CN113760533A CN202110167441.0A CN202110167441A CN113760533A CN 113760533 A CN113760533 A CN 113760533A CN 202110167441 A CN202110167441 A CN 202110167441A CN 113760533 A CN113760533 A CN 113760533A
Authority
CN
China
Prior art keywords
server
service access
access request
service
response
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
CN202110167441.0A
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 Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information 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 Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202110167441.0A priority Critical patent/CN113760533A/en
Publication of CN113760533A publication Critical patent/CN113760533A/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
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/505Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/368Test management for test version control, e.g. updating test cases to a new software version
    • 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
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5055Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering software capabilities, i.e. software resources associated or available to the machine

Abstract

The invention discloses a service processing method and a service processing device, and relates to the technical field of computers. One embodiment of the method comprises: responding to a service access request initiated by a user side, and forwarding the service access request to a first server; acquiring a response state of the first server, and judging whether the response state is normal or not; if so, sending a response result corresponding to the response state to the user side; if not, forwarding the service access request to a second server according to the proxy transfer configuration, and sending a response result returned by the second server to the user side; the proxy transfer configuration is used for changing the access address information indicated by the service access request into the address information corresponding to the second server. The implementation method improves the service processing efficiency, reduces the operation risk of the service process and improves the user experience.

Description

Service processing method and device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for processing a service.
Background
The system faults in the service processing process are mainly divided into two categories, one is a high concurrency scene, because the access volume is suddenly increased and exceeds the bearing capacity of a server, the system faults are often caused, and aiming at the situation, the existing method mainly controls the suddenly increased high concurrency request in a server capacity expansion or current limiting mode; the other is a system bug which is mainly caused by a bug caused by system logic error, and for the situation, the existing method is mainly used for repairing the bug and then bringing the bug online again.
The prior art has at least the following problems:
the existing business processing method has the technical problems of low business processing efficiency, higher risk of business operation process and poor user experience.
Disclosure of Invention
In view of this, embodiments of the present invention provide a service processing method and apparatus, which can improve service processing efficiency, reduce risk of service process operation, and improve user experience.
In order to achieve the above object, according to a first aspect of the embodiments of the present invention, there is provided a service processing method, including:
responding to a service access request initiated by a user side, and forwarding the service access request to a first server;
acquiring a response state of the first server, and judging whether the response state is normal or not;
if so, sending a response result corresponding to the response state to the user side;
if not, forwarding the service access request to a second server according to the proxy transfer configuration, and sending a response result returned by the second server to the user side; the proxy transfer configuration is used for changing the access address information indicated by the service access request into the address information corresponding to the second server.
Further, after the step of forwarding the service access request to the second server according to the proxy transfer configuration, the method further comprises:
acquiring a response state of the second server, and judging whether the response state is normal or not;
if so, sending a response result corresponding to the response state to the user side;
if not, the service access request is forwarded to the third server, and a response result returned by the third server is sent to the user side.
Further, prior to the step of forwarding the service access request to the first server, the method further comprises:
judging whether to start proxy automatic transfer or not according to the service requirement;
if so, acquiring the current service access condition and the server load condition, determining a target server according to the current service access condition and the server load condition, and forwarding a service access request to the target server;
and if not, forwarding the service access request to the first server.
Further, if the service access request is a test request; the steps of determining a target server according to the current service access condition and the server load condition and forwarding the service access request to the target server further comprise:
determining a test version corresponding to the service access request;
and determining a target server according to the current service access condition, the server load condition and the test version, and forwarding the service access request to the target server.
Further, the method further comprises:
and acquiring version management information, and updating the target server corresponding to the test version according to the version management information.
Further, the case where the response status is abnormal includes at least one of: the target response code is included in the no response, the response data error, and/or the response data.
According to a second aspect of the embodiments of the present invention, there is provided a service processing apparatus, including:
the response module is used for responding to a service access request initiated by the user side and forwarding the service access request to the first server;
the judging module is used for acquiring the response state of the first server and judging whether the response state is normal or not;
the service processing module is used for sending a response result corresponding to the response state to the user side if the response state is normal;
if the response state is abnormal, the response module is used for forwarding the service access request to the second server according to the proxy transfer configuration and sending a response result returned by the second server to the user side; the proxy transfer configuration is used for changing the access address information indicated by the service access request into the address information corresponding to the second server.
Further, the apparatus further comprises an automatic transfer module, prior to the step of forwarding the service access request to the first server, for:
judging whether to start proxy automatic transfer or not according to the service requirement;
if so, acquiring the current service access condition and the server load condition, determining a target server according to the current service access condition and the server load condition, and forwarding a service access request to the target server;
and if not, forwarding the service access request to the first server.
According to a third aspect of embodiments of the present invention, there is provided an electronic apparatus, including:
one or more processors;
a storage device for storing one or more programs,
when executed by one or more processors, cause the one or more processors to implement any of the business processing methods described above.
According to a fourth aspect of embodiments of the present invention, there is provided a computer-readable medium, on which a computer program is stored, which when executed by a processor, implements any of the service processing methods described above.
One embodiment of the above invention has the following advantages or benefits: the service access request is forwarded to the first server in response to the service access request initiated by the user side; acquiring a response state of the first server, and judging whether the response state is normal or not; if so, sending a response result corresponding to the response state to the user side; if not, forwarding the service access request to a second server according to the proxy transfer configuration, and sending a response result returned by the second server to the user side; the agent transfer is configured with a technical means for changing the access address information indicated by the service access request into the address information corresponding to the second server, so that the technical problems of low service processing efficiency, high risk of service operation process and poor user experience in the existing service processing method are solved, and the technical effects of improving the service processing efficiency, reducing the risk of service operation process and improving the user experience are achieved.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
fig. 1 is a schematic diagram of a main flow of a service processing method provided according to a first embodiment of the present invention;
fig. 2a is a schematic diagram of a main flow of a service processing method according to a second embodiment of the present invention;
FIG. 2b is a schematic main flow chart of a business processing system corresponding to the method shown in FIG. 2 a;
fig. 3 is a schematic diagram of main modules of a service processing apparatus provided according to an embodiment of the present invention;
FIG. 4 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 5 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram of a main flow of a service processing method provided according to a first embodiment of the present invention; as shown in fig. 1, the service processing method provided in the embodiment of the present invention mainly includes:
step S101, responding to a service access request initiated by a user side, and forwarding the service access request to a first server.
Specifically, the service access request may be an http request, or a request for accessing the candidate server. In an application scenario of the embodiment of the present invention, under a condition of a system failure occurring in a service processing process, a service access request is forwarded to a standby server for corresponding service processing based on proxy transfer configuration, so as to improve user experience.
The first server, i.e., the service server, is a server that mainly performs corresponding service processing for the service access request.
Further, according to an embodiment of the present invention, before the step of forwarding the service access request to the first server, the method further includes:
judging whether to start proxy automatic transfer or not according to the service requirement;
if so, acquiring the current service access condition and the server load condition, determining a target server according to the current service access condition and the server load condition, and forwarding a service access request to the target server;
and if not, forwarding the service access request to the first server.
Specifically, in order to cope with the situation that the corresponding service processing can be continuously completed even if a system fault occurs in the service processing process, the embodiment of the present invention mainly adopts two ways. The first method is that a service access request is directly forwarded to a first server, and then whether proxy transfer is performed or not is determined according to whether an abnormality occurs in the response state of the first server or not; and secondly, after receiving a service access request, determining whether to start proxy automatic transfer according to service requirements, if so, identifying the service access request according to the started proxy automatic transfer, monitoring the load capacity of the server, and further determining a target server for the current service access request so as to avoid system faults in advance, so that the service processing efficiency is higher, and the user experience is further improved.
Preferably, according to the embodiment of the present invention, if the service access request is a test request; the step of determining the target server according to the current service access status and the server load status, and forwarding the service access request to the target server further includes:
determining a test version corresponding to the service access request;
and determining a target server according to the current service access condition, the server load condition and the test version, and forwarding the service access request to the target server.
For a service access request for testing an application version, the embodiment of the present invention may also determine a target server in combination with a test version corresponding to the service access request while considering a current service access status and a server load status, where it should be noted that the target server may be a first server (a service server) or a second server (a candidate server).
Further, the method further comprises:
and acquiring version management information, and updating the target server corresponding to the test version according to the version management information.
Through the setting, the test server corresponding to the test version can be updated according to the test condition of the application version, the application scene corresponding to the service processing is expanded through the setting, the A/B test of the interface level can be realized, and the fineness and the test efficiency of the gray level test are improved.
Step S102, acquiring the response state of the first server, and judging whether the response state is normal.
Specifically, according to an embodiment of the present invention, the case where the response state is abnormal includes at least one of: the target response code is included in the no response, the response data error, and/or the response data.
Step S103, if yes, sending a response result corresponding to the response state to the user side; if not, forwarding the service access request to a second server according to the proxy transfer configuration, and sending a response result returned by the second server to the user side; the proxy transfer configuration is used for changing the access address information indicated by the service access request into the address information corresponding to the second server.
Further, according to the embodiment of the present invention, after the step of forwarding the service access request to the second server according to the proxy transfer configuration, the method further includes:
acquiring a response state of the second server, and judging whether the response state is normal or not;
if so, sending a response result corresponding to the response state to the user side;
if not, the service access request is forwarded to the third server, and a response result returned by the third server is sent to the user side.
Specifically, the third server is a bottom-holding policy according to the embodiment of the present invention, and the ip corresponding to the bottom-holding agent may be a designated ip or a domain name. The data corresponding to the background proxy is set by independent cache, and when the service server and the candidate server can not meet the requirement of service processing, the background data responding according to the service access request is sent to the user by configuring the corresponding background proxy data, so that the stability of the service processing method can be further improved.
According to the technical scheme of the embodiment of the invention, the service access request is forwarded to the first server in response to the service access request initiated by the user side; acquiring a response state of the first server, and judging whether the response state is normal or not; if so, sending a response result corresponding to the response state to the user side; if not, forwarding the service access request to a second server according to the proxy transfer configuration, and sending a response result returned by the second server to the user side; the agent transfer is configured with a technical means for changing the access address information indicated by the service access request into the address information corresponding to the second server, so that the technical problems of low service processing efficiency, high risk of service operation process and poor user experience in the existing service processing method are solved, and the technical effects of improving the service processing efficiency, reducing the risk of service operation process and improving the user experience are achieved.
Fig. 2a is a schematic diagram of a main flow of a service processing method according to a second embodiment of the present invention; as shown in fig. 2a, the service processing method provided in the embodiment of the present invention mainly includes:
step S201, receiving a service access request initiated by a user.
Step S202, judging whether to start the automatic agent transfer according to the service requirement. If yes, the agent automatic transfer is started, and step S203 is executed; if not, the agent auto-transfer is not started, and step S204 is executed.
Specifically, according to the embodiment of the present invention, for a service access request initiated by a user, when an error or no response or an agreed response status code occurs on a certain path/page of an access system (i.e. the response status for the service access request is abnormal), a calling module may be configured or pre-woven, there are mainly two calling modes (the existing calling mode capable of implementing proxy transfer is also applicable to the present application), one is a front-end calling mode, and when an http request at a current end abnormally responds or an agreed status code occurs, an extranet domain name may be directly called, that is, an original domain name and an access path are replaced by a proxy domain name and a path, and then a proxy service is used to implement corresponding service processing on the service access request. Alternatively, when the front-end requests the back-end service, if the back-end service detects a data error to be responded or an internal error of the system, the failover agent can be actively called according to the configuration. It should be noted that the above-mentioned calling method may also be adopted at the same time, that is, the calling is performed in a mixed form of front-end calling and back-end calling to implement proxy transfer.
An application scenario of the embodiment of the present invention is that, in the case of a system failure occurring in a service processing process, a service access request is forwarded to a standby server for corresponding service processing based on proxy transfer configuration (implementation of proxy transfer configuration may be performed by performing script configuration on a proxy service such as ngnix, and a domain name and an IP to be called may be specified for a specified method during configuration), so as to improve user experience.
Step S203, obtaining the current service access status and the server load status, determining a target server according to the current service access status and the server load status, and forwarding the service access request to the target server.
For a service access request for testing an application version, the embodiment of the present invention may also determine a target server in combination with a test version corresponding to the service access request while considering a current service access status and a server load status, where it should be noted that the target server may be a first server (a service server) or a second server (a candidate server).
Further, according to the embodiment of the present invention, if the service access request is a test request; the step of determining the target server according to the current service access status and the server load status, and forwarding the service access request to the target server further includes:
determining a test version corresponding to the service access request;
and determining a target server according to the current service access condition, the server load condition and the test version, and forwarding the service access request to the target server.
For a service access request for testing an application version, the embodiment of the present invention may also determine a target server in combination with a test version corresponding to the service access request while considering a current service access status and a server load status, where it should be noted that the target server may be a first server (a service server) or a second server (a candidate server).
Preferably, the method further comprises:
and acquiring version management information, and updating the target server corresponding to the test version according to the version management information.
Through the setting, the test server corresponding to the test version can be updated according to the test condition of the application version, the application scene corresponding to the service processing is expanded through the setting, the A/B test of the interface level can be realized, and the fineness and the test efficiency of the gray level test are improved.
The version management information can be realized by using a tool which is commonly used for open source integration and can be version-controlled like Jenkins.
Step S204, the service access request is forwarded to the first server.
The first server, i.e., the service server, is a server that mainly performs corresponding service processing for the service access request. May be a cluster of servers that normally provide on-line service capabilities.
Step S205, acquiring a response status of the first server, and determining whether the response status is normal. If yes, i.e. the response status is normal, go to step S206; if not, the response status is abnormal, and the process goes to step S207.
Specifically, according to an embodiment of the present invention, the case where the response state is abnormal includes at least one of: the target response code is included in the no response, the response data error, and/or the response data.
Step S206, sending the response result corresponding to the response status to the user side.
Step S207, forwarding the service access request to the second server according to the proxy transfer configuration, and sending a response result returned by the second server to the user side.
In particular, according to an embodiment of the present invention, the second server may be a cluster of candidate servers. According to a specific implementation manner of the embodiment of the invention, the candidate server cluster can be divided into two small parts, which are mainly considered as a main candidate server cluster (the service master-head version is consistent with the first server cluster and can provide consistent service capability with the online at any time), and a secondary candidate server cluster (the service master-head-1 version and the latest available service capability version), so that the design is more flexible, the dynamic hot loading of the script (the dynamic hot loading part can control the target candidate server cluster to be scheduled in real time according to the business needs) is enhanced and scheduled according to the business or configuration needs, so as to facilitate the scheduling of equal service scheduling or degraded service capability, the scheduling of equal service capability (the main candidate server cluster) can be independently repaired and updated, and no influence is caused on the service of the main cluster and the standby secondary cluster, and the system cluster is dynamically scheduled more flexibly.
Further, according to the embodiment of the present invention, after the step of forwarding the service access request to the second server according to the proxy transfer configuration, the method further includes:
acquiring a response state of the second server, and judging whether the response state is normal or not;
if so, sending a response result corresponding to the response state to the user side;
if not, the service access request is forwarded to the third server, and a response result returned by the third server is sent to the user side.
Specifically, the third server is a bottom-holding policy according to the embodiment of the present invention, and the ip corresponding to the bottom-holding agent may be a designated ip or a domain name. The data corresponding to the background proxy is set by independent cache, and when the service server and the candidate server can not meet the requirement of service processing, the background data responding according to the service access request is sent to the user by configuring the corresponding background proxy data, so that the stability of the service processing method can be further improved.
Further, according to the embodiment of the present invention, a service processing system is also provided, which mainly includes a user side, an agent transfer gateway, a service processing server (cluster), and a version management server (or a version management module disposed in the service processing server). As shown in fig. 2b, the user initiates a service access request based on the browsed page, the proxy transfer gateway determines whether to start proxy automatic transfer according to the service requirement, if so, further determines a test version corresponding to the service access request, then determines a target server according to the current service access status, the server load status, and the test version, and forwards the service access request to the target server (the target server may be a service server or a candidate server), and then the target server executes corresponding service processing. If the agent automatic transfer is not started, the service access request is directly sent to a service server in an idle state in a service server cluster, the service server is judged according to the response state of the service access request, and if the response state is normal, the response result is displayed on the user side; if the response state is abnormal, the proxy transfer gateway further dispatches the service access request to the candidate server for processing.
According to the technical scheme of the embodiment of the invention, the service access request is forwarded to the first server in response to the service access request initiated by the user side; acquiring a response state of the first server, and judging whether the response state is normal or not; if so, sending a response result corresponding to the response state to the user side; if not, forwarding the service access request to a second server according to the proxy transfer configuration, and sending a response result returned by the second server to the user side; the agent transfer is configured with a technical means for changing the access address information indicated by the service access request into the address information corresponding to the second server, so that the technical problems of low service processing efficiency, high risk of service operation process and poor user experience in the existing service processing method are solved, and the technical effects of improving the service processing efficiency, reducing the risk of service operation process and improving the user experience are achieved.
Fig. 3 is a schematic diagram of main modules of a service processing apparatus provided according to an embodiment of the present invention; as shown in fig. 3, a service processing apparatus 300 according to an embodiment of the present invention mainly includes:
the response module 301 is configured to respond to a service access request initiated by a user side, and forward the service access request to the first server.
Specifically, the service access request may be an http request, or a request for accessing the candidate server. In an application scenario of the embodiment of the present invention, under a condition of a system failure occurring in a service processing process, a service access request is forwarded to a standby server for corresponding service processing based on proxy transfer configuration, so as to improve user experience.
The first server, i.e., the service server, is a server that mainly performs corresponding service processing for the service access request.
Further, according to an embodiment of the present invention, the service processing apparatus 300 further includes a target server determining module, before the step of forwarding the service access request to the first server, the target server determining module is configured to:
judging whether to start proxy automatic transfer or not according to the service requirement;
if so, acquiring the current service access condition and the server load condition, determining a target server according to the current service access condition and the server load condition, and forwarding a service access request to the target server;
and if not, forwarding the service access request to the first server.
Specifically, in order to cope with the situation that the corresponding service processing can be continuously completed even if a system fault occurs in the service processing process, the embodiment of the present invention mainly adopts two ways. The first method is that a service access request is directly forwarded to a first server, and then whether proxy transfer is performed or not is determined according to whether an abnormality occurs in the response state of the first server or not; and secondly, after receiving a service access request, determining whether to start proxy automatic transfer according to service requirements, if so, identifying the service access request according to the started proxy automatic transfer, monitoring the load capacity of the server, and further determining a target server for the current service access request so as to avoid system faults in advance, so that the service processing efficiency is higher, and the user experience is further improved.
Preferably, according to the embodiment of the present invention, if the service access request is a test request; the target server determination module is further configured to:
determining a test version corresponding to the service access request;
and determining a target server according to the current service access condition, the server load condition and the test version, and forwarding the service access request to the target server.
For a service access request for testing an application version, the embodiment of the present invention may also determine a target server in combination with a test version corresponding to the service access request while considering a current service access status and a server load status, where it should be noted that the target server may be a first server (a service server) or a second server (a candidate server).
Further, the service processing apparatus 300 further includes an updating module, configured to:
and acquiring version management information, and updating the target server corresponding to the test version according to the version management information.
Through the setting, the test server corresponding to the test version can be updated according to the test condition of the application version, the application scene corresponding to the service processing is expanded through the setting, the A/B test of the interface level can be realized, and the fineness and the test efficiency of the gray level test are improved.
The determining module 302 is configured to obtain a response state of the first server, and determine whether the response state is normal.
Specifically, according to an embodiment of the present invention, the case where the response state is abnormal includes at least one of: the target response code is included in the no response, the response data error, and/or the response data.
The service processing module 303, if the response state is normal, the response module is configured to send a response result corresponding to the response state to the user side; if the response state is abnormal, the response module is used for forwarding the service access request to the second server according to the proxy transfer configuration and sending a response result returned by the second server to the user side; the proxy transfer configuration is used for changing the access address information indicated by the service access request into the address information corresponding to the second server.
Further, according to the embodiment of the present invention, after the step of forwarding the service access request to the second server according to the proxy transfer configuration, the determining module is further configured to:
acquiring a response state of the second server, and judging whether the response state is normal or not;
if so, sending a response result corresponding to the response state to the user side;
if not, the service access request is forwarded to the third server, and a response result returned by the third server is sent to the user side.
Specifically, the third server is a bottom-holding policy according to the embodiment of the present invention, and the ip corresponding to the bottom-holding agent may be a designated ip or a domain name. The data corresponding to the background agent is set by independent cache, and when the business server and the candidate server can not meet the requirement of business processing, the background data responding according to the business access request is sent to the user by configuring the corresponding background agent data, so that the stability of the business processing device can be further improved.
According to the technical scheme of the embodiment of the invention, the service access request is forwarded to the first server in response to the service access request initiated by the user side; acquiring a response state of the first server, and judging whether the response state is normal or not; if so, sending a response result corresponding to the response state to the user side; if not, forwarding the service access request to a second server according to the proxy transfer configuration, and sending a response result returned by the second server to the user side; the agent transfer is configured with a technical means for changing the access address information indicated by the service access request into the address information corresponding to the second server, so that the technical problems of low service processing efficiency, high risk of service operation process and poor user experience in the existing service processing method are solved, and the technical effects of improving the service processing efficiency, reducing the risk of service operation process and improving the user experience are achieved.
Fig. 4 shows an exemplary system architecture 400 of a service processing method or service processing apparatus to which embodiments of the present invention may be applied.
As shown in fig. 4, the system architecture 400 may include terminal devices 401, 402, 403, a network 404, and a server 405 (this architecture is merely an example, and the components included in a particular architecture may be adapted according to application specific circumstances). The network 404 serves as a medium for providing communication links between the terminal devices 401, 402, 403 and the server 405. Network 404 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use terminal devices 401, 402, 403 to interact with a server 405 over a network 404 to receive or send messages or the like. The terminal devices 401, 402, 403 may have installed thereon various communication client applications, such as a business process-type application, a shopping-type application, a web browser application, a search-type application, an instant messaging tool, a mailbox client, social platform software, etc. (by way of example only).
The terminal devices 401, 402, 403 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 405 may be a server that provides various services, such as a server (for example only) that performs business processing/data processing on users using the terminal devices 401, 402, 403. The server may analyze and/or otherwise process the received data, such as the service access request, and feed back a processing result (e.g., a response result, which is merely an example) to the terminal device.
It should be noted that the service processing method provided by the embodiment of the present invention is generally executed by the server 405, and accordingly, the service processing apparatus is generally disposed in the server 405.
It should be understood that the number of terminal devices, networks, and servers in fig. 4 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 5, a block diagram of a computer system 500 suitable for use with a terminal device or server implementing an embodiment of the invention is shown. The terminal device or the server shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 5, the computer system 500 includes a Central Processing Unit (CPU)501 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for the operation of the system 500 are also stored. The CPU 501, ROM 502, and RAM 503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output portion 507 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The driver 510 is also connected to the I/O interface 505 as necessary. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 501.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer 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 of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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. In the present invention, a computer 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. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer 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 computer readable signal medium may also be any computer readable medium that is not a computer 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 computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor comprises a response module, a judgment module and a service processing module. The names of these modules do not constitute a limitation to the modules themselves in some cases, for example, the response module may also be described as "a module for forwarding a service access request to the first server in response to a service access request initiated by a user side".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: responding to a service access request initiated by a user side, and forwarding the service access request to a first server; acquiring a response state of the first server, and judging whether the response state is normal or not; if so, sending a response result corresponding to the response state to the user side; if not, forwarding the service access request to a second server according to the proxy transfer configuration, and sending a response result returned by the second server to the user side; the proxy transfer configuration is used for changing the access address information indicated by the service access request into the address information corresponding to the second server.
According to the technical scheme of the embodiment of the invention, the service access request is forwarded to the first server in response to the service access request initiated by the user side; acquiring a response state of the first server, and judging whether the response state is normal or not; if so, sending a response result corresponding to the response state to the user side; if not, forwarding the service access request to a second server according to the proxy transfer configuration, and sending a response result returned by the second server to the user side; the agent transfer is configured with a technical means for changing the access address information indicated by the service access request into the address information corresponding to the second server, so that the technical problems of low service processing efficiency, high risk of service operation process and poor user experience in the existing service processing method are solved, and the technical effects of improving the service processing efficiency, reducing the risk of service operation process and improving the user experience are achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method for processing a service, comprising:
responding to a service access request initiated by a user side, and forwarding the service access request to the first server;
acquiring a response state of the first server, and judging whether the response state is normal or not;
if so, sending a response result corresponding to the response state to the user side;
if not, forwarding the service access request to a second server according to proxy transfer configuration, and sending a response result returned by the second server to a user side; and the proxy transfer configuration is used for changing the access address information indicated by the service access request into the address information corresponding to the second server.
2. The traffic processing method according to claim 1, wherein after said step of forwarding the traffic access request to the second server according to the proxy transfer configuration, the method further comprises:
acquiring a response state of the second server, and judging whether the response state is normal or not;
if so, sending a response result corresponding to the response state to the user side;
if not, forwarding the service access request to a third server, and sending a response result returned by the third server to the user side.
3. The service processing method according to claim 1, wherein prior to the step of forwarding the service access request to the first server, the method further comprises:
judging whether to start proxy automatic transfer or not according to the service requirement;
if yes, acquiring a current service access condition and a server load condition, determining a target server according to the current service access condition and the server load condition, and forwarding the service access request to the target server;
and if not, forwarding the service access request to the first server.
4. The service processing method according to claim 3, wherein if the service access request is a test request; the step of determining a target server according to the current service access condition and the server load condition and forwarding the service access request to the target server further comprises:
determining a test version corresponding to the service access request;
and determining a target server according to the current service access condition, the server load condition and the test version, and forwarding the service access request to the target server.
5. The traffic processing method according to claim 4, wherein the method further comprises:
and acquiring version management information, and updating the target server corresponding to the test version according to the version management information.
6. The traffic processing method according to claim 1, wherein the case where the response status is abnormal includes at least one of: no response, response data error, and/or including a target response code in the response data.
7. A traffic processing apparatus, comprising:
the response module is used for responding to a service access request initiated by a user side and forwarding the service access request to the first server;
the judging module is used for acquiring the response state of the first server and judging whether the response state is normal or not;
the service processing module is used for sending a response result corresponding to the response state to the user side if the response state is normal;
if the response state is abnormal, the response module is used for forwarding the service access request to a second server according to proxy transfer configuration and sending a response result returned by the second server to the user side; and the proxy transfer configuration is used for changing the access address information indicated by the service access request into the address information corresponding to the second server.
8. The transaction processing device of claim 7, further comprising an auto-transfer module, prior to the step of forwarding the service access request to the first server, configured to:
judging whether to start proxy automatic transfer or not according to the service requirement;
if yes, acquiring a current service access condition and a server load condition, determining a target server according to the current service access condition and the server load condition, and forwarding the service access request to the target server;
and if not, forwarding the service access request to the first server.
9. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-6.
10. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-6.
CN202110167441.0A 2021-02-05 2021-02-05 Service processing method and device Pending CN113760533A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110167441.0A CN113760533A (en) 2021-02-05 2021-02-05 Service processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110167441.0A CN113760533A (en) 2021-02-05 2021-02-05 Service processing method and device

Publications (1)

Publication Number Publication Date
CN113760533A true CN113760533A (en) 2021-12-07

Family

ID=78786554

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110167441.0A Pending CN113760533A (en) 2021-02-05 2021-02-05 Service processing method and device

Country Status (1)

Country Link
CN (1) CN113760533A (en)

Similar Documents

Publication Publication Date Title
WO2020207454A1 (en) Information pushing method and device
CN107729176B (en) Disaster recovery method and disaster recovery system for configuration file management system
CN106941420B (en) cluster application environment upgrading method and device
CN110896362B (en) Fault detection method and device
CN110620806A (en) Information generation method and device
CN113282589A (en) Data acquisition method and device
CN113742389A (en) Service processing method and device
CN110275701B (en) Data processing method, device, medium and computing equipment
CN109445966B (en) Event processing method, device, medium and computing equipment
CN113760533A (en) Service processing method and device
CN114070889B (en) Configuration method, traffic forwarding device, storage medium, and program product
CN116932505A (en) Data query method, data writing method, related device and system
CN113765871B (en) Method and device for managing fort machine
CN112688982B (en) User request processing method and device
CN112769960A (en) Active flow control method and system based on Nginx server
CN111210349A (en) Virtual asset transfer hosting method and device, electronic equipment and storage medium
CN113742617A (en) Cache updating method and device
CN113760693A (en) Method and apparatus for local debugging of microservice systems
CN111580882A (en) Application program starting method, device, computer system and medium
CN110011767B (en) Method and apparatus for TCP connection backup
CN117312440A (en) Service data processing method and device
CN113468053B (en) Application system testing method and device
CN113761056A (en) Distributed service processing method, device and system
CN117675846A (en) Cache cluster maintenance method, device, electronic equipment and computer readable medium
CN117667289A (en) Loading rendering method and device of application component

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