CN112437148B - Service request processing method and device, service server and system - Google Patents
Service request processing method and device, service server and system Download PDFInfo
- Publication number
- CN112437148B CN112437148B CN202011307241.2A CN202011307241A CN112437148B CN 112437148 B CN112437148 B CN 112437148B CN 202011307241 A CN202011307241 A CN 202011307241A CN 112437148 B CN112437148 B CN 112437148B
- Authority
- CN
- China
- Prior art keywords
- target
- data
- service
- server
- target page
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/24—Traffic characterised by specific attributes, e.g. priority or QoS
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The embodiment of the invention provides a method, a device, a service server and a system for processing a service request, wherein the method comprises the following steps: receiving a service request sent by a client; if the service request does not need to be degraded, generating a target paging according to the target paging block data and returning the target paging to the client; if the service request needs to be subjected to degradation processing, determining target paging block data from block data of a target page stored in a degradation data storage server; the block data of the target page stored in the degraded data storage server is stored in the degraded data storage server after the target paging block data of the target page is obtained from the service data providing server by the reporting service server determined in advance from each service server; and generating a target paging according to the target paging block data and returning the target paging to the client. The embodiment of the invention can send more service data to the client in the service degradation processing process.
Description
Technical Field
The present invention relates to the technical field of service processing, and in particular, to a method, an apparatus, a service server, and a system for processing a service request.
Background
With the development of network technology, many business service systems have appeared, such as: and business service systems such as a television business service system and a video service system. As shown in fig. 1, a client 100 implements a business service by interacting with a business service system 200.
Specifically, the service system 200 receives a service request sent by the client 100, performs normal service processing according to a corresponding service flow based on the service request, and returns a processing result to the client 100. When the business service system 200 is in a high load or a business processing failure, in order to ensure that the core services (e.g., ordering, paying) can operate normally, a service degradation process is usually performed on some non-core services (e.g., a user searches some cold videos in the video APP).
In the prior art, the service degradation processing method is as follows: after receiving the service request sent by the client 100, normal service processing is no longer performed according to the corresponding service flow, and since there is usually more data in one page and complete data cannot be displayed in the screen of the terminal, the data of the page may be displayed in pages, and the first page data in the page data corresponding to the service request stored in advance in the normal service processing process may be returned to the client 100 as the current service processing result. In this case, the user cannot refresh the second page data and the data thereafter.
Therefore, in the prior art, in the service degradation processing process, the data returned to the client is less, so that the data displayed to the user by the client is less, and the user experience is poor.
Disclosure of Invention
The embodiment of the invention aims to provide a method, a device, a service server and a system for processing a service request, so as to send more service data to a client in the service degradation processing process. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a method for processing a service request, which is applied to any service server in a service system, where the service server is in communication connection with a service data providing server and a degraded data storage server; the method comprises the following steps:
receiving a service request sent by a client;
if the service request does not need to be degraded, obtaining target paging block data of a target page corresponding to the service request according to a service processing flow corresponding to the service request and based on complete data of the target page provided by the service data providing server;
generating a target paging according to the target paging block data and returning the target paging to the client;
if the service request needs to be degraded, determining target paging block data from the block data of the target page stored in the degraded data storage server; the block data of the target page stored in the degraded data storage server is stored in the degraded data storage server after the target paging block data of the target page is obtained from the service data providing server by a reporting service server which is determined in advance from each service server and is used for reporting the degraded data;
and generating a target paging according to the target paging block data and returning the target paging to the client.
Optionally, the service request includes a target page identifier and a target paging identifier;
before the step of obtaining the target paging block data of the target page corresponding to the service request based on the complete data of the target page provided by the service data providing server according to the service processing flow corresponding to the service request if the service request does not need to be subjected to degradation processing, the method further includes:
acquiring a preset target page template corresponding to the service request based on the target page identifier; the target page template comprises block identifications of all block data of the target page and the arrangement sequence of each block identification in the target page;
determining a target block identifier corresponding to the service request and an arrangement sequence of each target block identifier in a target page based on a target page template, the target page identifier and a preset number of blocks contained in each page;
the step of generating a target page and returning the target page to the client according to the target page block data includes:
and generating target pages from the target page block data according to the arrangement sequence of the target block identifiers in the target pages, and returning the target pages to the client.
Optionally, the degraded data storage server stores a corresponding relationship between the block data and the block identifier; the step of determining target paged block data from the block data of the target page stored in the degraded data storage server includes:
and obtaining target paging block data corresponding to the target block identification from the block data of the target page according to the corresponding relation.
Optionally, the step of obtaining, according to the service processing flow corresponding to the service request, target paging block data of the target page corresponding to the service request based on the complete data of the target page provided by the service data providing server includes:
acquiring preset configuration information corresponding to each target block identifier; the preset configuration information includes: block data information;
and obtaining data corresponding to the block data information from the complete data of the target page provided by the service data providing server, and generating target paging block data.
Optionally, the service request further includes: a client version identification;
the step of obtaining a preset target page template corresponding to the service request based on the target page identifier comprises:
and acquiring a preset target page template corresponding to the service request and corresponding to the client version identification.
Optionally, the block data of the target page saved in the degraded data storage server is stored in a key-value pair form; wherein the key is obtained by combining the target page identifier, the block identifier and the client version identifier, and the value is the block data.
Optionally, if any of the service servers is: and if the reporting service server for reporting the degraded data is determined in advance from each service server, the any service server obtains the data corresponding to the block data information from the complete data of the target page provided by the service data providing server, and further stores the obtained target paging block data into the degraded data storage server after the step of generating the target paging block data.
Optionally, the service system further includes: coordinating server ZooKeeper;
the method further comprises the following steps:
the method comprises the following steps that whether any service server is a reporting service server or not is determined through the following steps:
the service server regularly inquires whether the temporary node is successfully registered by the service server in the ZooKeeper, if so, the successfully registered service server is used as a reporting service server for reporting degraded data; if not, the service server registers the temporary node and serves as a reporting service server for reporting the degraded data under the condition of successful registration.
In a second aspect, an embodiment of the present invention provides a device for processing a service request, which is applied to any service server in a service system, where the service server is in communication connection with a service data providing server and a degraded data storage server; the device comprises:
the service request receiving module is used for receiving a service request sent by a client;
a first target paging block data obtaining module, configured to, if degradation processing is not required to be performed on the service request, obtain target paging block data of a target page corresponding to the service request according to a service processing flow corresponding to the service request based on complete data of the target page provided by the service data providing server;
the first target paging generation module is used for generating a target paging according to the target paging block data and returning the target paging to the client;
a second target paging block data obtaining module, configured to determine target paging block data from block data of a target page stored in the degraded data storage server if the service request needs to be subjected to degradation processing; the block data of the target page stored in the degraded data storage server is stored in the degraded data storage server after the target paging block data of the target page is obtained from the service data providing server by a reporting service server which is determined in advance from each service server and is used for reporting the degraded data;
and the second target paging generation module is used for generating target paging according to the target paging block data and returning the target paging to the client.
Optionally, the service request includes a target page identifier and a target paging identifier;
the device further comprises:
a target page template obtaining module, configured to obtain a preset target page template corresponding to the service request based on the target page identifier; the target page template comprises block identifications of all block data of the target page and the arrangement sequence of each block identification in the target page;
a target block identifier determining module, configured to determine, based on a target page template, the target page identifier, and a preset number of blocks included in each page, a target block identifier corresponding to the service request, and an arrangement order of each target block identifier in a target page;
the first target page generation module is specifically configured to:
and generating target paging from the target paging block data according to the arrangement sequence of the target block identifiers in the target paging, and returning the target paging to the client.
Optionally, the degraded data storage server stores a corresponding relationship between the block data and the block identifier; the second target paging block data obtaining module is specifically configured to:
and obtaining target paging block data corresponding to the target block identification from the block data of the target page according to the corresponding relation.
Optionally, the first target paging block data obtaining module includes:
the preset configuration information acquisition submodule is used for acquiring preset configuration information corresponding to each target block identifier; the preset configuration information includes: block data information;
and the target paging block data generation submodule is used for acquiring data corresponding to the block data information from the complete data of the target page provided by the service data providing server and generating target paging block data.
Optionally, the service request further includes: a client version identification;
the target page template obtaining module is specifically configured to:
and acquiring a preset target page template corresponding to the service request and corresponding to the client version identification.
Optionally, the block data of the target page saved in the degraded data storage server is stored in a key-value pair form; wherein the key is obtained by combining the target page identifier, the block identifier and the client version identifier, and the value is the block data.
Optionally, the apparatus further comprises: a target paging block data storage module;
if any service server is: and if a reporting service server for reporting degraded data is determined in advance from each service server, the target paging block data storage module of any service server performs the steps of obtaining data corresponding to the block data information from the complete data of the target page provided by the service data providing server in the target paging block data generation submodule, and generating target paging block data, and then further storing the obtained target paging block data into the degraded data storage server.
Optionally, the service system further includes: coordinating server ZooKeeper;
the device further comprises:
a timing query module, configured to query, by the service server, whether the temporary node is successfully registered by the service server in the ZooKeeper at a timing, and if so, use the successfully registered service server as a reporting service server for reporting degraded data; if not, the service server registers the temporary node and serves as a reporting service server for reporting the degraded data under the condition of successful registration.
The embodiment of the invention also provides a business server, which comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus;
a memory for storing a computer program;
and a processor for implementing the steps of the service request processing method when executing the program stored in the memory.
In another aspect of the present invention, there is also provided a business service system, including: the system comprises a plurality of service servers, service data providing servers and degraded data storage servers, wherein the service servers are in communication connection with the service data providing servers and the degraded data storage servers;
the service server is used for receiving a service request sent by the client; if the service request does not need to be degraded, obtaining target paging block data of a target page corresponding to the service request according to a service processing flow corresponding to the service request and based on complete data of the target page provided by the service data providing server; generating a target paging according to the target paging block data and returning the target paging to the client;
the service data providing server is used for providing complete data of a target page for the service server if the service request does not need to be subjected to degradation processing;
the service server is further configured to determine target paging block data from block data of a target page stored in the degraded data storage server if the service request needs to be subjected to degradation processing; the block data of the target page stored in the degraded data storage server is stored in the degraded data storage server after the target paging block data of the target page is obtained from the service data providing server by a reporting service server which is determined in advance from each service server and is used for reporting the degraded data; generating a target paging according to the target paging block data and returning the target paging to the client;
the degraded data storage server is used for receiving block data of a target page sent by a reporting service server which is determined in advance from each service server and used for reporting the degraded data, and sending the target paging block data of the target page to the service server if the service request needs to be subjected to degradation processing.
Optionally, the service request includes a target page identifier and a target paging identifier;
the service server is further configured to:
acquiring a preset target page template corresponding to the service request based on the target page identifier; the target page template comprises block identifications of all block data of the target page and the arrangement sequence of each block identification in the target page;
determining a target block identifier corresponding to the service request and an arrangement sequence of each target block identifier in a target page based on a target page template, the target page identifier and a preset block number contained in each page;
and generating target pages from the target page block data according to the arrangement sequence of the target block identifiers in the target pages, and returning the target pages to the client.
Optionally, the degraded data storage server stores a corresponding relationship between the block data and the block identifier; when the step of determining target paging block data from the block data of the target page stored in the degraded data storage server is executed, the service server is specifically configured to:
and obtaining target paging block data corresponding to the target block identification from the block data of the target page according to the corresponding relation.
Optionally, when the step of obtaining the target paging block data of the target page corresponding to the service request based on the complete data of the target page provided by the service data providing server according to the service processing flow corresponding to the service request is executed by the service server, the service server is specifically configured to:
acquiring preset configuration information corresponding to each target block identifier; the preset configuration information includes: block data information;
and obtaining data corresponding to the block data information from the complete data of the target page provided by the service data providing server, and generating target paging block data.
Optionally, the service request further includes: a client version identification;
the service server, when executing the step of obtaining a preset target page template corresponding to the service request based on the target page identifier, is specifically configured to:
and acquiring a preset target page template corresponding to the service request and corresponding to the client version identification.
Optionally, the block data of the target page saved in the degraded data storage server is stored in a key-value pair form; wherein the key is obtained by combining the target page identifier, the block identifier and the client version identifier, and the value is the block data.
Optionally, if the service server is: the reporting service server for reporting degraded data, which is determined in advance from each service server, is further specifically configured to, after the service server executes the steps of obtaining data corresponding to the block data information from the complete data of the target page provided by the service data providing server, and generating target paging block data: and storing the obtained target paging block data into the degraded data storage server.
Optionally, the business service system further includes: a coordination server ZooKeeper;
the service server is further configured to query the ZooKeeper at regular time whether the temporary node is successfully registered by the service server, and if so, the successfully registered service server is used as a reporting service server for reporting degraded data; if not, the service server registers the temporary node and serves as a reporting service server for reporting the degraded data under the condition of successful registration.
In yet another aspect of the present invention, there is also provided a computer-readable storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements any one of the service request processing methods described above.
In yet another aspect of the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform any of the above-mentioned methods for processing a service request.
The service request processing method, the service request processing device, the service server, the service system and the storage medium provided by the embodiment of the invention receive the service request sent by the client, and if the service request does not need to be subjected to degradation processing, the target paging block data of the target page corresponding to the service request is obtained based on the complete data of the target page provided by the service data providing server according to the service processing flow corresponding to the service request; and generating a target paging according to the target paging block data and returning the target paging to the client. And if the service request needs to be subjected to degradation processing, determining target paging block data from block data of a target page stored in a degraded data storage server, and generating a target page according to the target paging block data and returning the target page to the client. In the embodiment of the invention, the block data of the target page is stored in the degraded data storage server, when the service request needs to be subjected to degradation processing, the service server can obtain the target paging block data of the target page from the degraded data storage server and generate the target paging of the target paging block data to return to the client, so that the target paging of the target page is generated by the target paging block data determined from the block data of the target page and is sent to the client, the second page data of the target page and the data behind the second page data can be refreshed, more service data are provided for the client, and the user experience is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
FIG. 1 is a schematic diagram of a scenario for implementing a business service;
fig. 2a is a schematic structural diagram of a business service system according to an embodiment of the present invention;
FIG. 2b is a schematic flowchart of a method for processing a service request applied to any service server in the service system shown in FIG. 2 a;
FIG. 2c is another schematic flow chart of a method for processing a service request applied to any service server in the service system shown in FIG. 2 a;
fig. 2d is a schematic structural diagram of a page template according to an embodiment of the present invention;
fig. 2e is a specific flow of step S220 in the method for processing the service request shown in fig. 2 c;
fig. 3a is another schematic structural diagram of a business service system provided in an embodiment of the present invention;
FIG. 3b is a schematic diagram illustrating a process of determining a reporting service server applied to the service system shown in FIG. 3 a;
fig. 4 is a schematic structural diagram of a service request processing apparatus according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a service server according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention.
As shown in fig. 1, a client 100 can implement a business service by interacting with a business service system 200. When the business service system 200 is under a high load or has a business processing failure, in order to ensure that the core services (e.g., ordering, paying) can operate normally, a service degradation process is usually performed on some non-core services (e.g., a user searches some cold videos in the video APP).
In the prior art, the service degradation processing method is as follows: after receiving the service request sent by the client 100, the first page data in the page data corresponding to the service request, which is stored in advance in the normal service processing process, is returned to the client 100 as the current service processing result, instead of performing normal service processing according to the corresponding service flow. In this case, the user cannot refresh the second page data and the data thereafter.
In view of this, the embodiment of the present invention provides a method for processing a service request, which is applied to any service server 201 in the service system 200 shown in fig. 2 a. The business service system 200 comprises a plurality of business servers 201 (1 is shown in fig. 2a for illustration only), a business data providing server 202 and a degraded data storage server 203, and each business server 201 is connected with the business data providing server 202 and the degraded data storage server 203 in a communication way.
As shown in fig. 2b, the method for processing a service request according to the embodiment of the present invention includes the following steps:
s210, receiving a service request sent by the client.
S220, if the service request does not need to be degraded, obtaining target paging block data of the target page corresponding to the service request according to a service processing flow corresponding to the service request based on the complete data of the target page provided by the service data providing server.
S230, generating a target page according to the target page block data and returning the target page to the client.
S240, if the service request needs to be degraded, determining target paging block data from block data of a target page stored in a degraded data storage server; the block data of the target page stored in the degraded data storage server is stored in the degraded data storage server after the target paging block data of the target page is obtained from the service data providing server by the reporting service server which is determined in advance from each service server and used for reporting the degraded data.
S250, generating a target paging according to the target paging block data and returning the target paging to the client.
The service request processing method provided by the embodiment of the invention receives a service request sent by a client, and if the service request does not need to be subjected to degradation processing, target paging block data of a target page corresponding to the service request is obtained based on complete data of the target page provided by a service data providing server according to a service processing flow corresponding to the service request; and generating a target paging according to the target paging block data and returning the target paging to the client. And if the service request needs to be subjected to degradation processing, determining target paging block data from block data of a target page stored in a degraded data storage server, and generating a target page according to the target paging block data and returning the target page to the client. In the embodiment of the invention, the block data of the target page is stored in the degraded data storage server, so that when the service request needs to be degraded, the service server can obtain the target paging block data of the target page from the degraded data storage server and generate the target paging from the target paging block data and return the target paging to the client, and therefore, the target paging of the target page is generated by the target paging block data determined from the block data of the target page and is sent to the client, so that the second page data of the target page and the data behind the second page data can be refreshed, that is, more service data are provided for the client, and the user experience is improved.
Further, in step S210 of the embodiment process shown in fig. 2b, the service server may receive a service request sent by the client, where the service request may be a request for a target page of the target page, for example, after the user opens the video APP, and clicks one page, the client sends the service request for the page data to the service server. The user can also slide a page on the terminal screen to send a sliding instruction, after receiving the sliding instruction of the user, the client side continues to send a service request aiming at the slid service data to the service server, and the service server can receive the service request.
Further, step S220 of the embodiment shown in fig. 2b is a process of processing according to a normal business processing flow.
The service data providing server may be a server in a service system for storing service data, where the service data may refer to complete data of each page in the video APP. For example, for a video APP including a recommended page, a drama page, a movie page, and the like, the service providing server may store complete data of each page, where the complete data may refer to all data included in the page.
Because the content contained in the page is more, the page generally needs to be displayed in multiple pages, and when a user opens a certain page, the service server can only send the first paging data of the page to the client; after the user slides the page in the display interface, the service server may send paging data continuously requested by the client to the client, where one paging data includes a plurality of block data.
If the service request does not need to be subjected to degradation processing, the target paging block data of the target page corresponding to the service request can be obtained based on the complete data of the target page provided by the service data providing server according to the service processing flow corresponding to the service request, where the target paging block data is block data in the target paging.
Further, in step S230 of the embodiment shown in fig. 2b, after obtaining the target page block data corresponding to the service request, the target page may be generated and returned to the client according to the target page block data.
Further, in step S240 of the embodiment shown in fig. 2b, in the business service system, there are usually many business servers, and a plurality of the business servers can provide a service together, that is, when the client sends a business request to the business service system, all the business servers can receive the business request and provide a target page corresponding to the business request for the client.
In order to avoid that each service server reports degraded data to the degraded data storage server and causes great pressure on the degraded data storage server, one service server can be determined in advance from a plurality of service servers as a reporting service server for reporting the degraded data. The reporting service server can obtain the block data of the target page from the service data providing server and then send the block data to the degraded data storage server for storage, so that the degraded data storage server can pre-store a copy of the block data of the target page. When the service request needs to be destaged, the service server may obtain the target paging block data of the target page from the block data of the target page stored in the destage storage server.
Further, in step S250 of the embodiment shown in fig. 2b, after the target paging block data corresponding to the service request is obtained, the target page may be generated according to the target paging block data and returned to the client.
As an optional implementation manner of the present invention, before step S220 of the embodiment flow shown in fig. 2b, the method for processing a service request provided in the embodiment of the present invention may further include:
and judging whether the service request needs to be subjected to degradation processing.
Specifically, in the service system, a configuration server may be further configured, where an identifier list of a service server that needs to perform a downgrading service at the current time is stored in the configuration server. After receiving the service request, the service server may query, in the configuration server, whether the service server identifier of the service server is in the identifier list, if so, it indicates that the service requests operated by the service server all need to be subjected to degradation processing, and if not, it indicates that the service requests operated by the service server do not need to be subjected to degradation processing.
As an optional implementation manner of the embodiment of the present invention, the service request may include: a target page identifier and a target paging identifier.
The destination page identifier may be an identifier that is set in advance for each page and used for distinguishing different pages. The target page identifier contained in the service request can enable the service server to determine the target page requested by the client through the target page identifier when receiving the service request.
The target page identifier may be an identifier of a target page corresponding to the service request obtained by calculation after the client obtains a sliding instruction input by the user in the display interface, and the target page identifier may be represented as a sequence of the target page, that is, the target page is the second page of the target page. Generally, each time the client receives a sliding instruction, it may determine that one page is requested in this time, and therefore, the target page identifier corresponding to the service request may be obtained by adding one to the page identifier in the previous service request.
As shown in fig. 2c, in step S220 of the embodiment process shown in fig. 2b, if the service request does not need to be subjected to the degradation process, before obtaining the target paging block data of the target page corresponding to the service request based on the complete data of the target page provided by the service data providing server according to the service processing process corresponding to the service request, the method for processing the service request provided in the embodiment of the present invention may further include:
and S260, acquiring a preset target page template corresponding to the service request based on the target page identifier.
Because the target page templates of different service requests may be different, the corresponding relationship between each target page identifier and the target page template may be pre-established, and after receiving the service request, the target page template corresponding to the service request may be found through the corresponding relationship.
Each page may include a plurality of block data, each block data has its corresponding block identifier, and therefore, the target page template may include the block identifiers of all the block data of the target page and the arrangement order of the block identifiers in the target page. The tile data may be a group of data having relevance or having the same category, for example, the tile data may be data displayed on the same row in a page, or the tile data may be data all belonging to a tv show or a movie.
The page template not only contains block data identifications, but also can contain the arrangement sequence of the data identifications of all blocks, and the display position of all block data in the target page can be determined according to the arrangement sequence of the data identifications of all blocks. FIG. 2d is a schematic diagram of a page template structure, in which cards can refer to blocks, and [0], [1], [2], [3] and [4] respectively represent different block data.
And S270, determining a target block identifier corresponding to the service request and an arrangement sequence of each target block identifier in the target page based on the target page template, the target page identifier and the preset block number contained in each page.
Specifically, after obtaining the target page template corresponding to the service request, the target block identifier corresponding to the service request and the arrangement order of the target block identifiers in the target page may be determined according to the target page template, the target page identifier and the preset number of blocks included in each page, where the preset number of blocks included in each page may be a preset paging logic. According to the target paging identifier, it can be determined that the target paging corresponding to the service request is the second paging in the target page, and according to the number of blocks included in each paging and the identifiers of all block data included in the target page template, it can be determined that the target block identifier of the target paging block data included in the target paging of the service request, and also can be determined the arrangement order of each target block identifier in the target paging.
For example, a target page template includes 20 blocks of data, and the block identifiers are 0, 1, 2 \8230, 823019, if the paging logic is: if each paging template contains 4 block data, if the target paging identifier corresponding to the service request is 1, the block identifiers of the block data included in the target paging are respectively 0, 1, 2 and 3; if the target page identifier corresponding to the service request is 2, the block identifiers of the block data included in the target page are 4, 5, 6, and 7, respectively, and so on.
In the embodiment shown in fig. 2b, the step S230 or S250 of the flowchart, generating the target page to be returned to the client according to the target page block data may include:
s231, generating the target paging from the target paging block data according to the arrangement sequence of the target block identifiers in the target paging, and returning the target paging to the client.
Since the target paging template includes the block identifier corresponding to the block data in the page and the arrangement order of each block identifier in the target page, after obtaining the block data of each target page in the target page, the target paging block data may be generated into the target paging return value client according to the arrangement order of each target block identifier in the target page.
In the embodiment of the present invention, a target page template corresponding to a service request may be obtained based on a target page identifier, a target block identifier corresponding to the service request and an arrangement order of each target block identifier in a target page are determined based on the target page template, the target page identifier and a preset number of blocks included in each page, and target pages are generated from the target page block data and returned to the client according to the arrangement order of each target block identifier in the target page. In the process of generating the target page, the target page identifier sent by the client is adopted, so that the generated target page is more accurate.
As an optional implementation manner of the embodiment of the present invention, a corresponding relationship between block data and a block identifier is stored in the degraded data storage server.
In step S240 of the embodiment shown in fig. 2b, the step of determining the target paged block data from the block data of the target page stored in the degraded data storage server may include:
and obtaining target paging block data corresponding to the target block identifier from the block data of the target page according to the corresponding relation between the block data and the block identifier stored in the degraded data storage server.
Since the corresponding relationship between the block data and the block identifier is stored in the degraded data storage server, the target paging block data corresponding to the target block identifier can be obtained from the block data of the target page according to the corresponding relationship between the block data and the block identifier.
As an optional implementation manner of the embodiment of the present invention, as shown in fig. 2e, in step S220 of the embodiment process shown in fig. 2b, according to the service processing process corresponding to the service request, based on the complete data of the target page provided by the service data providing server, the step of obtaining the target paging block data of the target page corresponding to the service request may include:
s221, obtaining preset configuration information corresponding to each target block identifier.
The service server may store configuration information corresponding to each block identifier in advance, where the configuration information may include: the block data information may include which data is included in the target paginated block data, the storage locations of the data, the selection rule of the picture used for displaying the block data in the display interface, and how the user responds after clicking in the block.
S222, obtaining data corresponding to the block data information from the complete data of the target page provided by the service data providing server, and generating target paging block data.
According to the block data information, data corresponding to the block data information can be obtained from complete data of a target page provided in the service data providing server, and target paging block data can be generated.
In the embodiment of the present invention, under a non-degraded condition, data corresponding to the block data information may be obtained from the complete data of the target page provided by the service data providing server, and the target paged block data may be generated. Under the condition of degradation, the target paging block data can be obtained according to the corresponding relation between the block data stored in the degraded data storage server and the block identification.
As an optional implementation manner of the present invention, the service request further includes: a client version identification; because the client version identifiers are different and the page templates of the same page may be different, in order to adapt to different client version identifiers, so that a user using the client version identifier can obtain page data matched with the client version identifier of the user under the condition of service degradation, the block data of the target page stored in the degraded data storage server may further include the client version identifier, and the page template may include the client version identifier.
In step S260 of the embodiment shown in fig. 2c, the step of obtaining a preset target page template corresponding to the service request based on the target page identifier includes:
and acquiring a preset target page template corresponding to the service request and corresponding to the client version identification.
The plurality of page templates may be pre-stored in the service server, and after the service request is received, the target page template may be searched for from the plurality of page templates based on the target page identifier and the client version identifier therein. That is, the page identifier in the target page template is the target page identifier, and the client version identifier in the target page template is the client version identifier included in the service request.
Because page data corresponding to different client version identifications may be different for the same page identification, by setting different page templates corresponding to different client version identifications and searching for a target page template corresponding to the client version identification in the service request according to the client version identification after receiving the service request, the accuracy of the page data corresponding to the generated service request is higher based on the target page template.
As an optional implementation manner of the embodiment of the present invention, the degraded data storage server is a Redis database server, and the block data of the target page stored in the degraded data storage server is stored in a key-value pair manner; wherein the key is obtained by combining the target page identifier, the block identifier and the client version identifier, and the value is block data.
The reporting service server may generate a key corresponding to each block data according to the page identifier of the page to which the block data belongs, the block identifier of each block data, and the version identifier of the client, where the key may be in the format of: page identification-block identification-client version identification.
Then, the reporting service server can take each block data as a value respectively, take each value and a key corresponding to each value as a plurality of key value pairs, and send the plurality of key value pairs to the degraded data storage server.
In addition, the expiration time of each degraded data can be set in the degraded data storage server, so that after a new version of client is put into use, the data corresponding to the old version of client is possibly not needed any more, and the data are cleaned by setting the expiration time at this time, so that the memory occupation of the degraded data storage server can be reduced. Meanwhile, an Application Programming Interface (API) may be used to accelerate the update speed of the degraded data.
In the embodiment of the invention, the block data obtained from the service data providing server is stored in one-to-one correspondence with the keys corresponding to the block data through the degraded data storage server, so that when the service server obtains the target paging block data from the degraded data storage server, the service server can construct the keys and obtain the block data corresponding to the keys from the degraded data storage server by using the keys.
As an optional implementation manner of the present invention, if any service server is: and if the reporting service server for reporting the degraded data is determined in advance from each service server, any service server obtains data corresponding to the block data information from the complete data of the target page provided by the service data providing server, and after the step of generating the target paging block data, further stores the obtained target paging block data into the degraded data storage server.
In practical application, after a certain service request is subjected to degradation processing, the service server does not send a request for obtaining block data of a target page to the service data providing server after receiving the service request. Therefore, this step may be performed in the case of non-service degradation, that is, in the case of non-service degradation, the target paging block data of the target page is obtained from the service data providing server, cached, and further the obtained target paging block data of the target page is stored in the degraded data storage server.
Under the condition of non-service degradation, a service request sent by a client is received, the service request can also contain user login information, and when a user logs in by using an account and a password, the service request can comprise the login account of the user. Then, target paging block data can be obtained based on complete data of a target page in a service data providing server, whether the service request contains login information of a user or not is judged, if yes, the page data corresponding to the service request is data related to the user, and the complete data corresponding to the page is not stored in a degraded data storage server; if not, the page data corresponding to the service request is the data irrelevant to the user, that is, the page data is the data common to all the users, and the target paging block data can be stored in the degraded data storage server. For a page in the video APP, page data corresponding to different user accounts may be different, where the page data includes data that is personalized and recommended for different users, and if the service is degraded, page data for the user needs to be provided for different users, the amount of degraded data that needs to be reported is increased, so that general data of the page can be reported and stored.
If any service server is a reporting service server which is determined in advance from each service server and used for reporting the degraded data, it indicates that the service server needs to undertake the work of reporting the degraded data, and therefore, after the step of obtaining the target paging block data corresponding to the target block identifier from the complete data of the target page according to the preset configuration information corresponding to each target block identifier, the obtained target paging block data is further stored in a degraded data storage server.
As an optional implementation manner of the embodiment of the present invention, as shown in fig. 3a, the service system 200 may further include: zooKeeper301, this ZooKeeper301 can set up a plurality of temporary nodes, and temporary node can be through a section code operation, and every temporary node all has a temporary node identification, and the identification of different temporary nodes is different. The temporary node identifier may include only one identifier, which may be, for example, a service request identifier, or may be a combined identifier, that is, at least two identifiers are included in the temporary node identifier, for example, the combined identifier is: service request identifier-machine room identifier. When the temporary node identifier is a service request identifier, indicating that each service request can have a service server capable of successfully registering the temporary node; when the temporary node identifier is the service request identifier-machine room identifier, it indicates that, for each service request, one service server may be able to successfully register the temporary node in each machine room.
As shown in fig. 3b, the method for processing a service request according to the embodiment of the present invention may further include:
any service server determines whether the service server is a reporting service server or not through the following steps:
s310, the service server regularly inquires the ZooKeeper whether the temporary node is successfully registered by the service server.
After the service request is started, a plurality of service servers providing services for the same service request can regularly inquire whether the temporary node is successfully registered by the service server in the ZooKeeper. When the service server performs query in the ZooKeeper, it may query, for the temporary node corresponding to the service request including the service request identifier, whether the temporary node is successfully registered by the service server.
And S320, if yes, taking the successfully registered service server as a reporting service server for reporting the degraded data.
If so, indicating that the existing service server successfully registers the temporary node, and using the existing service server successfully registered as a service server for reporting the degraded data. When the existing service server which is successfully registered is the current service server, the current service server can be directly used for reporting degraded data, long link with the ZooKeeper is kept, and the task of regularly inquiring whether the temporary node in the ZooKeeper is successfully registered by the service server is stopped. When the existing service server which is successfully registered is not the current service server, the link between the current service server and the ZooKeeper can be temporarily closed, so that the number of the service servers linked with the ZooKeeper is reduced, and the condition that the ZooKeeper is subjected to greater pressure due to more service server links is avoided; and then establishing a link with the ZooKeeper regularly, and inquiring whether the temporary node in the ZooKeeper is successfully registered by the service server.
And S330, if not, the service server registers the temporary node and serves as a reporting service server for reporting the degraded data under the condition of successful registration.
If not, the service server indicates that the temporary node is not successfully registered by the service server temporarily, and the service server can register the temporary node and is used as a service server for reporting degraded data under the condition of successful registration.
In addition, when the service server successfully registered in the ZooKeeper is disconnected from the ZooKeeper due to a failure or other reasons, for example, the network condition is abnormal, the service server disconnected from the ZooKeeper needs to recover the task of regularly inquiring whether the temporary node in the ZooKeeper is successfully registered. And each service server can also be set, so that each service server inquires the ZooKeeper at preset time intervals under the condition that the service server successfully registers the temporary node, and whether the service server successfully registers the temporary node exists.
In the embodiment of the invention, the ZooKeeper is set in the service system, and the service server regularly inquires whether the service server successfully registers the temporary node or not, if not, the temporary node is registered, and the service server is used for reporting degraded data after the temporary node is successfully registered. After the successfully registered service server is disconnected from the ZooKeeper, the service server can continuously inquire the temporary node, so that the service server can be ensured to be used as a service server for reporting degraded data all the time, and the continuity of reporting the degraded data can be further improved.
In addition, in the embodiment of the present invention, since the second page data and the data after the second page data can be sent to the client, the influence on the user experience is small, and the user hardly feels that the degradation processing is performed on the requested service, that is, the user does not feel aware of it.
An embodiment of the present invention provides a specific embodiment of a device for processing a service request, which corresponds to the flow shown in fig. 2b, and referring to fig. 4, fig. 4 is a schematic structural diagram of a device for processing a service request according to an embodiment of the present invention, where the device for processing a service request is applied to any service server in a service system, and the service server is in communication connection with a service data providing server and a degraded data storage server; the processing device of the service request comprises:
a service request receiving module 401, configured to receive a service request sent by a client;
a first target paging block data obtaining module 402, configured to, if degradation processing is not required to be performed on the service request, obtain, according to a service processing flow corresponding to the service request, target paging block data of a target page corresponding to the service request based on complete data of the target page provided by a service data providing server;
a first target paging generating module 403, configured to generate a target paging according to the target paging block data and return the target paging to the client;
a second target paging block data obtaining module 404, configured to determine target paging block data from block data of a target page stored in a degraded data storage server if the service request needs to be subjected to degradation processing; the block data of the target page stored in the degraded data storage server is stored in the degraded data storage server after the target paging block data of the target page is obtained from the service data providing server by a reporting service server which is determined in advance from each service server and is used for reporting the degraded data;
the second target page generation module 405 is configured to generate a target page according to the target page block data and return the target page to the client.
As an optional implementation manner of the embodiment of the present invention, the service request includes a target page identifier and a target paging identifier;
the device for processing the service request provided by the embodiment of the present invention may further include:
the target page template obtaining module is used for obtaining a preset target page template corresponding to the service request based on the target page identifier; the target page template comprises block identifications of all block data of a target page and the arrangement sequence of each block identification in the target page;
the target block identifier determining module is used for determining a target block identifier corresponding to the service request and an arrangement sequence of each target block identifier in the target page based on the target page template, the target page identifier and the number of blocks contained in each preset page;
the first target page generation module 403 is specifically configured to:
and generating target paging from the target paging block data according to the arrangement sequence of the target block identifications in the target paging, and returning the target paging to the client.
As an optional implementation manner of the embodiment of the present invention, the degraded data storage server stores a corresponding relationship between the block data and the block identifier; the second target paging block data obtaining module 404 is specifically configured to:
and obtaining target paging block data corresponding to the target block identification from the block data of the target page according to the corresponding relation.
As an optional implementation manner of the embodiment of the present invention, the first target paging block data obtaining module 402 includes:
the preset configuration information acquisition submodule is used for acquiring preset configuration information corresponding to each target block identifier; the preset configuration information includes: block data information;
and the target paging block data generation submodule is used for obtaining data corresponding to the block data information from the complete data of the target page provided by the service data providing server and generating target paging block data.
As an optional implementation manner in the embodiment of the present invention, the service request further includes: a client version identification;
the target page template obtaining module is specifically configured to:
and acquiring a preset target page template corresponding to the service request and corresponding to the client version identification.
As an optional implementation manner of the embodiment of the present invention, the block data of the target page stored in the degraded data storage server is stored in a key-value pair manner; wherein the key is obtained by combining the target page identifier, the block identifier and the client version identifier, and the value is block data.
As an optional implementation manner of the embodiment of the present invention, the apparatus for processing a service request provided in the embodiment of the present invention further includes: and the target paging block data storage module.
If any service server is: and if the reporting service server for reporting the degraded data is determined in advance from each service server, the target paging block data storage module of any service server obtains data corresponding to the block data information from the complete data of the target page provided by the service data providing server executed by the target paging block data generation submodule, and further stores the obtained target paging block data into the degraded data storage server after the step of generating the target paging block data.
As an optional implementation manner of the embodiment of the present invention, the service system further includes: coordinating server ZooKeeper;
the device for processing the service request provided by the embodiment of the present invention may further include:
the timing query module is used for the service server to query the ZooKeeper at regular time, whether the temporary node is successfully registered by the service server or not is judged, and if yes, the successfully registered service server is used as a reporting service server for reporting the degraded data; if not, the service server registers the temporary node and serves as a reporting service server for reporting the degraded data under the condition of successful registration.
The embodiment of the present invention further provides a service server, as shown in fig. 5, including a processor 501, a communication interface 502, a memory 503 and a communication bus 504, where the processor 501, the communication interface 502 and the memory 503 complete mutual communication through the communication bus 504.
The memory 503 is used for storing computer programs.
The processor 501 is configured to implement the following steps when executing the program stored in the memory 503:
and receiving a service request sent by a client.
And if the service request does not need to be subjected to degradation processing, obtaining target paging block data of a target page corresponding to the service request according to a service processing flow corresponding to the service request based on complete data of the target page provided by the service data providing server.
And generating a target paging according to the target paging block data and returning the target paging to the client.
If the service request needs to be subjected to degradation processing, determining target paging block data from block data of a target page stored in a degraded data storage server; the block data of the target page stored in the degraded data storage server is stored in the degraded data storage server after the target paging block data of the target page is obtained from the service data providing server by the reporting service server which is determined in advance from each service server and used for reporting the degraded data.
And generating a target paging according to the target paging block data and returning the target paging to the client.
The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the terminal and other equipment.
The Memory may include a Random Access Memory (RAM), and may also include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Alternatively, the memory may be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
As shown in fig. 2a, an embodiment of the present invention further provides a business service system 200, including: a plurality of service servers 201, service data providing servers 202 and degraded data storage servers 203, the service servers 201 being communicatively connected to the service data providing servers 202 and the degraded data storage servers 203.
A service server 201, configured to receive a service request sent by a client; if the service request does not need to be subjected to degradation processing, according to a service processing flow corresponding to the service request, based on the complete data of the target page provided by the service data providing server 202, obtaining target paging block data of the target page corresponding to the service request; generating a target paging according to the target paging block data and returning the target paging to the client;
the service data providing server 202 is configured to provide complete data of the target page to the service server 201 if the service request does not need to be subjected to degradation processing;
the service server 201 is further configured to determine target paging block data from the block data of the target page stored in the degraded data storage server 203 if the service request needs to be subjected to degradation processing; the block data of the target page stored in the degraded data storage server 203 is stored in the degraded data storage server 203 after the target paging block data of the target page is obtained from the service data providing server 202 by the reporting service server for reporting the degraded data determined in advance from each service server 201; generating a target paging according to the target paging block data and returning the target paging to the client;
the degraded data storage server 203 is configured to receive block data of a target page sent by a reporting service server that is determined in advance from each service server 201 and used for reporting degraded data, and send target paging block data of the target page to the service server 201 if the service request needs to be subjected to degradation processing.
As an optional implementation manner of the embodiment of the present invention, the service request includes a target page identifier and a target paging identifier;
the service server 201 is further configured to:
acquiring a preset target page template corresponding to the service request based on the target page identifier; the target page template comprises block identifications of all block data of a target page and the arrangement sequence of each block identification in the target page;
determining a target block identifier corresponding to the service request and an arrangement sequence of each target block identifier in the target page based on the target page template, the target page identifier and the preset block number contained in each page;
and generating target pages from the target page block data according to the arrangement sequence of the target block identifications in the target pages, and returning the target pages to the client.
As an optional implementation manner of the embodiment of the present invention, the degraded data storage server 203 stores a corresponding relationship between the block data and the block identifier; when the step of determining the target paging block data from the block data of the target page stored in the degraded data storage server 203 is executed, the service server 201 is specifically configured to:
and obtaining target paging block data corresponding to the target block identification from the block data of the target page according to the corresponding relation.
As an optional implementation manner of the embodiment of the present invention, when the service server 201 executes a service processing flow corresponding to the service request, and obtains target paging block data of a target page corresponding to the service request based on complete data of the target page provided by the service data providing server 202, the service server is specifically configured to:
acquiring preset configuration information corresponding to each target block identifier; the preset configuration information includes: block data information;
from the complete data of the target page provided by the service data providing server 202, data corresponding to the block data information is obtained, and target paged block data is generated.
As an optional implementation manner in the embodiment of the present invention, the service request further includes: a client version identification;
the service server 201, when executing the step of obtaining the preset target page template corresponding to the service request based on the target page identifier, is specifically configured to:
and acquiring a preset target page template corresponding to the service request and corresponding to the client version identification.
As an optional implementation manner of the embodiment of the present invention, the block data of the target page stored in the degraded data storage server 203 is stored in a key-value pair form; wherein the key is obtained by combining the target page identifier, the block identifier and the client version identifier, and the value is block data.
As an alternative implementation of the embodiment of the present invention,
if the service server 201 is: the reporting service server for reporting degraded data, which is determined in advance from each service server 201, then after the service server 201 executes the steps of obtaining data corresponding to the block data information from the complete data of the target page provided by the service data providing server 202, and generating target paging block data, the method is further specifically configured to: the acquired target paging block data is saved to the degraded data storage server 203.
As an optional implementation manner of the embodiment of the present invention, as shown in fig. 3a, the service system 200 further includes: a coordination server ZooKeeper301;
the service server 201 is further configured to query the ZooKeeper301 at regular time, to determine whether the temporary node is successfully registered by the service server 201, and if so, to use the successfully registered service server 201 as a reporting service server for reporting degraded data; if not, the service server 201 registers the temporary node, and serves as a reporting service server for reporting degraded data when the registration is successful.
In another embodiment provided by the present invention, a computer-readable storage medium is further provided, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements the method for processing a service request in any of the above embodiments.
In a further embodiment provided by the present invention, there is also provided a computer program product containing instructions, which when run on a computer, cause the computer to execute the method for processing a service request according to any one of the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that includes one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising one of 8230; \8230;" 8230; "does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on differences from other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.
Claims (26)
1. A processing method of business request is characterized in that the method is applied to any business server in a business service system, and the business server is in communication connection with a business data providing server and a degraded data storage server; the method comprises the following steps:
receiving a service request sent by a client; the service request comprises a target page identifier and a target paging identifier; the target page is one of a plurality of pages in a target page, and the target page identifier is used for determining that the target page corresponding to the service request is the second page in the target page;
if the service request does not need to be degraded, obtaining target paging block data of a target page corresponding to the service request according to a service processing flow corresponding to the service request and based on complete data of the target page provided by the service data providing server;
generating a target paging according to the target paging block data and returning the target paging to the client;
if the service request needs to be degraded, determining target paging block data from block data of a target page stored in the degraded data storage server; the block data of the target page stored in the degraded data storage server is stored in the degraded data storage server after the target paging block data of the target page is obtained from the service data providing server by a reporting service server which is determined in advance from each service server and is used for reporting the degraded data;
and generating a target paging according to the target paging block data and returning the target paging to the client.
2. The method of claim 1,
before the step of obtaining the target paging block data of the target page corresponding to the service request based on the complete data of the target page provided by the service data providing server according to the service processing flow corresponding to the service request if the degradation processing does not need to be performed on the service request, the method further includes:
acquiring a preset target page template corresponding to the service request based on the target page identifier; the target page template comprises block identifications of all block data of the target page and the arrangement sequence of each block identification in the target page;
determining a target block identifier corresponding to the service request and an arrangement sequence of each target block identifier in a target page based on a target page template, the target page identifier and a preset block number contained in each page;
the step of generating a target page and returning the target page to the client according to the target page block data comprises the following steps:
and generating target paging from the target paging block data according to the arrangement sequence of the target block identifiers in the target paging, and returning the target paging to the client.
3. The method according to claim 2, wherein the degraded data storage server stores therein a correspondence between the chunk data and the chunk identifier; the step of determining target paging block data from block data of a target page stored in the degraded data storage server includes:
and obtaining target paging block data corresponding to the target block identification from the block data of the target page according to the corresponding relation.
4. The method according to claim 2, wherein the step of obtaining the target paging block data of the target page corresponding to the service request based on the complete data of the target page provided by the service data providing server according to the service processing flow corresponding to the service request comprises:
acquiring preset configuration information corresponding to each target block identifier; the preset configuration information includes: block data information;
and acquiring data corresponding to the block data information from the complete data of the target page provided by the service data providing server, and generating target paging block data.
5. The method of claim 2, wherein the service request further comprises: a client version identification;
the step of obtaining a preset target page template corresponding to the service request based on the target page identifier includes:
and acquiring a preset target page template corresponding to the service request and corresponding to the client version identification.
6. The method of claim 5, wherein the tile data of the target page maintained in the degraded data storage server is stored in the form of key-value pairs; wherein the key is obtained by combining the target page identifier, the block identifier and the client version identifier, and the value is the block data.
7. The method of claim 6,
if any service server is: and if the reporting service server for reporting the degraded data is determined in advance from each service server, the any service server obtains the data corresponding to the block data information from the complete data of the target page provided by the service data providing server, and further stores the obtained target paging block data into the degraded data storage server after the step of generating the target paging block data.
8. The method of claim 7, wherein the business service system further comprises: coordinating server ZooKeeper;
the method further comprises the following steps:
the method comprises the following steps that whether any service server is a reporting service server or not is determined through the following steps:
the service server regularly inquires whether the temporary node is successfully registered by the service server in the ZooKeeper, if so, the successfully registered service server is used as a reporting service server for reporting degraded data; if not, the service server registers the temporary node and serves as a reporting service server for reporting the degraded data under the condition of successful registration.
9. The device for processing the service request is applied to any service server in a service system, and the service server is in communication connection with a service data providing server and a degraded data storage server; the device comprises:
the service request receiving module is used for receiving a service request sent by a client; the service request comprises a target page identifier and a target paging identifier; the target page is one of a plurality of pages in a target page, and the target page identifier is used for determining that the target page corresponding to the service request is the second page in the target page;
a first target paging block data obtaining module, configured to, if degradation processing is not required to be performed on the service request, obtain target paging block data of a target page corresponding to the service request according to a service processing flow corresponding to the service request based on complete data of the target page provided by the service data providing server;
the first target paging generation module is used for generating target paging according to the target paging block data and returning the target paging to the client;
a second target paging block data obtaining module, configured to determine target paging block data from block data of a target page stored in the degraded data storage server if the service request needs to be subjected to degradation processing; the block data of the target page stored in the degraded data storage server is stored in the degraded data storage server after the target paging block data of the target page is obtained from the service data providing server by a reporting service server which is determined in advance from each service server and is used for reporting the degraded data;
and the second target paging generation module is used for generating target paging according to the target paging block data and returning the target paging to the client.
10. The apparatus of claim 9, further comprising:
a target page template obtaining module, configured to obtain a preset target page template corresponding to the service request based on the target page identifier; the target page template comprises block identifications of all block data of the target page and the arrangement sequence of each block identification in the target page;
a target block identifier determining module, configured to determine, based on a target page template, the target page identifier, and a preset number of blocks included in each page, a target block identifier corresponding to the service request, and an arrangement order of each target block identifier in a target page;
the first target page generation module is specifically configured to:
and generating target paging from the target paging block data according to the arrangement sequence of the target block identifiers in the target paging, and returning the target paging to the client.
11. The apparatus according to claim 10, wherein the degraded data storage server stores therein a correspondence between the chunk data and the chunk identifier; the second target paging block data obtaining module is specifically configured to:
and obtaining target paging block data corresponding to the target block identification from the block data of the target page according to the corresponding relation.
12. The apparatus of claim 10, wherein the first target paging block data obtaining module comprises:
the preset configuration information acquisition submodule is used for acquiring preset configuration information corresponding to each target block identifier; the preset configuration information includes: block data information;
and the target paging block data generation submodule is used for acquiring data corresponding to the block data information from the complete data of the target page provided by the service data providing server and generating target paging block data.
13. The apparatus of claim 10, wherein the service request further comprises: a client version identification;
the target page template obtaining module is specifically configured to:
and acquiring a preset target page template corresponding to the service request and corresponding to the client version identification.
14. The apparatus of claim 13, wherein the tile data of the target page maintained in the degraded data storage server is stored in key-value pairs; wherein the key is obtained by combining the target page identifier, the block identifier and the client version identifier, and the value is the block data.
15. The apparatus of claim 14, further comprising: a target paging block data storage module;
if any service server is: and if a reporting service server for reporting degraded data is determined in advance from each service server, the target paging block data storage module of any service server performs the steps of obtaining data corresponding to the block data information from the complete data of the target page provided by the service data providing server in the target paging block data generation submodule, and generating target paging block data, and then further storing the obtained target paging block data into the degraded data storage server.
16. The apparatus of claim 15, wherein the business service system further comprises: coordinating server ZooKeeper;
the device further comprises:
a timing query module, configured to query, by the service server, whether the temporary node is successfully registered by the service server in the ZooKeeper at a timing, and if so, use the successfully registered service server as a reporting service server for reporting degraded data; if not, the service server registers the temporary node and serves as a reporting service server for reporting the degraded data under the condition of successful registration.
17. A business server is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1 to 8 when executing a program stored in the memory.
18. A business service system, the system comprising: the system comprises a plurality of service servers, service data providing servers and degraded data storage servers, wherein the service servers are in communication connection with the service data providing servers and the degraded data storage servers;
the service server is used for receiving a service request sent by the client; if the service request does not need to be degraded, obtaining target paging block data of a target page corresponding to the service request according to a service processing flow corresponding to the service request and based on complete data of the target page provided by the service data providing server; generating a target paging according to the target paging block data and returning the target paging to the client; the service request comprises a target page identifier and a target paging identifier; the target page is one of a plurality of pages in a target page, and the target page identifier is used for determining that the target page corresponding to the service request is the second page in the target page;
the service data providing server is used for providing complete data of a target page for the service server if the service request does not need to be subjected to degradation processing;
the service server is further configured to determine target paging block data from block data of a target page stored in the degraded data storage server if the service request needs to be subjected to degradation processing; the block data of the target page stored in the degraded data storage server is stored in the degraded data storage server after the target paging block data of the target page is obtained from the service data providing server by a reporting service server which is determined in advance from each service server and is used for reporting the degraded data; generating a target paging according to the target paging block data and returning the target paging to the client;
the degraded data storage server is used for receiving block data of a target page sent by a reporting service server which is determined in advance from each service server and used for reporting the degraded data, and sending the target paging block data of the target page to the service server if the service request needs to be subjected to degradation processing.
19. The system of claim 18, wherein the service server is further configured to:
acquiring a preset target page template corresponding to the service request based on the target page identifier; the target page template comprises block identifications of all block data of the target page and the arrangement sequence of each block identification in the target page;
determining a target block identifier corresponding to the service request and an arrangement sequence of each target block identifier in a target page based on a target page template, the target page identifier and a preset number of blocks contained in each page;
and generating target pages from the target page block data according to the arrangement sequence of the target block identifiers in the target pages, and returning the target pages to the client.
20. The system of claim 19, wherein the degraded data storage server stores therein a correspondence between the chunk data and the chunk identifier; the service server, when performing the step of determining the target paging block data from the block data of the target page stored in the degraded data storage server, is specifically configured to:
and obtaining target paging block data corresponding to the target block identification from the block data of the target page according to the corresponding relation.
21. The system according to claim 19, wherein the service server, when executing the step of obtaining the target paging block data of the target page corresponding to the service request based on the complete data of the target page provided by the service data providing server according to the service processing flow corresponding to the service request, is specifically configured to:
acquiring preset configuration information corresponding to each target block identifier; the preset configuration information includes: block data information;
and acquiring data corresponding to the block data information from the complete data of the target page provided by the service data providing server, and generating target paging block data.
22. The system of claim 19, wherein the service request further comprises: a client version identification;
the service server, when executing the step of obtaining a preset target page template corresponding to the service request based on the target page identifier, is specifically configured to:
and acquiring a preset target page template corresponding to the service request and corresponding to the client version identification.
23. The system of claim 22, wherein the tile data of the target page maintained in the degraded data storage server is stored in the form of key-value pairs; wherein the key is obtained by combining the target page identifier, the block identifier and the client version identifier, and the value is the block data.
24. The system of claim 23,
if the service server is: the reporting service server for reporting degraded data, which is determined in advance from each service server, is further specifically configured to, after the service server executes the steps of obtaining data corresponding to the block data information from the complete data of the target page provided by the service data providing server, and generating target paging block data: and storing the acquired target paging block data into the degraded data storage server.
25. The system of claim 24, wherein the business service system further comprises: coordinating server ZooKeeper;
the service server is further configured to query the ZooKeeper at regular time whether the temporary node is successfully registered by the service server, and if so, the successfully registered service server is used as a reporting service server for reporting degraded data; if not, the service server registers the temporary node and serves as a reporting service server for reporting the degraded data under the condition of successful registration.
26. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of the claims 1-8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011307241.2A CN112437148B (en) | 2020-11-20 | 2020-11-20 | Service request processing method and device, service server and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011307241.2A CN112437148B (en) | 2020-11-20 | 2020-11-20 | Service request processing method and device, service server and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112437148A CN112437148A (en) | 2021-03-02 |
CN112437148B true CN112437148B (en) | 2023-03-07 |
Family
ID=74693006
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011307241.2A Active CN112437148B (en) | 2020-11-20 | 2020-11-20 | Service request processing method and device, service server and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112437148B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113076485B (en) * | 2021-04-28 | 2024-06-28 | 平安科技(深圳)有限公司 | Resource recommendation method, device, equipment and storage medium based on intelligent degradation |
CN114969129B (en) * | 2022-07-29 | 2022-12-13 | 飞狐信息技术(天津)有限公司 | Abnormal service data backflow method and device |
CN116347511A (en) * | 2023-05-29 | 2023-06-27 | 泉州维盾电气有限公司 | Data communication method and related equipment |
Citations (22)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101393517A (en) * | 2007-09-20 | 2009-03-25 | 上海宝信软件股份有限公司 | Method and apparatus for implementing collocation based on XML and control |
CN104102419A (en) * | 2013-04-09 | 2014-10-15 | 腾讯科技(深圳)有限公司 | Page display method and device and terminal equipment |
CN104182247A (en) * | 2014-07-22 | 2014-12-03 | 百度在线网络技术(北京)有限公司 | Method and device for configuring navigation page of browser |
CN104298721A (en) * | 2014-09-25 | 2015-01-21 | 宇威科技发展(青岛)有限公司 | Split screen layout editing method for any number of objects in on-line courseware making based on Web |
CN104462089A (en) * | 2013-09-13 | 2015-03-25 | 北大方正集团有限公司 | Data processing method and device |
CN104486108A (en) * | 2014-12-08 | 2015-04-01 | 畅捷通信息技术股份有限公司 | Node configuration method base on Zookeeper and node configuration system based on Zookeeper |
CN105045896A (en) * | 2015-07-31 | 2015-11-11 | 北京奇虎科技有限公司 | Method and apparatus for pushing promotion content to appointed page |
CN107085580A (en) * | 2016-02-16 | 2017-08-22 | 阿里巴巴集团控股有限公司 | The method and client of client displayed page |
CN107862001A (en) * | 2017-10-23 | 2018-03-30 | 北京京东尚科信息技术有限公司 | A kind of method and system of data disaster tolerance |
CN108171610A (en) * | 2017-12-28 | 2018-06-15 | 中国平安人寿保险股份有限公司 | Page generation method, page generation equipment, storage medium and device |
CN108234670A (en) * | 2018-01-31 | 2018-06-29 | 北京中安智达科技有限公司 | A kind of distributed remote call method based on zookeeper and netty |
CN108304255A (en) * | 2017-12-29 | 2018-07-20 | 北京城市网邻信息技术有限公司 | Distributed task dispatching method and device, electronic equipment and readable storage medium storing program for executing |
CN109597954A (en) * | 2018-11-28 | 2019-04-09 | 南京赛克蓝德网络科技有限公司 | Data item methods of exhibiting, calculates equipment and medium at device |
CN110096659A (en) * | 2019-03-27 | 2019-08-06 | 北京三快在线科技有限公司 | A kind of page display method, device, equipment and readable storage medium storing program for executing |
CN110209964A (en) * | 2018-02-13 | 2019-09-06 | 阿里巴巴集团控股有限公司 | A kind of page display method, device and equipment |
CN110263277A (en) * | 2019-06-18 | 2019-09-20 | 广州虎牙科技有限公司 | Display methods, update method, device, equipment and the storage medium of page data |
CN110647372A (en) * | 2019-09-18 | 2020-01-03 | 阿里巴巴集团控股有限公司 | Position adjusting method and device of page display module |
CN110889073A (en) * | 2019-11-21 | 2020-03-17 | 掌阅科技股份有限公司 | Page request response method, server and computer storage medium |
CN111324435A (en) * | 2020-02-06 | 2020-06-23 | 北京奇艺世纪科技有限公司 | Distributed task scheduling and registering method, device and distributed task scheduling system |
CN111460011A (en) * | 2020-03-27 | 2020-07-28 | 中国平安人寿保险股份有限公司 | Page data display method and device, server and storage medium |
CN111769941A (en) * | 2020-07-15 | 2020-10-13 | 北京金山云网络技术有限公司 | Business processing method and device and integrated business service system |
EP3731113A1 (en) * | 2019-04-25 | 2020-10-28 | Beijing Xiaomi Mobile Software Co., Ltd. | Display method, display device and storage medium |
Family Cites Families (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8751633B2 (en) * | 2010-04-01 | 2014-06-10 | Cloudflare, Inc. | Recording internet visitor threat information through an internet-based proxy service |
CN104102636B (en) * | 2013-04-02 | 2018-01-19 | 阿里巴巴集团控股有限公司 | A kind of statistics of page data, rendering method and device |
CN103617198B (en) * | 2013-11-14 | 2017-10-27 | 北京国双科技有限公司 | Page merging method and device |
JP5735146B1 (en) * | 2014-01-31 | 2015-06-17 | グリー株式会社 | Display data creation method, control program, and computer |
CN104281677A (en) * | 2014-09-29 | 2015-01-14 | 百度在线网络技术(北京)有限公司 | Page displaying method and device |
CN105095432B (en) * | 2015-07-22 | 2019-04-16 | 腾讯科技(北京)有限公司 | Web page annotation display methods and device |
CN106445583B (en) * | 2016-08-31 | 2020-03-31 | 广州品唯软件有限公司 | Page display method, equipment and system |
CN108829885A (en) * | 2018-06-27 | 2018-11-16 | 珠海市君天电子科技有限公司 | Page generation method, device, server, electronic equipment and storage medium |
CN109740076A (en) * | 2018-12-28 | 2019-05-10 | 北京字节跳动网络技术有限公司 | Webpage display process and device |
CN111046310B (en) * | 2019-12-12 | 2024-03-19 | 北京奇艺世纪科技有限公司 | Page processing method, device, server and computer readable storage medium |
CN111368235B (en) * | 2020-02-25 | 2023-11-14 | 北京达佳互联信息技术有限公司 | Page rendering and displaying method and device, server and storage medium |
-
2020
- 2020-11-20 CN CN202011307241.2A patent/CN112437148B/en active Active
Patent Citations (22)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101393517A (en) * | 2007-09-20 | 2009-03-25 | 上海宝信软件股份有限公司 | Method and apparatus for implementing collocation based on XML and control |
CN104102419A (en) * | 2013-04-09 | 2014-10-15 | 腾讯科技(深圳)有限公司 | Page display method and device and terminal equipment |
CN104462089A (en) * | 2013-09-13 | 2015-03-25 | 北大方正集团有限公司 | Data processing method and device |
CN104182247A (en) * | 2014-07-22 | 2014-12-03 | 百度在线网络技术(北京)有限公司 | Method and device for configuring navigation page of browser |
CN104298721A (en) * | 2014-09-25 | 2015-01-21 | 宇威科技发展(青岛)有限公司 | Split screen layout editing method for any number of objects in on-line courseware making based on Web |
CN104486108A (en) * | 2014-12-08 | 2015-04-01 | 畅捷通信息技术股份有限公司 | Node configuration method base on Zookeeper and node configuration system based on Zookeeper |
CN105045896A (en) * | 2015-07-31 | 2015-11-11 | 北京奇虎科技有限公司 | Method and apparatus for pushing promotion content to appointed page |
CN107085580A (en) * | 2016-02-16 | 2017-08-22 | 阿里巴巴集团控股有限公司 | The method and client of client displayed page |
CN107862001A (en) * | 2017-10-23 | 2018-03-30 | 北京京东尚科信息技术有限公司 | A kind of method and system of data disaster tolerance |
CN108171610A (en) * | 2017-12-28 | 2018-06-15 | 中国平安人寿保险股份有限公司 | Page generation method, page generation equipment, storage medium and device |
CN108304255A (en) * | 2017-12-29 | 2018-07-20 | 北京城市网邻信息技术有限公司 | Distributed task dispatching method and device, electronic equipment and readable storage medium storing program for executing |
CN108234670A (en) * | 2018-01-31 | 2018-06-29 | 北京中安智达科技有限公司 | A kind of distributed remote call method based on zookeeper and netty |
CN110209964A (en) * | 2018-02-13 | 2019-09-06 | 阿里巴巴集团控股有限公司 | A kind of page display method, device and equipment |
CN109597954A (en) * | 2018-11-28 | 2019-04-09 | 南京赛克蓝德网络科技有限公司 | Data item methods of exhibiting, calculates equipment and medium at device |
CN110096659A (en) * | 2019-03-27 | 2019-08-06 | 北京三快在线科技有限公司 | A kind of page display method, device, equipment and readable storage medium storing program for executing |
EP3731113A1 (en) * | 2019-04-25 | 2020-10-28 | Beijing Xiaomi Mobile Software Co., Ltd. | Display method, display device and storage medium |
CN110263277A (en) * | 2019-06-18 | 2019-09-20 | 广州虎牙科技有限公司 | Display methods, update method, device, equipment and the storage medium of page data |
CN110647372A (en) * | 2019-09-18 | 2020-01-03 | 阿里巴巴集团控股有限公司 | Position adjusting method and device of page display module |
CN110889073A (en) * | 2019-11-21 | 2020-03-17 | 掌阅科技股份有限公司 | Page request response method, server and computer storage medium |
CN111324435A (en) * | 2020-02-06 | 2020-06-23 | 北京奇艺世纪科技有限公司 | Distributed task scheduling and registering method, device and distributed task scheduling system |
CN111460011A (en) * | 2020-03-27 | 2020-07-28 | 中国平安人寿保险股份有限公司 | Page data display method and device, server and storage medium |
CN111769941A (en) * | 2020-07-15 | 2020-10-13 | 北京金山云网络技术有限公司 | Business processing method and device and integrated business service system |
Also Published As
Publication number | Publication date |
---|---|
CN112437148A (en) | 2021-03-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112437148B (en) | Service request processing method and device, service server and system | |
CN107784516B (en) | Advertisement putting method and device | |
CN109885786B (en) | Data caching processing method and device, electronic equipment and readable storage medium | |
WO2017167050A1 (en) | Configuration information generation and transmission method, and resource loading method, apparatus and system | |
CN111159269B (en) | Data processing method, device and system | |
CN111782692A (en) | Frequency control method and device | |
CN112115337A (en) | Method and device for displaying data, electronic equipment and computer readable storage medium | |
CN109885729B (en) | Method, device and system for displaying data | |
CN115757406A (en) | Data storage method and device, electronic equipment and storage medium | |
CN111367691A (en) | Data feedback method and device, electronic equipment and storable medium | |
CN114003659A (en) | Data synchronization method, data synchronization device, electronic equipment, storage medium and program product | |
CN110727895B (en) | Sensitive word sending method and device, electronic equipment and storage medium | |
CN112653736A (en) | Parallel source returning method and device and electronic equipment | |
CN112838980A (en) | Message processing method, system, device, electronic equipment and storage medium | |
CN110245313B (en) | Request sending method, device and terminal based on data analysis | |
CN111367703A (en) | Troubleshooting method and device | |
CN111367606A (en) | Application page display method, device, terminal and medium | |
CN110674426A (en) | Webpage behavior reporting method and device | |
CN111400327B (en) | Data synchronization method and device, electronic equipment and storage medium | |
CN111291127B (en) | Data synchronization method, device, server and storage medium | |
CN110674386B (en) | Resource recommendation method, device and storage medium | |
CN108804195B (en) | Page display method and device, server and client | |
CN112256654B (en) | Document sharing method and device | |
CN111881356A (en) | Content recommendation method and device, electronic equipment and storage medium | |
CN111078736A (en) | Data aggregation processing method and device, terminal and storage medium |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |