CN112433891A - Data processing method and device and server - Google Patents

Data processing method and device and server Download PDF

Info

Publication number
CN112433891A
CN112433891A CN202011391170.9A CN202011391170A CN112433891A CN 112433891 A CN112433891 A CN 112433891A CN 202011391170 A CN202011391170 A CN 202011391170A CN 112433891 A CN112433891 A CN 112433891A
Authority
CN
China
Prior art keywords
data processing
preset
state
request
disaster recovery
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
CN202011391170.9A
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.)
China Construction Bank Corp
Original Assignee
China Construction Bank Corp
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 China Construction Bank Corp filed Critical China Construction Bank Corp
Priority to CN202011391170.9A priority Critical patent/CN112433891A/en
Publication of CN112433891A publication Critical patent/CN112433891A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/16Error detection or correction of the data by redundancy in hardware
    • G06F11/20Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements
    • G06F11/202Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where processing functionality is redundant
    • G06F11/2023Failover techniques
    • G06F11/2025Failover techniques using centralised failover control functionality
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/16Error detection or correction of the data by redundancy in hardware
    • G06F11/20Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements
    • G06F11/202Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where processing functionality is redundant
    • G06F11/2043Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where processing functionality is redundant where the redundant components share a common memory address space

Abstract

The specification provides a data processing method, a data processing device and a server. Based on the method, after receiving a data processing request carrying a URL address parameter related to a back-end service, a server firstly queries the switch state of a current disaster recovery processing mode, and acquires a target distribution ratio matched with the URL address parameter by querying a preset shared memory under the condition of determining the switch state, wherein the target distribution ratio is updated at regular time; the server may shunt the data processing request to the backend server according to the target shunting proportion, or perform corresponding processing by using a preset disaster recovery processing module, which corresponds to the backend service and stores static service data related to the backend service in advance. Therefore, under the condition that the back-end server is abnormal, the data processing request can be intelligently and reasonably shunted, and the preset disaster recovery processing module and the back-end server can be used for responding to the data processing request finely to complete corresponding data processing.

Description

Data processing method and device and server
Technical Field
The specification belongs to the technical field of internet, and particularly relates to a data processing method, a data processing device and a server.
Background
In some data processing scenarios (for example, transaction data processing scenarios of banks), in order to avoid that an accessed data processing request cannot be processed in time due to an abnormality of a system backend server, a disaster recovery processing system is often configured in addition to an original data processing system, so as to process the accessed data processing request when the system server is abnormal.
However, when the data processing request is processed abnormally by the system back-end server based on the existing data processing method, the data processing request is rough and not fine enough. For example, when it is found that a certain backend server in the system is abnormal and meets a preset trigger condition, most of the existing methods directly trigger service fusing, that is, all accessed data processing requests are sent to the disaster recovery processing system for processing.
Therefore, when the method is implemented specifically based on the existing method, the technical problems that the use experience of a user is influenced due to the fact that the data processing request is not fine when the back-end server is abnormal are easy to occur.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The specification provides a data processing method, a data processing device and a server, so that under the condition that a back-end server is abnormal, a data processing request can be intelligently and reasonably shunted, the data processing request can be responded by a preset disaster recovery processing module and the back-end server finely, corresponding data processing is completed, and the use experience of a user is improved.
A data processing method provided in this specification includes:
receiving a data processing request sent by terminal equipment; the data processing request carries URL address parameters related to the requested back-end service;
inquiring the switch state of the current disaster recovery processing mode;
under the condition that the on-off state of the current disaster recovery processing mode is an on state, inquiring a preset shared memory to obtain a target distribution ratio matched with the URL address parameter; the target shunting proportion is updated regularly according to an abnormal proportion parameter of a back-end service;
according to the target distribution proportion, the data processing request is sent to a back-end server corresponding to the back-end service, or a preset disaster tolerance processing module corresponding to the back-end service carries out corresponding processing to obtain a corresponding processing result; the preset disaster tolerance processing module stores static business data related to the back-end service in advance;
and sending the processing result to the terminal equipment.
In one embodiment, after querying the switch status of the current disaster recovery processing mode, the method further comprises:
and sending the data processing request to a back-end server corresponding to the back-end service for corresponding processing under the condition that the on-off state of the current disaster recovery processing mode is the off state.
In one embodiment, after sending the data processing request to a backend server corresponding to the backend service for corresponding processing, the method further includes:
detecting whether error information aiming at the data processing request fed back by a back-end server is received or not;
and under the condition that the error reporting information fed back by the back-end server is determined to be received, sending the data processing request to a preset disaster recovery processing module for corresponding processing.
In one embodiment, the predetermined shared memory includes a nginnx shared memory.
In one embodiment, the method further comprises:
the method comprises the steps of obtaining a corresponding state log of a back-end service at regular intervals according to a preset disaster tolerance service list at preset time intervals;
according to the state log of the back-end service, counting an abnormal proportion parameter of the back-end service;
and determining the switch state of the disaster tolerance processing mode according to the abnormal proportion parameter of the back-end service and a preset disaster tolerance rule.
In one embodiment, the method further comprises:
generating a switch identifier for indicating the opening state under the condition that the switch state of the disaster recovery processing mode is determined to be the opening state; or, under the condition that the switch state of the disaster recovery processing mode is determined to be the closed state, generating a switch identifier for indicating the closed state;
storing the switch identifier in a preset shared memory; or, updating the switch identifier in the preset shared memory.
In one embodiment, the querying the switch status of the current disaster recovery processing mode includes:
inquiring the preset shared memory to obtain the current switch identifier;
and determining the switch state of the current disaster recovery processing mode according to the current switch identifier.
In one embodiment, after the switch identifier indicating the on state is generated when the switch state of the disaster recovery processing mode is determined to be the on state, the method further includes:
generating a matched target distribution ratio according to the abnormal ratio parameter of the back-end service and a preset disaster tolerance rule;
storing the matched target shunt ratio in a preset shared memory; or updating the target shunt ratio in the preset shared memory according to the matched target shunt ratio.
In one embodiment, after sending the data processing request to a preset disaster recovery processing module corresponding to the backend service for corresponding processing, the method further includes:
a built-in preset copying module is called to copy the data processing request to obtain a simulation request;
and sending the simulation request to a back-end server corresponding to the back-end service for testing so as to trigger the collection of state parameters of the back-end server and generate a corresponding state log of the back-end service.
In one embodiment, the state parameter comprises an average of the response times.
In one embodiment, the built-in pre-set copy module includes: ngx _ http _ mirror _ module.
In one embodiment, the invoking a built-in preset copy module to copy the data processing request to obtain a simulation request includes:
detecting the type of the data processing request; wherein the types of the data processing requests comprise user requests and crawler requests;
and under the condition that the data processing request is determined to be a user request, calling a built-in preset copying module to copy the data processing request to obtain a simulation request.
This specification also provides a data processing apparatus including:
the receiving module is used for receiving a data processing request sent by the terminal equipment; the data processing request carries URL address parameters related to the requested back-end service;
the first query module is used for querying the switch state of the current disaster recovery processing mode;
the second query module is used for querying a preset shared memory to obtain a target shunt ratio matched with the URL address parameter when the on-off state of the current disaster recovery processing mode is queried to be the on state; the target shunting proportion is updated regularly according to an abnormal proportion parameter of a back-end service;
the processing module is used for sending the data processing request to a back-end server corresponding to the back-end service according to the target distribution ratio, or correspondingly processing a preset disaster tolerance processing module corresponding to the back-end service to obtain a corresponding processing result; the preset disaster tolerance processing module stores static business data related to the back-end service in advance;
and the feedback module is used for sending the processing result to the terminal equipment.
The specification also provides a server, which comprises a processor and a memory for storing processor executable instructions, wherein the processor is used for receiving the data processing request sent by the terminal equipment when executing the instructions; the data processing request carries URL address parameters related to the requested back-end service; inquiring the switch state of the current disaster recovery processing mode; under the condition that the on-off state of the current disaster recovery processing mode is an on state, inquiring a preset shared memory to obtain a target distribution ratio matched with the URL address parameter; the target shunting proportion is updated regularly according to an abnormal proportion parameter of a back-end service; according to the target distribution proportion, the data processing request is sent to a back-end server corresponding to the back-end service, or a preset disaster tolerance processing module corresponding to the back-end service carries out corresponding processing to obtain a corresponding processing result; the preset disaster tolerance processing module stores static business data related to the back-end service in advance; and sending the processing result to the terminal equipment.
The present specification also provides a computer-readable storage medium having stored thereon computer instructions which, when executed, implement receiving a data processing request sent by a terminal device; the data processing request carries URL address parameters related to the requested back-end service; inquiring the switch state of the current disaster recovery processing mode; under the condition that the on-off state of the current disaster recovery processing mode is an on state, inquiring a preset shared memory to obtain a target distribution ratio matched with the URL address parameter; the target shunting proportion is updated regularly according to an abnormal proportion parameter of a back-end service; according to the target distribution proportion, the data processing request is sent to a back-end server corresponding to the back-end service, or a preset disaster tolerance processing module corresponding to the back-end service carries out corresponding processing to obtain a corresponding processing result; the preset disaster tolerance processing module stores static business data related to the back-end service in advance; and sending the processing result to the terminal equipment.
According to the data processing method, the data processing device and the server, after a data processing request carrying a URL address parameter related to a back-end service is received by the server, the on-off state of a current disaster recovery processing mode is inquired, and under the condition that the on-off state is determined, a preset shared memory is inquired to obtain a target distribution ratio matched with the URL address parameter, wherein the target distribution ratio is updated at regular time; the server may shunt the data processing request to the corresponding backend server according to the target shunting proportion, or perform corresponding processing on a preset disaster recovery processing module, corresponding to the backend server, in which static service data related to the backend service is stored in advance. Therefore, under the condition that the back-end server is abnormal, the data processing request can be intelligently and reasonably shunted, the preset disaster recovery processing module and the back-end server can be used for responding to the data processing request, corresponding data processing is well completed, and the use experience of a user is improved. The method solves the technical problems that the existing method is not fine in processing the data processing request under the condition that the back-end server is abnormal, and the use experience of a user is influenced.
Drawings
In order to more clearly illustrate the embodiments of the present specification, the drawings needed to be used in the embodiments will be briefly described below, and the drawings in the following description are only some of the embodiments described in the present specification, and it is obvious to those skilled in the art that other drawings can be obtained according to the drawings without any creative effort.
Fig. 1 is a schematic diagram of an embodiment of a structural component of a system to which a data processing method provided by an embodiment of the present specification is applied;
FIG. 2 is a flow diagram of a data processing method provided by one embodiment of the present description;
FIG. 3 is a schematic diagram of a server according to an embodiment of the present disclosure;
FIG. 4 is a schematic diagram illustrating a structural configuration of a data processing apparatus according to an embodiment of the present disclosure
FIG. 5 is a diagram illustrating an embodiment of a data processing method according to an embodiment of the present disclosure;
FIG. 6 is a diagram illustrating an embodiment of a data processing method according to an embodiment of the present disclosure;
fig. 7 is a schematic diagram of an embodiment of a data processing method provided by an embodiment of the present specification, in an example scenario.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present specification, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is obvious that the described embodiments are only a part of the embodiments of the present specification, and not all of the embodiments. All other embodiments obtained by a person skilled in the art based on the embodiments in the present specification without any inventive step should fall within the scope of protection of the present specification.
In consideration of the fact that, based on the existing data processing method, when it is detected that a preset trigger condition is met (for example, an abnormality occurs in one or more backend servers in the system), the data processing method directly triggers the disaster recovery processing system to access all data processing requests for data processing without performing fine distinction. This data processing approach (i.e., the approach of service fusing) is relatively crude and not fine enough; and because all accessed data processing requests are simply processed by using the disaster recovery processing system, the use experience obtained by the user side is relatively poor.
For the root cause of the above problem, the present specification considers that, first, the server may detect and determine an abnormal proportion parameter of the backend service at regular time, and then may dynamically update the switch state of the disaster recovery processing mode according to the abnormal proportion constant of the backend service, and in a case where the switch state of the disaster recovery processing mode is in an on state, the matched target shunt proportion; furthermore, when the server receives a data processing request, the server can determine the switch state of the current disaster recovery processing mode through query, and can further query the current matched target shunt ratio under the condition that the switch state of the current disaster recovery processing mode is the open state; and then, the data processing request is shunted according to the target shunting proportion, and the data processing request is sent to a corresponding back-end server or a corresponding preset static processing module for processing. Therefore, the data processing request of the user is processed by adopting a service degradation mode, and compared with a service fusing mode adopted by the existing method, the latest state condition of a back-end server of the current system can be effectively combined, the data processing request of the user can be processed more finely and reasonably, and the use experience of the user is improved. The method solves the technical problems that the existing method is not fine in processing the data processing request under the condition that the back-end server is abnormal, and the use experience of a user is influenced.
Based on the above concept, embodiments of the present disclosure provide a data processing method, which may be specifically applied to a system including a server, a terminal device, and a preset disaster recovery processing module.
In particular, reference may be made to fig. 1. The server may include a front-end server and a plurality of back-end servers. The front-end server is connected with the terminal equipment used by the user. The plurality of back-end servers are respectively connected with the front-end server and are respectively used for responding to the data processing request of the user to perform online processing under the normal condition so as to provide corresponding back-end services for the user. The preset disaster recovery processing module is connected with the front-end server, stores static business data related to the back-end service, and is used for processing a data processing request of a user by using the stored static business data under the abnormal condition. The front-end server and the plurality of back-end servers are combined to form a server cluster (for example, a Nginx cluster) responsible for processing data processing requests.
In this embodiment, the front-end server and the back-end server may specifically include a background server that is applied to one side of the service platform and is capable of implementing functions such as data transmission and data processing. Specifically, the front-end server and the back-end server may be, for example, an electronic device having data operation, storage function and network interaction function. Alternatively, the front-end server and the back-end server may also be software programs that run in the electronic device and provide support for data processing, storage, and network interaction.
In this embodiment, the terminal device may specifically include an electronic device that is applied to a user side and can implement functions such as data acquisition and data transmission. Specifically, the terminal device may be, for example, a desktop computer, a tablet computer, a notebook computer, a smart phone, and the like. Alternatively, the terminal device may be a software application capable of running in the electronic device. For example, it may be some APP running on a smartphone, etc.
In particular, the user may initiate a data processing request (e.g., a transaction data processing request) to the front-end server through the terminal device. Wherein the data processing request carries at least a URL address parameter associated with the requested backend service.
The front-end server receives the data processing request, responds to the data processing request, and inquires the switch state of the current disaster recovery processing mode.
When the front-end server inquires that the switching state of the current disaster recovery processing mode is the on state, further, a preset shared memory can be inquired to obtain a target distribution ratio matched with the URL address parameter. And updating the target shunt ratio stored in the preset shared memory at regular time according to the abnormal ratio parameter of the back-end service.
Further, the front-end server may split the data processing request according to the target splitting ratio, that is, it is determined whether to send the data processing request to the back-end server corresponding to the back-end service for corresponding processing, or to send the data processing request to a preset disaster recovery processing module corresponding to the back-end service for corresponding processing.
Specifically, for example, if the target diversion ratio is large, the data processing request is sent to a preset disaster recovery processing module with a relatively high probability, so as to perform emergency processing by using static service data. On the contrary, if the target distribution ratio is small, the data processing request is sent to the back-end server with relatively high probability to be processed normally.
And the front-end server receives a processing result fed back after the processing of the rear-end server or the preset disaster recovery processing module, and feeds the processing result back to the terminal equipment.
And the terminal equipment displays the processing result to the user.
Based on the system, under the condition that the back-end server is abnormal, the data processing request can be intelligently and reasonably shunted, and the preset disaster recovery processing module and the back-end server are used for responding to the data processing request finely to complete corresponding data processing. The technical problems of imprecise processing and poor user experience caused by the fact that the existing method adopts a service fusing mode to conduct rough processing can be effectively solved.
Referring to fig. 2, an embodiment of the present disclosure provides a data processing method. The method is particularly applied to the server side. In particular implementations, the method may include the following.
S201: receiving a data processing request sent by terminal equipment; wherein the data processing request carries a URL address parameter associated with the requested backend service.
In this embodiment, the terminal device may receive and respond to the corresponding operation of the user, and generate and send a corresponding data processing request to the server. The data processing request may specifically be a transaction data processing request, such as an order query request, an order payment request, an account balance query request, and the like. Of course, it should be noted that the above listed data processing requests are only illustrative. In specific implementation, the data processing request may also include other types of data processing requests according to specific application scenarios and processing needs. For example, the data processing request may be a web page access request, an account login request, or the like. The present specification is not limited to these.
In this embodiment, the data processing request may be specifically used to request a corresponding backend server to perform related data processing, so as to provide a corresponding backend service.
In this embodiment, the data processing request may further specifically carry a URL (Uniform Resource Locator) address parameter related to the requested backend service. By using the URL address parameter, the specific backend service requested by the data processing request and the backend server providing the backend service can be determined.
S202: and inquiring the switch state of the current disaster recovery processing mode.
In this embodiment, the disaster recovery processing mode may be specifically understood as an emergency data processing mode that is triggered only when an abnormality occurs in the backend server and the degree of the abnormality is severe.
Specifically, under normal conditions, the switching state of the disaster recovery processing mode is the off state, and at this time, the data processing request accessed by the server is normally sent to the corresponding backend server for processing. When the back-end service is abnormal and the abnormal proportion is higher than a certain preset abnormal proportion threshold value, for example, the switch state of the disaster recovery processing mode is changed into the open state, at this time, the server intelligently shunts the accessed data processing requests according to the specific state condition of the back-end server, sends a part of the data processing requests to the back-end server for processing according to the matched target shunting proportion, and sends the other part of the data processing requests to the corresponding preset disaster recovery processing module for processing, that is, the accessed data processing requests are reasonably processed in a service degradation mode.
The preset disaster tolerance processing module may store static service data related to the backend service in advance. After receiving a data processing request shunted by the server, the preset disaster recovery processing module can respond to the data processing request, perform data processing by using the stored static service data, and timely generate and feed back a related data result to the user.
In an embodiment, the querying the switch state of the current disaster recovery processing mode may include the following steps: inquiring the preset shared memory to obtain the current switch identifier; and determining the switch state of the current disaster recovery processing mode according to the current switch identifier.
The switch identifier is used for indicating whether the switch state of the current disaster recovery processing mode is an open state or a closed state.
In an embodiment, the predetermined shared memory may specifically include an Nginx shared memory. The Nginx may be specifically understood as an open-source Web server which is known to have high performance and high concurrency, and supports HTTP (HyperText Transfer Protocol) reverse proxy, TCP (Transmission Control Protocol) proxy, load balancing, HTTP caching, Web development, and the like.
S203: under the condition that the on-off state of the current disaster recovery processing mode is an on state, inquiring a preset shared memory to obtain a target distribution ratio matched with the URL address parameter; and updating the target shunt proportion at regular time according to the abnormal proportion parameter of the back-end service.
In an embodiment, the preset shared memory further stores target split ratios corresponding to a plurality of URL address parameters. And the target shunt proportion is updated regularly according to the abnormal proportion parameter of the back-end service.
Specifically, according to a preset disaster tolerance rule, when the switching state of the disaster tolerance processing mode is the on state, the larger the abnormal proportion parameter of the back-end service is, the larger the value of the target shunt proportion is; accordingly, the higher the probability that the data processing request will be reflowed to the preset disaster recovery processing module for processing. Conversely, the smaller the abnormal proportion parameter of the back-end server is, the smaller the numerical value of the target shunt proportion is; accordingly, the lower the probability that the data processing request will be reflowed to the preset disaster recovery processing module for processing.
S204: according to the target distribution proportion, the data processing request is sent to a back-end server corresponding to the back-end service, or a preset disaster tolerance processing module corresponding to the back-end service carries out corresponding processing to obtain a corresponding processing result; the preset disaster tolerance processing module stores static business data related to the back-end service in advance.
In this embodiment, in specific implementation, the server may shunt the data processing request to a corresponding processing end (a back-end server or a preset disaster recovery processing module) for processing according to the target shunting proportion.
Specifically, for example, when a batch data processing request is currently received, the server may randomly extract a data processing request satisfying the target shunting ratio from the batch data processing requests according to the target shunting ratio, send the data processing request to the preset disaster recovery processing module for processing, and send the remaining data processing requests to the back-end server for processing.
For another example, a single data processing request is currently received, and the server may randomly send the data processing request to a backend server or a preset disaster recovery processing module for processing according to the target distribution ratio.
After receiving the data processing request, the back-end server may process the data processing request on line, and generate and feed back a corresponding processing result to the server.
After receiving the data processing request, the preset disaster recovery processing module may process the data processing request by using the pre-stored static service data, and generate and feed back a corresponding processing result to the server.
S205: and sending the processing result to the terminal equipment.
In this embodiment, after receiving a processing result fed back from the backend server or the preset disaster recovery processing module, the server may send the processing result to the terminal device. Accordingly, the terminal device can present the processing result to the user.
In this embodiment, after receiving a data processing request carrying a URL address parameter related to a backend service, a server queries a switching state of a current disaster recovery processing mode, and when determining that the data processing request is in an on state, may query a preset shared memory to obtain a target split ratio matched with the URL address parameter, where the target split ratio is updated at regular time; the server may shunt the data processing request to the backend server according to the target shunting proportion, or perform corresponding processing by using a preset disaster recovery processing module, which corresponds to the backend service and stores static service data related to the backend service in advance. Therefore, under the condition that the back-end server is abnormal, the data processing request can be intelligently and reasonably shunted, the preset disaster recovery processing module and the back-end server can be used for responding to the data processing request, corresponding data processing is well completed, and the use experience of a user is improved.
In an embodiment, after querying the switch state of the current disaster recovery processing mode, when the method is implemented, the following may be further included: and sending the data processing request to a back-end server corresponding to the back-end service for corresponding processing under the condition that the on-off state of the current disaster recovery processing mode is the off state.
In an embodiment, after sending the data processing request to a backend server corresponding to the backend service for corresponding processing, when the method is implemented, the method may further include the following steps: detecting whether error information aiming at the data processing request fed back by a back-end server is received or not; and under the condition that the error reporting information fed back by the back-end server is determined to be received, sending the data processing request to a preset disaster recovery processing module for corresponding processing.
In the present embodiment, the error information may be error information indicating an abnormality in the form of "5 xx", for example.
In this embodiment, the server may timely discover a back-end server that is not discovered before and has an exception suddenly, and then may timely forward the data processing request to the preset disaster recovery processing module for processing, so as to timely generate and feed back a corresponding processing result to the user, thereby improving the user experience of the user.
In one embodiment, the method may further include the following when embodied.
S1: the method comprises the steps of obtaining a corresponding state log of a back-end service at regular intervals according to a preset disaster tolerance service list at preset time intervals;
s2: according to the state log of the back-end service, counting an abnormal proportion parameter of the back-end service;
s3: and determining the switch state of the disaster tolerance processing mode according to the abnormal proportion parameter of the back-end service and a preset disaster tolerance rule.
In this embodiment, the preset disaster tolerance service list may specifically include a URL address parameter of a backend service that needs disaster tolerance.
Before specific implementation, the server can display a disaster tolerance parameter configuration interface to a user through the terminal device. According to a specific application scene, a user can input corresponding setting parameters on a disaster tolerance parameter configuration interface by combining factors such as real-time requirements and importance degrees of various back-end services. For example, the name, number, or URL address of the backend service that needs disaster recovery. The server can receive the setting parameters through a disaster tolerance parameter configuration interface and generate a corresponding preset disaster tolerance service list according to the setting parameters.
Further, the server may store the preset disaster tolerance service list in a preset shared memory. Correspondingly, the subsequent server may obtain the preset disaster tolerance service list by accessing a preset shared memory.
In this embodiment, the server may periodically obtain, at each preset time interval, a corresponding status log of the backend service according to the URL address parameter of the backend service included in the disaster recovery service list; and then, according to the state log of the back-end service, calculating an abnormal proportion parameter of the back-end service.
Further, the server can determine the switching state of the disaster recovery processing mode according to the abnormal proportion parameter of the back-end service and the preset disaster recovery rule. Specifically, a preset abnormal proportion threshold (e.g., 5%) is determined according to a preset disaster tolerance rule. And comparing the abnormal proportion parameter of the back-end service with a preset abnormal proportion threshold value to obtain a comparison result. And according to the comparison result, determining that the switch state of the disaster recovery processing mode is the opening state under the condition that the abnormal proportion parameter is determined to be greater than or equal to the preset abnormal proportion threshold value. And according to the comparison result, determining that the switch state of the disaster recovery processing mode is the closed state under the condition that the abnormal proportion parameter is determined to be smaller than the preset abnormal proportion threshold value.
In an embodiment, when the method is implemented, the following may be further included: generating a switch identifier for indicating the opening state under the condition that the switch state of the disaster recovery processing mode is determined to be the opening state; or, under the condition that the switch state of the disaster recovery processing mode is determined to be the closed state, generating a switch identifier for indicating the closed state; storing the switch identifier in a preset shared memory; or, updating the switch identifier in the preset shared memory.
In this embodiment, if the switch identifier is not stored in the preset shared memory before, the server may send and store the switch identifier in the preset shared memory to establish and obtain a new switch identifier. If the preset shared memory already stores the switch identifier, the server may update the existing switch identifier stored in the preset shared memory according to the switch identifier.
By storing the switch identifier in the preset shared memory, other servers can determine the switch state of the current disaster recovery processing mode more efficiently by inquiring the switch identifier stored in the preset shared memory.
In an embodiment, after generating a switch identifier for indicating an on state when it is determined that the switch state of the disaster recovery processing mode is the on state, the method may further include the following steps: generating a matched target distribution ratio according to the abnormal ratio parameter of the back-end service and a preset disaster tolerance rule; storing the matched target shunt ratio in a preset shared memory; or updating the target shunt ratio in the preset shared memory according to the matched target shunt ratio.
In this embodiment, after generating the switch identifier for indicating the on state, based on a preset disaster tolerance rule, the server may estimate the overall health condition of the back-end server according to the abnormal proportion parameter of the back-end service; predicting the processing amount of the data processing request which can be currently supported by the back-end server; and determining a target distribution proportion matched with the health condition of the current back-end server according to the processing amount and by combining factors such as the importance degree of the back-end service, the real-time requirement and the like.
Specifically, for example, when the abnormal proportion parameter of the backend service is relatively small and the health condition of the whole backend server is relatively good, the value of the matched target split ratio may be set to be relatively small, for example, the matched target split ratio is set to be 30%, that is, 30% of the data processing requests are split to the preset disaster recovery processing module for processing, or 30% of the data processing requests are split to the preset disaster recovery processing module for processing.
When the abnormal proportion parameter of the back-end service is relatively large and the health condition of the whole back-end server is relatively poor, the value of the matched target distribution proportion may be set to be relatively large, for example, the matched target distribution proportion is set to be 80%, that is, 80% of the data processing requests are distributed to the preset disaster recovery processing module for processing, or 80% of the data processing requests are distributed to the preset disaster recovery processing module for processing.
When the abnormal proportion parameter of the back-end service is particularly large and the back-end server cannot support processing of the newly accessed data processing request on the whole, the matched target distribution proportion value can be set to 100%, that is, the matched target distribution proportion value indicates that the accessed data processing request can be distributed to the preset disaster recovery processing module for processing, so as to avoid causing burden on the back-end server.
Based on the embodiment, the specific target distribution proportion can be adjusted and set according to the abnormal proportion parameter of the back-end service, so that the dynamic service degradation can be flexibly and intelligently realized by combining the overall health condition of the back-end server, and the accessed data processing request can be more finely processed.
In this embodiment, if the target split ratio is not stored in the preset shared memory before, the server may send and store the matched target split ratio in the preset shared memory, so as to establish a new target split ratio in the preset shared memory. If the preset shared memory already stores the target shunt ratio, the server may update the existing target shunt ratio stored in the preset shared memory according to the matched target shunt ratio.
In an embodiment, after sending the data processing request to a preset disaster recovery processing module corresponding to the backend service for corresponding processing, when the method is implemented, the method may further include the following steps: a built-in preset copying module is called to copy the data processing request to obtain a simulation request; and sending the simulation request to a back-end server corresponding to the back-end service for testing so as to trigger the collection of state parameters of the back-end server and generate a corresponding state log of the back-end service.
In one embodiment, the state parameter may specifically include an average value of (back-end server) response time.
In an embodiment, when the switch state of the disaster recovery processing mode is the on state, the situation of shunting the data processing request to the corresponding back-end server is reduced or stopped, and in order to know the recovery situation of the back-end server in time, the above method may be further adopted to generate a corresponding simulation request according to the real data processing request, and send the simulation request to the back-end server for state testing, so as to simulate the scene of the back-end server when processing the data processing request in the current recovery situation more truly. Therefore, the state parameters with relatively higher reference value can be acquired to generate the state log of the back-end service, and the on-off state of the current disaster recovery processing mode can be accurately judged subsequently according to the state parameters recorded by the state log of the back-end service.
In an embodiment, the preset copy module may specifically include: ngx _ http _ mirror _ module.
In one embodiment, when implemented, the server may generate a mirror request of the data processing request as the simulation request by calling ngx _ http _ mirror _ module.
In the embodiment, by using the ngx _ http _ mirror _ module to generate the simulation request, other third-party modules are not required to be additionally introduced, and time and resources are not required to be consumed for monitoring and managing the additionally introduced third-party modules. Thereby reducing the processing cost and improving the overall processing efficiency.
In an embodiment, the invoking of the built-in preset copy module copies the data processing request to obtain the simulation request, and the specific implementation may include the following: detecting the type of the data processing request; wherein the types of the data processing requests comprise user requests and crawler requests; and under the condition that the data processing request is determined to be a user request, calling a built-in preset copying module to copy the data processing request to obtain a simulation request.
In this embodiment, in specific implementation, whether the data processing request carries a preset tag field may be detected to determine whether the data processing request is a crawler request.
In this embodiment, through the above manner, the crawler request and the user request can be distinguished, and only the user request which is concerned more is copied to generate the simulation request to be sent to the back-end server, so that the state test of the back-end server is more targeted, and the subsequently acquired state log of the back-end service has a higher reference value. By the method, the processing pressure of the back-end server can be reduced, the interference of the non-real user request on problem positioning is reduced, and the processing efficiency is improved.
In one embodiment, when the switching state of the current disaster recovery processing mode is the on state, and the server shunts the received data processing request according to the target shunting proportion, the server may also obtain a corresponding state log of the backend service at regular time according to a preset disaster recovery service list at every preset time interval; according to the state log of the back-end service, counting an abnormal proportion parameter of the back-end service; and determining the switch state of the disaster recovery processing mode according to the abnormal proportion parameter of the back-end service and a preset disaster recovery rule.
Specifically, for example, when the server compares the latest abnormal proportion parameter of the backend service with a preset abnormal proportion threshold according to a preset disaster tolerance rule, it finds that the abnormal proportion parameter is smaller than the preset abnormal proportion threshold, and may determine that the switching state of the disaster tolerance processing mode is the off state. And then, a closing identifier for indicating the closing state can be generated, and the switch identifier stored in the preset shared memory is updated according to the closing identifier, so that the switch state of the current disaster recovery processing mode is updated to the closing state.
As can be seen from the above, in the data processing method provided in the embodiments of the present specification, after receiving a data processing request carrying a URL address parameter related to a backend service, a server queries a switch state of a current disaster recovery processing mode, and when determining that the switch state is an on state, may query a preset shared memory to obtain a target split ratio matched with the URL address parameter, where the target split ratio is updated at regular time; the server may shunt the data processing request to the backend server according to the target shunting proportion, or perform corresponding processing by using a preset disaster recovery processing module, which corresponds to the backend service and stores static service data related to the backend service in advance. Therefore, under the condition that the back-end server is abnormal, the data processing request can be intelligently and reasonably shunted, the preset disaster recovery processing module and the back-end server can be used for responding to the data processing request, corresponding data processing is completed, and the use experience of a user is improved. The method solves the technical problems that the existing method is not fine in processing the data processing request under the condition that the back-end server is abnormal, and the use experience of a user is influenced. The data processing request is sent to a preset disaster recovery processing module corresponding to the back-end service for corresponding processing, and then a built-in preset copying module is called to copy the data processing request to obtain a simulation request; sending the simulation request to a back-end server corresponding to the back-end service for testing so as to trigger and acquire state parameters of the back-end server and generate a corresponding state log of the back-end service; and then, the latest health condition of the back-end server can be timely and accurately determined according to the state log of the back-end service acquired at regular time, so that the on-off state and the target shunt ratio of the disaster recovery processing mode can be intelligently adjusted, and the processing effect is improved.
Embodiments of the present specification further provide a server, including a processor and a memory for storing processor-executable instructions, where the processor, when implemented, may perform the following steps according to the instructions: receiving a data processing request sent by terminal equipment; the data processing request carries URL address parameters related to the requested back-end service; inquiring the switch state of the current disaster recovery processing mode; under the condition that the on-off state of the current disaster recovery processing mode is an on state, inquiring a preset shared memory to obtain a target distribution ratio matched with the URL address parameter; the target shunting proportion is updated regularly according to an abnormal proportion parameter of a back-end service; according to the target distribution proportion, the data processing request is sent to a back-end server corresponding to the back-end service, or a preset disaster tolerance processing module corresponding to the back-end service carries out corresponding processing to obtain a corresponding processing result; the preset disaster tolerance processing module stores static business data related to the back-end service in advance; and sending the processing result to the terminal equipment.
In order to more accurately complete the above instructions, referring to fig. 3, another specific server is provided in the embodiments of the present specification, wherein the server includes a network communication port 301, a processor 302, and a memory 303, and the above structures are connected by an internal cable, so that the structures may perform specific data interaction.
The network communication port 301 may be specifically configured to receive a data processing request sent by a terminal device; wherein the data processing request carries a URL address parameter associated with the requested backend service.
The processor 302 may be specifically configured to query a switch state of a current disaster recovery processing mode; under the condition that the on-off state of the current disaster recovery processing mode is an on state, inquiring a preset shared memory to obtain a target distribution ratio matched with the URL address parameter; the target shunting proportion is updated regularly according to an abnormal proportion parameter of a back-end service; according to the target distribution proportion, the data processing request is sent to a back-end server corresponding to the back-end service, or a preset disaster tolerance processing module corresponding to the back-end service carries out corresponding processing to obtain a corresponding processing result; the preset disaster tolerance processing module stores static business data related to the back-end service in advance; and sending the processing result to the terminal equipment.
The memory 303 may be specifically configured to store a corresponding instruction program.
In this embodiment, the network communication port 301 may be a virtual port that is bound to different communication protocols, so that different data can be sent or received. For example, the network communication port may be a port responsible for web data communication, a port responsible for FTP data communication, or a port responsible for mail data communication. In addition, the network communication port can also be a communication interface or a communication chip of an entity. For example, it may be a wireless mobile network communication chip, such as GSM, CDMA, etc.; it can also be a Wifi chip; it may also be a bluetooth chip.
In this embodiment, the processor 302 may be implemented in any suitable manner. For example, the processor may take the form of, for example, a microprocessor or processor and a computer-readable medium that stores computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, an embedded microcontroller, and so forth. The description is not intended to be limiting.
In this embodiment, the memory 303 may include multiple layers, and in a digital system, the memory may be any memory as long as binary data can be stored; in an integrated circuit, a circuit without a physical form and with a storage function is also called a memory, such as a RAM, a FIFO and the like; in the system, the storage device in physical form is also called a memory, such as a memory bank, a TF card and the like.
The present specification further provides a computer storage medium based on the above data processing method, where the computer storage medium stores computer program instructions, and when the computer program instructions are executed, the computer storage medium implements: receiving a data processing request sent by terminal equipment; the data processing request carries URL address parameters related to the requested back-end service; inquiring the switch state of the current disaster recovery processing mode; under the condition that the on-off state of the current disaster recovery processing mode is an on state, inquiring a preset shared memory to obtain a target distribution ratio matched with the URL address parameter; the target shunting proportion is updated regularly according to an abnormal proportion parameter of a back-end service; according to the target distribution proportion, the data processing request is sent to a back-end server corresponding to the back-end service, or a preset disaster tolerance processing module corresponding to the back-end service carries out corresponding processing to obtain a corresponding processing result; the preset disaster tolerance processing module stores static business data related to the back-end service in advance; and sending the processing result to the terminal equipment.
In this embodiment, the storage medium includes, but is not limited to, a Random Access Memory (RAM), a Read-Only Memory (ROM), a Cache (Cache), a Hard Disk Drive (HDD), or a Memory Card (Memory Card). The memory may be used to store computer program instructions. The network communication unit may be an interface for performing network connection communication, which is set in accordance with a standard prescribed by a communication protocol.
In this embodiment, the functions and effects specifically realized by the program instructions stored in the computer storage medium can be explained by comparing with other embodiments, and are not described herein again.
Referring to fig. 4, in terms of software, the embodiment of the present specification further provides a data processing apparatus, which may specifically include the following structural modules.
A receiving module 401, which may be specifically configured to receive a data processing request sent by a terminal device; the data processing request carries URL address parameters related to the requested back-end service;
a first query module 402, which may be specifically configured to query a switch state of a current disaster recovery processing mode;
the second query module 403 is specifically configured to query a preset shared memory to obtain a target split ratio matched with the URL address parameter when the on-off state of the current disaster recovery processing mode is a turned-on state; the target shunting proportion is updated regularly according to an abnormal proportion parameter of a back-end service;
the processing module 404 may be specifically configured to send the data processing request to a backend server corresponding to the backend service according to the target splitting ratio, or perform corresponding processing on a preset disaster tolerance processing module corresponding to the backend service to obtain a corresponding processing result; the preset disaster tolerance processing module stores static business data related to the back-end service in advance;
the feedback module 405 may be specifically configured to send the processing result to the terminal device.
It should be noted that, the units, devices, modules, etc. illustrated in the above embodiments may be implemented by a computer chip or an entity, or implemented by a product with certain functions. For convenience of description, the above devices are described as being divided into various modules by functions, and are described separately. It is to be understood that, in implementing the present specification, functions of each module may be implemented in one or more pieces of software and/or hardware, or a module that implements the same function may be implemented by a combination of a plurality of sub-modules or sub-units, or the like. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
As can be seen from the above, the data processing apparatus provided in the embodiments of the present specification can intelligently and reasonably shunt the data processing request when the backend server is abnormal, and can finely utilize the preset disaster recovery processing module and the backend server to respond to the data processing request, complete corresponding data processing, and improve the user experience.
In a specific scenario example, the data processing method provided in this specification may be applied to perform disaster recovery processing on a user request.
Specifically, a static disaster recovery intelligent management system is established in the present scenario example. As shown in fig. 5, the system includes four modules, which are a reverse proxy module, a management analysis module, a log analysis module, and a disaster recovery cache module.
The reverse proxy module is responsible for distributing user requests (e.g., data processing requests) and determining whether to send the user requests to a back-end server or to a static disaster recovery system.
Referring to fig. 6, when an access user requests (e.g., a data processing request), the process flow when the reverse proxy module is applied may include the following:
1. judging the switch state of a static disaster recovery system (for example, the switch state of a disaster recovery processing mode, which may be referred to as a disaster recovery switch for short);
2. if the switch state is 'on' and the user requests that the URL has configured the disaster tolerance state, determining to provide disaster tolerance service; according to the parameters, a part of requests can be proxied to a disaster tolerance cache module (for example, a preset disaster tolerance processing module) for processing;
3. if the switch state is 'on' but the user request URL is not configured with the disaster tolerance state, the reverse proxy is processed in the back-end server;
4. if the switch state is 'off', but the back-end server returns a return result such as a 5xx error, a part of requests can be reversely proxied to the disaster recovery cache module according to the parameters;
5. if the switch state is 'off' and the back-end server returns a normal result, the result can be returned to the user.
The management analysis module may be specifically understood as a core module for implementing static disaster tolerance intelligent management, and the management analysis module updates a proportion parameter (for example, a target distribution proportion) of the disaster tolerance service in a timing task manner to implement a service degradation/recovery function.
Referring to fig. 7, the processing flow when the management analysis module is applied may include the following steps when the process is started:
1. reading a disaster tolerance resource list, namely a disaster tolerance URL service list (for example, a preset disaster tolerance service list), and processing one by one;
2. obtaining abnormal proportion data through a log analysis system, specifically obtaining abnormal (such as slow response or error response) percentage data (such as abnormal proportion parameters of backend services) corresponding to the URL service;
3. sending a request to modify the Nginx shared memory in the reverse proxy module, and introducing abnormal percentage data as a parameter, for example, p is 30, which represents that 30% of the services are abnormal, and 30% of the requests need to be reversely proxied to the disaster recovery system. So that the reverse proxy module parameters can be updated.
Ending data processing until the list processing is determined to be finished; and if the list is not processed, continuously acquiring abnormal proportion data.
In practical application, configuring an abnormal upper limit threshold and an abnormal lower limit threshold according to actual service requirements, considering that the back-end service is normal when the abnormal percentage data is lower than the lower limit threshold (for example, 5%), and closing the static disaster recovery processing; when the anomaly percentage is higher than the upper threshold (for example, 80%), the back-end service is considered to be incapable of providing a response, and all user requests are sent to the static disaster recovery system for processing.
The log analysis module is used for performing unified collection, centralized management and analysis on access logs (for example, status logs of a backend service), and is used for monitoring the real-time status of the URL service, such as an average value of response time (a status parameter), tp90, tp99, and the like. In particular, tp99 is typically used to embody the response capabilities of the service, i.e. 99% of requests can get responses within this point in time, for example.
The disaster recovery cache module is used for storing cache data, and when a user requests to enter the disaster recovery cache module, the abnormal state exists in the back-end service, and the static disaster recovery system is in the open state.
In order to maintain real traffic of the backend service and facilitate positioning and problem handling of research and development teams, a copy of a user request needs to be made and sent back to the backend service, and in practical applications, in order to reduce the number of maintenance components, an ngx _ http _ mirror _ module (e.g., a built-in preset copy module) of Nginx may be used, and the high fidelity simulation of the user request may be implemented through simple configuration.
Note that the request entering the disaster recovery caching module includes a client request (e.g., a user request) and a crawler request, and only the client request needs to be copied and sent to the backend service, so that a certain method needs to be adopted to distinguish the two requests.
The configuration of the ngx _ http _ mirror _ module can be divided into two parts, namely source address configuration and mirror address configuration, and the setting of the key configuration can be referred to as the following.
Source address configuration:
Figure BDA0002812860780000171
mirror image address configuration:
Figure BDA0002812860780000172
in addition, in this scenario example, the relevant software used in the implementation can be referred to as table 1.
TABLE 1
Operating system CentOS 7.4
Web server Nginx 1.13.4
Lua just-in-time compiler LuaJIT-2.1.0-beta3
Nginx three-party module lua-nginx-module
Nginx module ngx_http_mirror_module
Through the scene example, the static disaster recovery intelligent management system constructed based on the data processing method provided by the specification is verified, a uniform and intelligent static disaster recovery management scheme can be provided, and two key problems of service degradation and recovery are solved. Specifically, firstly, the module composition and sub-module responsibilities of the static disaster recovery intelligent management system are as follows: the static disaster recovery intelligent management system provided by the scheme is divided into 4 system modules with clear responsibility, high cohesion and low coupling, and the static disaster recovery system management scheme with intelligent degradation and recovery is realized. Secondly, after static disaster tolerance is switched, a scheme for maintaining the truthfulness and credibility of service health monitoring is adopted: according to the scheme, the request mirror image replication is realized based on the Nginx module, on the premise that the complexity of system composition is not increased, the high-fidelity replication of a user request is realized, the back-end service flow is maintained, and the health monitoring after static disaster tolerance is switched is still real and credible. In addition, the technical scheme for realizing service degradation/recovery is refined: the scheme is based on the abnormal service percentage, combines the upper limit threshold value and the lower limit threshold value of the service, regularly updates the Nginx shared memory parameters, realizes service degradation and recovery on the user request quantity level, and provides a solution for finely managing the static disaster recovery system.
Although the present specification provides method steps as described in the examples or flowcharts, additional or fewer steps may be included based on conventional or non-inventive means. The order of steps recited in the embodiments is merely one manner of performing the steps in a multitude of orders and does not represent the only order of execution. When an apparatus or client product in practice executes, it may execute sequentially or in parallel (e.g., in a parallel processor or multithreaded processing environment, or even in a distributed data processing environment) according to the embodiments or methods shown in the figures. The terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, the presence of additional identical or equivalent elements in a process, method, article, or apparatus that comprises the recited elements is not excluded. The terms first, second, etc. are used to denote names, but not any particular order.
Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may therefore be considered as a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
This description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, classes, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
From the above description of the embodiments, it is clear to those skilled in the art that the present specification can be implemented by software plus necessary general hardware platform. With this understanding, the technical solutions in the present specification may be essentially embodied in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which may be a personal computer, a mobile terminal, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments in the present specification.
The embodiments in the present specification are described in a progressive manner, and the same or similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. The description is operational with numerous general purpose or special purpose computing system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like.
While the specification has been described with examples, those skilled in the art will appreciate that there are numerous variations and permutations of the specification that do not depart from the spirit of the specification, and it is intended that the appended claims include such variations and modifications that do not depart from the spirit of the specification.

Claims (15)

1. A data processing method, comprising:
receiving a data processing request sent by terminal equipment; the data processing request carries URL address parameters related to the requested back-end service;
inquiring the switch state of the current disaster recovery processing mode;
under the condition that the on-off state of the current disaster recovery processing mode is an on state, inquiring a preset shared memory to obtain a target distribution ratio matched with the URL address parameter; the target shunting proportion is updated regularly according to an abnormal proportion parameter of a back-end service;
according to the target distribution proportion, the data processing request is sent to a back-end server corresponding to the back-end service, or a preset disaster tolerance processing module corresponding to the back-end service carries out corresponding processing to obtain a corresponding processing result; the preset disaster tolerance processing module stores static business data related to the back-end service in advance;
and sending the processing result to the terminal equipment.
2. The method according to claim 1, wherein after querying the switch status of the current disaster recovery processing mode, the method further comprises:
and sending the data processing request to a back-end server corresponding to the back-end service for corresponding processing under the condition that the on-off state of the current disaster recovery processing mode is the off state.
3. The method according to claim 2, wherein after sending the data processing request to a backend server corresponding to the backend service for respective processing, the method further comprises:
detecting whether error information aiming at the data processing request fed back by a back-end server is received or not;
and under the condition that the error reporting information fed back by the back-end server is determined to be received, sending the data processing request to a preset disaster recovery processing module for corresponding processing.
4. The method of claim 1, wherein the predetermined shared memory comprises a Nginx shared memory.
5. The method of claim 2, further comprising:
the method comprises the steps of obtaining a corresponding state log of a back-end service at regular intervals according to a preset disaster tolerance service list at preset time intervals;
according to the state log of the back-end service, counting an abnormal proportion parameter of the back-end service;
and determining the switch state of the disaster tolerance processing mode according to the abnormal proportion parameter of the back-end service and a preset disaster tolerance rule.
6. The method of claim 5, further comprising:
generating a switch identifier for indicating the opening state under the condition that the switch state of the disaster recovery processing mode is determined to be the opening state; or, under the condition that the switch state of the disaster recovery processing mode is determined to be the closed state, generating a switch identifier for indicating the closed state;
storing the switch identifier in a preset shared memory; or, updating the switch identifier in the preset shared memory.
7. The method according to claim 6, wherein said querying a switch status of a current disaster recovery processing mode comprises:
inquiring the preset shared memory to obtain the current switch identifier;
and determining the switch state of the current disaster recovery processing mode according to the current switch identifier.
8. The method according to claim 6, wherein after the switch identifier indicating the on state is generated in a case where the switch state of the disaster recovery processing mode is determined to be the on state, the method further comprises:
generating a matched target distribution ratio according to the abnormal ratio parameter of the back-end service and a preset disaster tolerance rule;
storing the matched target shunt ratio in a preset shared memory; or updating the target shunt ratio in the preset shared memory according to the matched target shunt ratio.
9. The method according to claim 1, wherein after sending the data processing request to a preset disaster recovery processing module corresponding to the backend service for corresponding processing, the method further comprises:
a built-in preset copying module is called to copy the data processing request to obtain a simulation request;
and sending the simulation request to a back-end server corresponding to the back-end service for testing so as to trigger the collection of state parameters of the back-end server and generate a corresponding state log of the back-end service.
10. The method of claim 9, wherein the state parameter comprises an average of response times.
11. The method of claim 9, wherein the built-in pre-defined copy module comprises: ngx _ http _ mirror _ module.
12. The method of claim 9, wherein the invoking of the built-in pre-defined copy module copies the data processing request to obtain a simulation request, comprising:
detecting the type of the data processing request; wherein the types of the data processing requests comprise user requests and crawler requests;
and under the condition that the data processing request is determined to be a user request, calling a built-in preset copying module to copy the data processing request to obtain a simulation request.
13. A data processing apparatus, comprising:
the receiving module is used for receiving a data processing request sent by the terminal equipment; the data processing request carries URL address parameters related to the requested back-end service;
the first query module is used for querying the switch state of the current disaster recovery processing mode;
the second query module is used for querying a preset shared memory to obtain a target shunt ratio matched with the URL address parameter when the on-off state of the current disaster recovery processing mode is queried to be the on state; the target shunting proportion is updated regularly according to an abnormal proportion parameter of a back-end service;
the processing module is used for sending the data processing request to a back-end server corresponding to the back-end service according to the target distribution ratio, or correspondingly processing a preset disaster tolerance processing module corresponding to the back-end service to obtain a corresponding processing result; the preset disaster tolerance processing module stores static business data related to the back-end service in advance;
and the feedback module is used for sending the processing result to the terminal equipment.
14. A server comprising a processor and a memory for storing processor-executable instructions which, when executed by the processor, implement the steps of the method of any one of claims 1 to 12.
15. A computer-readable storage medium having stored thereon computer instructions which, when executed, implement the steps of the method of any one of claims 1 to 12.
CN202011391170.9A 2020-12-02 2020-12-02 Data processing method and device and server Pending CN112433891A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011391170.9A CN112433891A (en) 2020-12-02 2020-12-02 Data processing method and device and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011391170.9A CN112433891A (en) 2020-12-02 2020-12-02 Data processing method and device and server

Publications (1)

Publication Number Publication Date
CN112433891A true CN112433891A (en) 2021-03-02

Family

ID=74697623

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011391170.9A Pending CN112433891A (en) 2020-12-02 2020-12-02 Data processing method and device and server

Country Status (1)

Country Link
CN (1) CN112433891A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114285639A (en) * 2021-12-24 2022-04-05 云盾智慧安全科技有限公司 Website security protection method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114285639A (en) * 2021-12-24 2022-04-05 云盾智慧安全科技有限公司 Website security protection method and device
CN114285639B (en) * 2021-12-24 2023-11-24 云盾智慧安全科技有限公司 Website safety protection method and device

Similar Documents

Publication Publication Date Title
CN109073350B (en) Predictive summary and caching of application performance data
US10747592B2 (en) Router management by an event stream processing cluster manager
US10257115B2 (en) Cloud-based service resource provisioning based on network characteristics
US8447757B1 (en) Latency reduction techniques for partitioned processing
CN107480277B (en) Method and device for collecting website logs
CN108696400A (en) network monitoring method and device
CN115277566B (en) Load balancing method and device for data access, computer equipment and medium
CN108228322B (en) Distributed link tracking and analyzing method, server and global scheduler
US10642585B1 (en) Enhancing API service schemes
US20220229657A1 (en) Extensible resource compliance management
CN114363144B (en) Fault information association reporting method and related equipment for distributed system
CN112130996A (en) Data monitoring control system, method and device, electronic equipment and storage medium
EP2634699B1 (en) Application monitoring
CN114185734B (en) Method and device for monitoring clusters and electronic equipment
CN112433891A (en) Data processing method and device and server
CN111316691B (en) Caching and providing data to devices based on available resources
US11777810B2 (en) Status sharing in a resilience framework
CN110071952B (en) Service call quantity control method and device
US9639582B2 (en) Intelligent mapping for an enterprise grid
CN113553074B (en) Applet distribution control method, device, electronic equipment and storage medium
CN115202973A (en) Application running state determining method and device, electronic equipment and medium
CN103095786A (en) Online business request identification method and system and server and online sever cluster
CN113778780A (en) Application stability determination method and device, electronic equipment and storage medium
US20200057761A1 (en) Adaptive metadata refreshing
US20190272190A1 (en) Dynamically configurable operation information collection

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