CN113704295A - Service request processing method and system and electronic equipment - Google Patents

Service request processing method and system and electronic equipment Download PDF

Info

Publication number
CN113704295A
CN113704295A CN202010442333.5A CN202010442333A CN113704295A CN 113704295 A CN113704295 A CN 113704295A CN 202010442333 A CN202010442333 A CN 202010442333A CN 113704295 A CN113704295 A CN 113704295A
Authority
CN
China
Prior art keywords
request
server cluster
service
processing
processed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010442333.5A
Other languages
Chinese (zh)
Inventor
王志诚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202010442333.5A priority Critical patent/CN113704295A/en
Publication of CN113704295A publication Critical patent/CN113704295A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • G06F16/24532Query optimisation of parallel queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • G06Q30/0601Electronic shopping [e-shopping]

Abstract

The embodiment of the application provides a method and a system for processing a service request and electronic equipment. The method is executed by a service processing server cluster, the service processing server cluster comprises a request receiving server cluster and a request processing server cluster, and the method comprises the following steps: a request receiving server cluster acquires service requests sent by various clients; the request receiving server cluster stores each service request to a to-be-processed request storage space; the request processing server cluster reads the service request from the storage space of the request to be processed and processes the read service request to obtain a processing result; and the request processing server cluster sends the processing result to the corresponding client. The embodiment of the application realizes relieving the pressure of the server processing the service request during high concurrency.

Description

Service request processing method and system and electronic equipment
Technical Field
The embodiment of the application relates to the technical field of data processing, in particular to a method and a system for processing a service request and electronic equipment.
Background
With the continuous development of internet technology, more and more companies choose to own e-commerce platforms, so that the sales channels of the companies are widened through the e-commerce platforms, and the sales cost is reduced. Usually, a new product release or promotion activity of a company is selected to be performed on an E-commerce platform of the company, however, some companies lack professional development teams to develop and maintain the E-commerce platform, so that a service system of the E-commerce platform cannot resist high concurrence of the new product release or promotion activity.
In order to improve service performance, most companies optimize the service performance by increasing bandwidth or increasing the number of servers, however, increasing network bandwidth or increasing the number of servers can only improve system performance to a certain extent, which cannot solve the high concurrency condition well, and the cost of increasing network bandwidth or increasing the number of servers is high, which may increase the investment cost of the companies. Therefore, how to better improve the system performance to better satisfy the high-concurrency situation still remains a problem to be improved.
Disclosure of Invention
The application provides a method, a system and an electronic device for processing a service request, which can solve at least one technical problem.
The application provides a service request processing method, which is executed by a service processing server cluster, wherein the service processing server cluster comprises a request receiving server cluster and a request processing server cluster, and the method comprises the following steps:
the request receiving server cluster acquires service requests sent by all the clients and stores all the service requests to a to-be-processed request storage space;
the request processing server cluster reads the service request from the storage space of the request to be processed and processes the read service request to obtain a processing result;
and the request processing server cluster sends the processing result to the corresponding client.
In another optional implementation manner, the requesting a receiving server cluster to obtain a service request sent by each client includes:
the request receiving server cluster receives each service request sent by the proxy server cluster;
the service request is received by the proxy server cluster from the client.
In another optional implementation manner, the service request is sent to the request receiving server cluster by the proxy server cluster after the service request is received from the client and when the request type of the received service request is the same as the request type corresponding to the service processing server cluster;
and when the request type of the received service request is different from the request type corresponding to the service processing server cluster, sending the request to the request receiving server cluster corresponding to the request type of the service request.
In another alternative implementation, the pending request storage space is a remote dictionary service-based storage cluster, wherein the remote dictionary service-based storage cluster includes at least two storage spaces.
In another optional implementation, the master database is a storage space in a master data storage server, and the slave database is a storage space in a slave data storage server, and the method further includes:
the request receiving server cluster and/or the request processing server cluster send first data processing information to the master data storage server, so that the master data storage server performs corresponding data processing operation in the master database based on the first data processing information, second data processing information is generated and sent to each slave data storage server, and each slave data storage server performs corresponding data processing operation in a corresponding slave database based on the second data processing information;
wherein the data processing operation comprises at least one of a data write operation, a data delete operation, or a data update operation.
The application provides a service request processing system, which comprises a service processing server cluster and a service processing server cluster, wherein the service processing server cluster comprises a request receiving server cluster and a request processing server cluster,
the request receiving server cluster is for:
acquiring service requests sent by each client, and storing each service request to a to-be-processed request storage space;
the request processing server cluster is to:
and reading the service request from the to-be-processed request storage space, processing the read service request to obtain a processing result, and sending the processing result to the corresponding client.
The application provides a service processing server cluster, which comprises a request receiving server cluster and a request processing server cluster, wherein the request receiving server cluster comprises an acquisition module and a first storage module, the request processing server cluster comprises a reading processing module and a sending module, wherein,
the acquisition module is used for acquiring the service requests sent by the clients;
the first storage module is used for storing each service request to a to-be-processed request storage space;
the reading processing module is used for reading the service request from the storage space of the request to be processed and processing the read service request to obtain a processing result;
and the sending module is used for sending the processing result to the corresponding client.
In another optional implementation manner, the obtaining module is specifically configured to receive each service request sent by the proxy server cluster;
the service request is received by the proxy server cluster from the client.
In another optional implementation manner, the service request is sent to the request receiving server cluster by the proxy server cluster after the service request is received from the client and when the request type of the received service request is the same as the request type corresponding to the service processing server cluster;
and when the request type of the received service request is different from the request type corresponding to the service processing server cluster, sending the request to the request receiving server cluster corresponding to the request type of the service request.
In another alternative implementation, the service processing server cluster is an order placing service processing server cluster, the request receiving server cluster is an order placing request receiving server cluster, the request processing server cluster is an order placing request processing server cluster, and the service request is an order placing request, wherein,
the acquisition module is specifically used for acquiring order placing requests sent by various clients;
the first storage module is specifically used for storing each order placing request to a to-be-processed request storage space;
the reading processing module is specifically used for acquiring the information of the order to be processed and processing the information of the order to be processed;
the order information to be processed is acquired through any one of the following items:
for any order placing request, the first storage module is specifically used for inquiring relevant information of the order placing request in a database, generating to-be-processed order information according to the order placing request and the relevant information, and storing the to-be-processed order information into a to-be-processed request storage space; the reading processing module is specifically used for reading the information of the order to be processed from the storage space of the request to be processed;
the reading processing module is specifically configured to read an order placing request from the to-be-processed storage space, query relevant information of the order placing request in a database, and generate to-be-processed order information according to the order placing request and the relevant information.
In another alternative implementation, the pending request storage space includes at least two storage spaces;
the first storage module is specifically configured to: for any service request, determining a storage space corresponding to the service request according to the user identification information of the service request; and respectively storing each service request into the corresponding storage space.
In another optional implementation manner, the at least two storage spaces are configured based on a hash partitioning rule;
when determining the storage space corresponding to the service request according to the user identification information of the service request, the first storage module is specifically configured to: determining a hash value corresponding to the service request according to the user identification information of the service request; and determining a storage space corresponding to the service request according to the hash value.
In another alternative implementation, the database includes a master database and a slave database;
the first storage module is specifically used for inquiring the relevant information of the order placing request from the database when inquiring the relevant information of the order placing request from the database;
or, when the reading processing module queries the relevant information of the order placing request in the database, the reading processing module is specifically used for querying the relevant information of the order placing request from the database;
the order placing request processing server cluster further comprises a second storage module, wherein the second storage module is used for storing the order information to be processed into the main database.
In another alternative implementation, the pending request storage space is a remote dictionary service-based storage cluster, wherein the remote dictionary service-based storage cluster includes at least two storage spaces.
In another alternative implementation, the master database is a storage space in a master data storage server, and the slave database is a storage space in a slave data storage server, wherein the request receiving server cluster and/or the request processing server cluster further comprises a sending module, wherein,
the sending module is used for sending the first data processing information to the master data storage server so that the master data storage server performs corresponding data processing operation in the master database based on the first data processing information, generates second data processing information and sends the second data processing information to each slave data storage server, and each slave data storage server performs corresponding data processing operation in the corresponding slave database based on the second data processing information;
wherein the data processing operation comprises at least one of a data write operation, a data delete operation, or a data update operation.
The application provides an electronic device, which includes:
one or more processors;
a memory;
one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to: a method of processing a service request according to any of the above is performed.
There is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements any of the methods of processing a service request shown.
The beneficial effect that technical scheme that this application provided brought is:
the application provides a service request processing method, a system and electronic equipment, and the method comprises the steps of obtaining service requests sent by clients through a request receiving server cluster, storing the service requests into a to-be-processed request storage space, and storing concurrent service requests into the to-be-processed request storage space; the request processing server cluster reads the service request from the to-be-processed request storage space and processes the read service request to obtain a processing result, and sends the processing result to the corresponding client to realize serial reading and processing of the service request from the to-be-processed request storage space, so that decoupling between the acquisition of the service request and the processing of the service request is realized, serial service request processing is performed on concurrent service requests, the pressure of processing the service request by the server at high concurrency is effectively relieved, and the cost input by a company is reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the description of the embodiments of the present application will be briefly described below.
Fig. 1 is a schematic architecture diagram of a service request processing system according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a method for processing a service request according to an embodiment of the present application;
fig. 3 is a schematic flow chart of a user performing a goods robbery in an e-commerce platform according to an embodiment of the present application;
fig. 4 is a schematic architecture diagram of a service processing server cluster according to an embodiment of the present application;
fig. 5 is a flowchart illustrating a processing method for placing an order request according to an embodiment of the present application;
fig. 6 is an interaction diagram of a service request processing system according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a service request processing system according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary only for the purpose of explaining the present application and are not to be construed as limiting the present application.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. As used herein, the term "and/or" includes all or any element and all combinations of one or more of the associated listed items.
For better understanding and description of the solutions provided in the embodiments of the present application, the solutions provided in the embodiments of the present application will be described below with reference to an example.
As an alternative, fig. 1 shows a schematic architecture diagram of a service request processing system to which the scheme provided by the embodiment of the present application is applied, and as shown in fig. 1, the system architecture may include clients (the number of the clients is determined by an actual application situation, and only 1 client is schematically shown in fig. 1), a proxy server cluster, a Content Delivery Network (CDN), a service processing server cluster corresponding to various request types (e.g., the service processing server cluster 1 corresponding to the request type 1, the service processing server cluster 2, … … corresponding to the request type 2, and the service processing server cluster n corresponding to the request type n shown in fig. 1), and slave databases corresponding to various request types (e.g., the slave database 1 corresponding to the request type 1, the slave database 2 corresponding to the request type 2, and the slave database 1 shown in fig. 1, … …, the slave database n corresponding to the request type n), and the master database.
As a specific example, the service request processing system may be a service processing system of an e-commerce platform, and accordingly, the client is a terminal device of a user of the e-commerce platform, the service processing server cluster is a service processing server cluster corresponding to various request types of the e-commerce platform, as shown in fig. 1, the service processing server cluster 1 may be a service processing server cluster corresponding to a login request, the service processing server cluster 2 may be a service processing server cluster corresponding to a commodity detail obtaining request, and the service processing server cluster n may be a service processing server cluster corresponding to an order placing request.
The CDN can be used to store static files of the system, such as static files of an e-commerce platform, to reduce bandwidth consumption for page loading and page rendering time, for example, to cache a static resource of an online mall on a CDN node that is close to a user, and to store a user page resource on the CDN node, so that not only can the page access speed of the user be increased, but also the bandwidth consumption for page loading and the page rendering time can be reduced, and the access speed of the user can be increased.
Each client communicates with a proxy server cluster, and the clients may send service requests to the proxy server cluster. For each service request, when the proxy server cluster receives the service request, the service request can be sent to the service processing server cluster corresponding to the request type according to the request type of the service request. For example, for the service processing system of the e-commerce platform, the request type 1 may be a login request type, the request type 2 may be a commodity detail obtaining request type, and the request type n may be an order placing request type. When the proxy server cluster receives the login request, the login request is sent to the service processing server cluster 1, when the commodity detail acquisition request is received, the commodity detail acquisition request is sent to the service processing server cluster 2, and when the order placing request is received, the order placing request is sent to the service processing server cluster n.
It is understood that, in the embodiments of the present application, for any server cluster (including a proxy server cluster, a service processing server cluster, and other server clusters described below), the cluster may include at least one server, and usually includes a plurality of servers. For each server cluster, a proxy server may be selectively set according to actual requirements, or a proxy server may not be set, as shown in fig. 1, a service processing server cluster n includes a proxy server and a server 1, and a server 2 to a server n. In this embodiment, the proxy server may communicate with the proxy server cluster to receive the service request sent by the proxy server cluster, and the proxy server may further communicate with servers (e.g., server 1, server 2 to server n shown in fig. 1) to distribute the received service request to the servers, where the proxy server may distribute the received service request to the servers based on a load balancing technique to balance the service processing pressure of each server.
For the embodiment of the present application, each request type corresponds to a slave database, and the service processing server cluster may read data from the slave database corresponding to the request type corresponding thereto, as shown in the figure, the service processing server cluster 1 may read data from the slave database 1; the service processing server cluster 2 can read data from the database 2; the cluster of business processing servers n may read data from the database n. In this embodiment of the application, the service processing server cluster of each request type may write data into the master database, and the data written into the master database may be automatically synchronized into the slave database corresponding to each request type, for example, the service processing server cluster 2 in fig. 1 may write data into the master database, and the data written into the master database is automatically synchronized into the slave database 1, the slave database 2, and the slave database n.
For the embodiment of the application, the structure of the master database and the slave database is adopted, so that the read-write separation of data can be realized, namely, the data is read from the slave database and written into the master database, the performance of the database can be greatly improved, and the problem of database locking during high concurrency can be avoided.
The following describes the technical solutions of the present application and how to solve the above technical problems with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
An embodiment of the present application provides a method for processing a service request, which may be executed by a service processing server cluster, where the service processing server cluster includes a request receiving server cluster and a request processing server cluster, as shown in fig. 2, fig. 2 shows a flowchart of a method for processing a service request provided in an embodiment of the present application, and the method includes:
step S201, requesting the receiving server cluster to obtain the service request sent by each client.
For the embodiment of the application, each server in the request receiving server cluster may directly communicate or indirectly communicate with each client, for example, may directly receive a service request sent by the client, or obtain a service request sent by the client through the proxy server cluster.
Step S202, the request receiving server cluster stores each service request to the pending request storage space.
For the embodiment of the present application, the request receiving server cluster may store each service request into the to-be-processed request storage space, and for example, may store each obtained service request into the to-be-processed request storage space according to a preconfigured storage policy, where the preconfigured storage policy may be a time when the request receiving server cluster obtains each service request, or may be a request type of each service request, which is not limited herein.
Step S203, the request processing server cluster reads the service request from the to-be-processed request storage space, and processes the read service request to obtain a processing result.
For the embodiment of the present application, the request processing server cluster includes at least one server, and the request processing server cluster may read at least one service request from the to-be-processed request storage space, and specifically, each server in the request processing server cluster may read at least one service request from the to-be-processed request storage space.
For the embodiment of the application, each server in the request processing server cluster can perform processing corresponding to the request type of the service request on each read service request, and if the service request is a login request, the server in the request processing server cluster can perform login processing on the read login request; if the service request is an order placing request, the server in the request processing server cluster may perform order placing processing on the read order placing request.
Step S204, requesting the processing server cluster to send the processing result to the corresponding client.
For the embodiment of the present application, the request processing server cluster may directly send the processing result or indirectly send the processing result to the corresponding client, for example, the request processing server cluster sends the processing result to the request receiving server cluster, and the request receiving server cluster sends the processing result to the corresponding client.
When the proxy server cluster exists, the request processing server cluster can indirectly send the processing result to the corresponding client through the proxy server cluster, for example, the request processing server cluster sends the processing result to the request receiving server cluster, the request receiving server cluster sends the processing result to the proxy server cluster, and the proxy server cluster sends the processing result to the corresponding client.
According to the method for processing the service request, the service request sent by each client is obtained through the request receiving server cluster, and each service request is stored into the storage space of the request to be processed, so that the concurrent service request is stored into the storage space of the request to be processed; the request processing server cluster reads the service request from the to-be-processed request storage space and processes the read service request to obtain a processing result, and sends the processing result to the corresponding client to realize serial reading and processing of the service request from the to-be-processed request storage space, so that decoupling between the acquisition of the service request and the processing of the service request is realized, serial service request processing is performed on concurrent service requests, the pressure of processing the service request by the server at high concurrency is effectively relieved, and the cost input by a company is reduced.
In another possible implementation manner of the embodiment of the present application, step S201 may specifically include: and the request receiving server cluster receives each service request sent by the proxy server cluster. The service request is received by the proxy server cluster from the client.
For the embodiment of the application, each client can communicate with the request receiving server cluster through the proxy server cluster.
Specifically, for each client, the client may send a service request to the proxy server cluster, and the service request received by the proxy server cluster from the client is sent to the request receiving server cluster.
In an optional embodiment of the present application, before the client sends the service request to the proxy server cluster, the client may perform authentication processing to prevent script attack, and may also appropriately reduce the pressure of the server during high concurrency, and if the authentication is successful, send the service request to the proxy server cluster. The client may perform verification processing by using the verification code information, or may perform verification processing by using the short message information, which is not limited in this embodiment.
As an example, assuming that an application scenario is a service processing system of an e-commerce platform, as shown in fig. 3, fig. 3 shows a schematic flow diagram of a user performing a goods robbery in the e-commerce platform, where a client receives an operation of the user logging in the e-commerce platform, displays a page of the goods a, and if a robbery activity of the goods a has started, the client receives a robbery operation of the user for the goods a, generates and displays an image verification code, and performs verification processing by using the image verification code and the verification code information after the client detects verification code information input by the user, and if the verification fails, does not send an order placing request to a proxy server cluster; if the verification is successful, an order placing request is sent to the proxy server cluster, and then the client displays order placing prompt information, such as the client displays 'place in order, please wait a little'. And after receiving the order placing request, the proxy server cluster sends the order placing request to the request receiving server cluster.
For the embodiment of the present application, the proxy server cluster receives the service request from the client and sends the service request to the request receiving server cluster, and the request receiving server cluster stores the service request into the to-be-processed request storage space, so that the parallel service request is stored into the to-be-processed request storage space, and the request processing server cluster performs serial asynchronous processing on the service request.
In another possible implementation manner of the embodiment of the application, the service request is sent to the request receiving server cluster by the proxy server cluster after the service request is received from the client and when the request type of the received service request is the same as the request type corresponding to the service processing server cluster; and when the request type of the received service request is different from the request type corresponding to the service processing server cluster, sending the request to the request receiving server cluster corresponding to the request type of the service request.
As can be seen from the foregoing description, in practical applications, for different types of service requests, different service processing server clusters may be configured, and each service processing server cluster processes the service request of the request type corresponding to the service processing server cluster. At this time, the execution main body of the method may be a service processing server cluster corresponding to any request type, and as in the system architecture shown in fig. 1, the service processing server cluster may be a service processing server cluster corresponding to an order placing request, and the cluster is used for processing the order placing request of the client. Correspondingly, at this time, the proxy server cluster may communicate with the service processing server cluster corresponding to each request type, and after receiving the service request sent by the client, the proxy server cluster may send the service request to the corresponding service processing server cluster according to the request type of the service request.
Specifically, for any service request, the service request may carry a request type identifier, and after receiving the service request, the proxy server cluster may send the service request to a service processing server of a corresponding type according to the request type identifier carried in the request.
It should be noted that, in practical applications, as an alternative, for different request types, different service processing server clusters may be configured according to application requirements, for example, for a certain request type or some request types, a separate server cluster, that is, a service processing server cluster including a request receiving server cluster and a request processing server cluster, may be configured, and for a certain request type or some request types, an integrated server cluster, that is, a request receiving server cluster and a request processing server cluster may be the same cluster.
For example, a service processing server cluster corresponding to a request type with a high requirement on server performance may be configured as a separate request receiving server cluster and a separate request processing server cluster; and configuring an integrated server cluster for the service processing server cluster corresponding to the request type with lower requirements on server performance.
As an example, in the system architecture shown in fig. 1, assuming that the service processing server cluster 1 is a service processing server cluster corresponding to a login request, the service processing server cluster 2 is a service processing server cluster corresponding to a commodity detail obtaining request, and the service processing server cluster n may be a service processing server cluster corresponding to an order placing request, the service processing server cluster corresponding to the order placing request is a separate request receiving server cluster and a request processing server cluster, and the service processing server clusters corresponding to request types such as the login request and the commodity detail obtaining request are integrated.
Of course, the service processing servers corresponding to all request types may adopt a separate cluster structure.
It can be understood that the service request processing system may further be configured with a service database, where the service database stores relevant information required by the service processing server cluster when performing service request processing, and for different practical application scenarios, the relevant information is usually different, and for different request types, the corresponding relevant information is also usually different. For example, for a service system of an e-commerce platform, the related information corresponding to the item detail obtaining request may include, but is not limited to, item detail information, and the like, and the related information corresponding to the order placing request may include, but is not limited to, a contact address of a user, order recipient address information, and the like.
In addition, in order to improve system performance, the service database may adopt a read-write separation structure, that is, the service database may adopt a master-slave structure, as in the system architecture shown in fig. 1, the service database includes at least one master database and at least one slave database, and a service processing server cluster (e.g., a request receiving server cluster and/or a request processing server cluster) may perform data reading in the slave database and data writing in the master database.
It is understood that, when the business database of the read-write separation structure is adopted, communication can be carried out between the master database and the slave database so as to synchronize data written into the master database into the slave database.
Further, in practical applications, for the service databases, the service databases corresponding to each request type may be configured for each request type according to the request type, and the service processing server cluster corresponding to each request type may read and write data from the service database corresponding to each request type, so as to improve data processing efficiency and system performance better.
For the embodiment of the application, the proxy server cluster determines the request type of each service request, and sends each service request to the request receiving server cluster of the corresponding request type, so as to perform micro-service on the service request, and under a high concurrency scene, the server cluster corresponding to the micro-service restricting the system performance bottleneck can be optimized in a targeted manner, so that the processing performance of the server cluster is improved, and if the current order is processed to become the system bottleneck, the number of servers in the order request processing server cluster can be added, or the network bandwidth corresponding to the order request processing server cluster can be increased; for another example, when the storage of the order placing request becomes a system bottleneck, the number of servers in the order placing request receiving server cluster may be added, or the network bandwidth corresponding to the order placing request receiving server cluster may be increased.
In another possible implementation manner of the embodiment of the present application, the pending request storage space includes at least two storage spaces. Wherein, step S202 may specifically include: for any service request, a request receiving server cluster determines a storage space corresponding to the service request according to user identification information of the service request; and the request receiving server cluster respectively stores each service request into the corresponding storage space.
For the embodiment of the present application, as shown in fig. 4, fig. 4 is a schematic diagram illustrating an architecture of a service processing server cluster. The request receiving server cluster can correspondingly read data from the database, each service request carries user identification information, and the request receiving server cluster can determine a storage space corresponding to each service request according to the user identification information carried by each service request. As shown in fig. 4, the storage space corresponding to the service request includes storage space 1, storage space 2 to storage space n, where n is a positive integer, and when receiving the service request a1-A3, the request receiving server cluster may determine, according to the user identification information carried by the service request a1-A3, that the storage space corresponding to the service request a1 is storage space 1, and determine that the storage space corresponding to the service request a2, A3 is storage space n.
It should be noted that the request receiving server cluster or the request processing server cluster may include a to-be-processed request storage space, such as the request receiving server cluster and/or the request processing server cluster in fig. 4 may include storage space 1, storage space 2 to storage space n. In addition, the pending request storage space may also be a separate storage cluster, such as the storage cluster in fig. 4 including storage space 1, storage space 2 to storage space n.
Further, the request receiving server cluster stores each service request into the corresponding storage space respectively. For example, as described above, the request receiving server cluster stores the service request a1 in the storage space 1, and stores the service requests a2 and A3 in the storage space n.
Besides the user identification information, each service request may also carry other information, such as commodity identification information, password information, and the like. It should be noted that different types of service requests may carry different information, such as the following order request may carry commodity identification information and user identification information, and the login request may carry user identification information and password information.
Further, as shown in fig. 4, the request processing server cluster may read and process the service request from each storage space, the request processing server cluster corresponds to the master database, data may be written into the master database, and the data written into the master database may be automatically synchronized to the slave database. For example, as described above, the request processing server cluster may read the service request a1 from the storage space 1 and process it; the request processing server cluster can read the service request A2 and the service request A3 from the storage space n in sequence or at one time, and process the requests.
Specifically, the at least two storage spaces are configured based on a hash partitioning rule. The determining, by the request receiving server cluster, a storage space corresponding to the service request according to the user identification information of the service request may specifically include: the request receiving server cluster determines a hash value corresponding to the service request according to the user identification information of the service request; and the request receiving server cluster determines the storage space corresponding to the service request according to the hash value.
The user identification information is information for identifying a user identity, and for example, the user identification information may be at least one of a user identity number, a mobile phone number, a Media Access Control Address (MAC) Address of the device, a user number, and the like.
For the embodiment of the application, the request receiving server cluster can perform hash calculation according to the user identification information of the service request to obtain the hash value corresponding to the service request. When the service request carries user identification information and other information, the request receiving server cluster may perform hash calculation based on at least one of the user identification information and the other information to obtain a hash value corresponding to the service request. For example, when the service request carries user identification information, commodity identification information, and password information, the request receiving server cluster may perform hash calculation based on the user identification information and the commodity identification information to obtain a hash value corresponding to the service request.
Further, the request receiving server cluster determines a storage space corresponding to the service request according to the hash value corresponding to the service request.
For the embodiment of the application, when the request receiving server cluster obtains the service request, whether the hash value corresponding to the service request exists in the storage space corresponding to the service request can be determined, and when the hash value does not exist, the hash value corresponding to the service request is used as a key, and the service request is used as a value to be stored in the storage space corresponding to the service request; when the order placing request exists in the storage space corresponding to the order placing request, the request receiving server cluster may send the purchase limit prompting information to the proxy server cluster, so that the proxy server cluster forwards the purchase limit prompting information to the client corresponding to the order placing request.
For the embodiment of the application, the request receiving server cluster can perform hash calculation according to the user identification information of the service request to obtain the hash value corresponding to the service request, and determine the storage space corresponding to the service request according to the hash value, so that the condition that a single storage space cannot meet the requirement is avoided, and the response speed of the ordering interface can be improved.
In particular, the pending request storage space may be a remote dictionary service based storage cluster, wherein the remote dictionary service based storage cluster comprises at least two storage spaces.
For the embodiment of the present application, any storage space may be a Remote Dictionary service (Remote Dictionary Server, redis) -based storage space (which may be referred to as a redis partition for short), for example, in fig. 4, the storage space 1, the storage space 2 to the storage space n may be a redis partition 1, a redis partition 2 to a redis partition n, respectively, where when the storage space to be processed is a separate storage cluster, the storage cluster may be referred to as a redis cluster, that is, the redis cluster includes the redis partition 1, the redis partition 2 to the redis partition n.
For the embodiment of the application, performance bottleneck of a storage space can be solved by adopting the redis partition, dynamic capacity expansion is convenient to carry out, and response speed of a lower single interface can be improved. Further, the storage and reading of the service request may be implemented on the basis of the redis partition in combination with a message queue middleware, where the message queue middleware may be at least one of rabbitMQ, Kafka, and MetaMQ, and is not limited in this embodiment of the application.
In another possible implementation manner of the embodiment of the present application, the service processing server cluster is an order placing service processing server cluster, the request receiving server cluster is an order placing request receiving server cluster, the request processing server cluster is an order placing request processing server cluster, and the service request is an order placing request. Wherein the content of the first and second substances,
step S201 may specifically include: the order placing request receiving server cluster obtains order placing requests sent by the clients.
Step S202 may specifically include: and the order placing request receiving server cluster stores each order placing request to a pending request storage space.
Step S203 may specifically include: the order placing request processing server cluster obtains the information of the order to be processed and processes the information of the order to be processed.
The order information to be processed is acquired through any one of the mode A or the mode B.
Mode A: for any order placing request, the order placing request receiving server cluster inquires relevant information of the order placing request in a database, generates to-be-processed order information according to the order placing request and the relevant information, and stores the to-be-processed order information into a to-be-processed request storage space; and the order placing request processing server cluster reads the information of the order to be processed from the storage space of the request to be processed.
For the embodiment of the present application, the related information of the order placing request may include at least one of commodity information and address information, and the related information of the order placing request may also include benefit information, and the like, which is not limited in the embodiment of the present application.
The application provides a specific example, the order placing request receiving server cluster can inquire commodity information, address information and the like of the order placing request from a database, generate order information to be processed according to user identification information, the commodity information, the address information and the like carried in the order placing request, and store the order information to be processed into a storage space 1; the order placing request processing server cluster may read the pending order information from the storage space 1.
For the embodiment of the application, the order placing request receiving server cluster generates the order information to be processed and stores the order information to be processed into the storage space of the order placing request, the order placing request processing server cluster processes the order information to be processed in the storage space of the order placing request, asynchronous processing of the order information to be processed is achieved, when the order placing request receiving server cluster generates the order information to be processed, only simple query operation needs to be carried out, response can be obtained quickly, the order placing request receiving server cluster is favorable for quickly storing the order information to be processed into the storage space of the order placing request, and the response part of the order placing request is optimized.
Mode B: the order placing request processing server cluster reads the order placing request from the storage space to be processed, inquires relevant information of the order placing request in a database, and generates order information to be processed according to the order placing request and the relevant information.
The application provides a specific example, the order placing request receiving server cluster stores the order placing request in the storage space 2, the order placing request processing server cluster can read the order placing request from the storage space 2, inquire commodity information, address information and the like of the order placing request from a database, and generate order information to be processed according to user identification information, the commodity information, the address information and the like carried in the order placing request.
Further, the order placing request processing server cluster may process the order information to be processed to obtain a processing result, and directly or indirectly send the processing result to the client corresponding to the order placing request. The order placing request processing server cluster may process order information to be processed, and specifically may include: the order placing request processing server cluster determines the stock corresponding to the commodity information in the order information to be processed; if the inventory meets the quantity corresponding to the commodity information in the order information to be processed, updating the inventory based on the quantity corresponding to the commodity information, and taking success prompt information as a processing result; and if the inventory does not meet the quantity corresponding to the commodity information in the order information to be processed, taking failure prompt information as a processing result.
For example, the to-be-processed order information a is obtained based on the order placing request a, the quantity corresponding to the commodity information in the to-be-processed order information a is 8, and the inventory corresponding to the commodity information is 10, and the inventory meets the quantity corresponding to the commodity information in the to-be-processed order information a, the order placing request processing server cluster updates the inventory, that is, the inventory is updated to 2, and the success prompt information is used as the processing result and is directly or indirectly sent to the client corresponding to the order placing request a.
Further, the database comprises a master database and a slave database.
The receiving server cluster for order placing request or the processing server cluster for order placing request, and querying the database for the relevant information of the order placing request may specifically include: the order placing request receiving server cluster or the order placing request processing server cluster inquires relevant information of the order placing request from the database.
The placing order request processing server cluster acquiring information of the order to be processed, and after processing the information of the order to be processed, the placing order request processing server cluster may further include: and the order placing request processing server cluster stores the information of the order to be processed into a main database.
For the embodiment of the application, the order placing request processing server cluster stores the information of the order to be processed in the master database, and the information of the order to be processed stored in the master database is automatically synchronized to the slave database.
For the embodiment of the application, the order placing request receiving server cluster or the order placing request processing server cluster inquires the relevant information of the order placing request from the database, the order placing request processing server cluster stores the information of the order to be processed into the main database, so that the reading and writing of the information are separated, namely, the order placing request receiving server cluster reads the information from the slave database, and the order placing request processing server cluster writes the information into the main database.
For the embodiment of the present application, the service database may adopt a read-write separation structure, that is, the service database may adopt a master-slave structure, as shown in the system architecture shown in fig. 1, the service database includes at least one master database and at least one slave database, and the request receiving server cluster and/or the request processing server cluster may perform data reading in the slave database and perform data writing in the master database. The service database can implement read-write separation in the following manner. Specifically, the method comprises the following steps:
in another possible implementation manner of the embodiment of the present application, the master database is a storage space in a master data storage server, and the slave database is a storage space in a slave data storage server, and the method may further include: the request receiving server cluster and/or the request processing server cluster send first data processing information to the master data storage server, so that the master data storage server performs corresponding data processing operations in the master database based on the first data processing information, second data processing information is generated and sent to each slave data storage server, and each slave data storage server performs corresponding data processing operations in the corresponding slave database based on the second data processing information.
Wherein the data processing operation comprises at least one of a data write operation, a data delete operation, or a data update operation.
As a preferred example, the first data processing information may be a processing request for the service data and/or the pending order information, and the second data processing information may be a processing request for the service data and/or the pending order information, or may be a processing result file for the service data and/or the pending order information, where the processing result file may be a binary file, such as a binary-log file.
When the second data processing information is the processing result file, the master data storage server may establish a first thread, and each of the slave data storage servers may establish a second thread and a third thread, respectively. The main data storage server can send the second data processing information to each slave data storage server through the first thread, each slave data storage server receives the processing result file through the respective second thread and stores the processing result file to the preset cache region, and each slave data storage server reads the processing result file from the preset cache region through the respective third thread and carries out corresponding processing operation according to the processing result file.
As a preferred example, the first thread may be a binlog dump thread, the second thread may be an Input/Output (I/O) thread, the third thread may be a Structured Query Language (SQL) thread, and the predetermined cache region may be a local relay log.
The following will further describe the embodiment of the present application by taking as an example that the second data processing information may be a processing result file for the order information to be processed. Specifically, the method comprises the following steps:
the request processing server cluster can send a processing request for the order information to be processed to the master data storage server, the master data storage server can perform writing operation in the master database based on the order information to be processed, namely the master data storage server stores the order information to be processed into the master database, the master data storage server generates a bank-log file at the moment, the bank-log file comprises SQL sentences performing writing operation on the order information to be processed, and the master data storage server sends the bank-log file to each slave data storage server through a bank dump thread.
Aiming at any slave data storage server, a binary-log file sent by a binary log dump thread is received through an I/O thread, the binary-log file is stored into a local relay log through the I/O thread, the binary-log file is read from the local relay log through an SQL thread, the binary-log file comprises an SQL statement for writing order information to be processed, the SQL thread can perform corresponding writing operation on the order information to be processed according to the SQL statement in the binary-log file, namely the SQL thread stores the order information to be processed into a slave database.
According to the method of the embodiment of the application, the request processing server cluster stores the to-be-processed order information into the master database, and the to-be-processed order information stored into the master database can be synchronized into each slave database. Due to the fact that the business database adopts the master-slave structure in the embodiment of the application, the request processing server cluster can read data from the slave database and write data into the master database, and read-write separation is achieved.
The master database, the slave database and the to-be-processed request storage space (including at least two storage spaces) all have a storage function, wherein the master database is mainly used for receiving writing of data and synchronizing the written data into the slave database so as to store the data into the master database and the slave database; the slave database is mainly used for receiving data reading; the pending request storage space is mainly used for storing the service request or the pending order information, so that the request receiving server cluster reads the service request or the pending order information from the request receiving server cluster.
The method for processing the service request in the embodiment of the present application is described in detail mainly from the perspective of method steps, and the embodiment of the present application will be described in detail with reference to fig. 5, where fig. 5 shows a flowchart of a method for processing an order placing request, to which the embodiment of the present application is applied. In fig. 5, the service processing request is an order placing request, the request receiving server cluster is an order placing request receiving server cluster, and the request processing server cluster is an order placing request processing server cluster, specifically:
according to at least one client, when any client receives order placing operation of a user, to-be-verified information is generated and displayed, any client receives input information of the user for the to-be-verified information, any client performs verification processing by using the to-be-verified information and the input information and successfully verifies the information, an order placing request is sent to an order placing request receiving server cluster, based on the implementation mode, each client can send the order placing request to the order placing request receiving server cluster, wherein the to-be-verified information can be an image verification code, a digital verification code, a character string verification code and the like, and the implementation mode is not limited.
Further, the order placing request receiving server cluster inquires whether a historical order placing request of the order placing request exists in the database, and if the historical order placing request can be found, the order placing request receiving server cluster sends purchase limiting prompt information to a client side corresponding to the order placing request; if the historical order placing request cannot be found, the order placing request receiving server cluster inquires redis to check whether the inventory meets the quantity of the commodities corresponding to the order placing request, and if the inventory does not meet the quantity of the commodities corresponding to the order placing request, the order placing request receiving server cluster sends a purchase-fighting ending prompt message to a client corresponding to the order placing request; if the stock meets the commodity quantity corresponding to the order placing request, the order placing request receiving server cluster inquires commodity information, address information and the like of the order placing request from the database, and generates to-be-processed order information according to the commodity information and the address information of the order placing request.
Further, the order placing request receiving server cluster performs hash calculation according to the user identification information of the order placing request to obtain a hash value corresponding to the order placing request, and determines a to-be-processed request storage space corresponding to the order placing request according to the hash value corresponding to the order placing request, the order placing request receiving server cluster can determine whether the hash value corresponding to the order placing request exists in the to-be-processed request storage space corresponding to the order placing request, and when the hash value exists, the order placing request receiving server cluster sends purchase limit prompt information to a client corresponding to the order placing request; and when the order information does not exist, storing the to-be-processed order information into a to-be-processed request storage space corresponding to the order placing request.
The order placing request receiving server cluster may search the commodity information of the order placing request from the database based on the commodity identification information, for example, the commodity information includes commodity price, commodity preference and other information.
In addition, the order placing request may carry address identification information, which may be an address number or the like, for representing an actual receiving address. For example, the address identification information may be 1. The order placing request receiving server cluster can search the address information of the user in the database according to the address identification information, wherein the address information is used for representing the actual receiving address, and the following order placing request receiving server cluster searches the actual receiving address corresponding to the address identification information 1 in the database according to the address identification information 1, such as XX city XXX cell.
Further, the order placing request processing server cluster reads the to-be-processed order information corresponding to the order placing request from the to-be-processed request storage space, the order placing request processing server cluster inquires redis to check whether the inventory meets the commodity quantity corresponding to the to-be-processed order information, and when the inventory does not meet the commodity quantity corresponding to the to-be-processed order information, the order placing request processing server cluster sends a shopping ending prompt message to a client side corresponding to the to-be-processed order information; and when the order is satisfied, the order placing request processing server cluster updates the stock, stores the information of the order to be processed into the main database, and sends order placing success information and payment information to the client corresponding to the information of the order to be processed. Wherein, the information in the master database is automatically synchronized to the slave database.
The method for processing the service request in the embodiment of the present application is mainly described in detail below by taking the order request as an example, and the system for processing the service request in the embodiment of the present application will be described below from the perspective of the system, specifically,
as shown in fig. 7, fig. 7 shows a schematic structural diagram of a service request processing system of an embodiment of the present application, where the service request processing system 70 may include a service processing server cluster 700, and the service processing server cluster 700 includes a request receiving server cluster 7001 and a request processing server cluster 7002, where,
the request receiving server cluster 7001 is configured to obtain the service requests sent by the clients, and store the service requests in the pending request storage space.
The request processing server cluster 7002 is configured to read a service request from the to-be-processed request storage space, process the read service request, obtain a processing result, and send the processing result to the corresponding client.
For the relevant description of the embodiment of the present application, reference may be made in detail to the relevant description of the request receiving server cluster and the request processing server cluster in the system architecture embodiment and the method embodiment described above, and details are not described herein again.
The embodiment of the application provides a service request processing system, wherein a service request sent by each client is obtained by a request receiving server cluster, and each service request is stored in a to-be-processed request storage space, so that concurrent service requests are stored in the to-be-processed request storage space; the request processing server cluster reads the service request from the to-be-processed request storage space and processes the read service request to obtain a processing result, and sends the processing result to the corresponding client to realize serial reading and processing of the service request from the to-be-processed request storage space, so that decoupling between the acquisition of the service request and the processing of the service request is realized, serial service request processing is performed on concurrent service requests, the pressure of processing the service request by the server at high concurrency is effectively relieved, and the cost input by a company is reduced.
In another possible implementation manner of this embodiment, the service request processing system 70 may further include a proxy server cluster, where the proxy server cluster is configured to receive service requests sent by clients, and send the service requests to the request receiving server cluster 7001.
For the relevant description of the embodiment of the present application, it may be referred to the relevant description of the proxy server cluster in the above system architecture embodiment and the above method embodiment, and details are not described herein again.
In another possible implementation manner of this embodiment, the service processing server cluster 700 is an order placing service processing server cluster, the request receiving server cluster 7001 is an order placing request receiving server cluster, the request processing server cluster 7002 is an order placing request processing server cluster, and the service request is an order placing request.
For the relevant description of the embodiments of the present application, details of the system architecture embodiment and the relevant description of the method embodiment may be found, and are not described herein again.
In another possible implementation manner of this embodiment, the service request processing system 70 includes at least two service processing server clusters 700 corresponding to different request types, and the proxy server cluster is specifically configured to receive a service request sent by each client, and send the service request to the corresponding service processing server cluster according to the request type of the service request.
For the relevant description of the embodiments of the present application, details of the system architecture embodiment and the relevant description of the method embodiment may be found, and are not described herein again.
To better understand the service request processing system 70 according to the embodiment of the present application, the following description is further made with reference to fig. 6, and fig. 6 shows an interaction diagram of the service request processing system 70 according to the embodiment of the present application. In fig. 6, the pending request storage space is used as a storage cluster alone, and in practice, the pending request storage space may also be in a request receiving server cluster or a request processing server cluster, which is not limited herein. In particular, the amount of the solvent to be used,
a client sends a service request to a proxy server cluster; after receiving the service request, the proxy server cluster sends the service request to a request receiving server cluster; the request receiving server cluster stores the received service request into a to-be-processed request storage space; the request processing server cluster reads the service request from the to-be-processed request storage space, processes the read service request to obtain a processing result, and sends the processing result to the request receiving server cluster; the request receiving server cluster sends the received processing result to the proxy server cluster; and the proxy server cluster sends the received processing result to the corresponding client.
The service request processing system in the embodiment of the present application is described above mainly from the perspective of the system, and the service processing server cluster in the embodiment of the present application will be described in detail below from the perspective of the virtual device. In particular, the amount of the solvent to be used,
the embodiment of the present application provides a business processing server cluster, as shown in fig. 7, the business processing server cluster 700 includes a request receiving server cluster 7001 and a request processing server cluster 7002, the request receiving server cluster 7001 may include an obtaining module and a first storage module, and the request processing server cluster 7002 may include a reading processing module and a sending module, wherein,
the acquisition module is used for acquiring the service requests sent by the clients;
and the first storage module is used for storing each service request to the to-be-processed request storage space.
The reading processing module is used for reading the service request from the storage space of the request to be processed and processing the read service request to obtain a processing result;
and the sending module is used for sending the processing result to the corresponding client.
In another possible implementation manner of the embodiment of the present application, the obtaining module is specifically configured to receive each service request sent by the proxy server cluster.
The service request is received by the proxy server cluster from the client.
In another possible implementation manner of the embodiment of the present application, the service request is sent to the request receiving server cluster 7001 by the proxy server cluster after the service request is received from the client and when the request type of the received service request is the same as the request type corresponding to the service processing server cluster 700;
when the request type of the received service request is different from the request type corresponding to the service processing server cluster 700, the request is sent to the request receiving server cluster 7001 corresponding to the request type of the service request.
In another possible implementation manner of the embodiment of the present application, the service processing server cluster 700 is an order placing service processing server cluster, the request receiving server cluster 7001 is an order placing request receiving server cluster, the request processing server cluster 7002 is an order placing request processing server cluster, and the service request is an order placing request, wherein,
and the obtaining module is specifically used for obtaining order placing requests sent by the clients.
The first storage module is specifically configured to store each order placing request in the to-be-processed request storage space.
And the reading processing module is specifically used for acquiring the information of the order to be processed and processing the information of the order to be processed.
The order information to be processed is acquired by any one of the mode A or the mode B:
mode A: for any order placing request, the first storage module is specifically used for inquiring relevant information of the order placing request in a database, generating to-be-processed order information according to the order placing request and the relevant information, and storing the to-be-processed order information into a to-be-processed request storage space; and the reading processing module is specifically used for reading the information of the order to be processed from the storage space of the request to be processed.
Mode B: the reading processing module is specifically configured to read an order placing request from the to-be-processed storage space, query relevant information of the order placing request in a database, and generate to-be-processed order information according to the order placing request and the relevant information.
In another possible implementation manner of the embodiment of the present application, the pending request storage space includes at least two storage spaces.
The first storage module is specifically configured to: for any service request, determining a storage space corresponding to the service request according to the user identification information of the service request; and respectively storing each service request into the corresponding storage space.
In another possible implementation manner of the embodiment of the present application, at least two storage spaces are storage spaces configured based on a hash partitioning rule.
When determining the storage space corresponding to the service request according to the user identification information of the service request, the first storage module is specifically configured to: determining a hash value corresponding to the service request according to the user identification information of the service request; and determining a storage space corresponding to the service request according to the hash value.
In another possible implementation manner of the embodiment of the present application, the database includes a master database and a slave database.
The first storage module is specifically used for querying the relevant information of the order placing request from the database when querying the relevant information of the order placing request from the database.
Or, when the reading processing module queries the relevant information of the order placing request in the database, the reading processing module is specifically used for querying the relevant information of the order placing request from the database.
The request processing server cluster 7002 further comprises a second storage module, wherein the second storage module is used for storing the to-be-processed order information into the main database.
In another possible implementation manner of the embodiment of the present application, the pending request storage space is a remote dictionary service-based storage cluster, where the remote dictionary service-based storage cluster includes at least two storage spaces.
In another possible implementation manner of the embodiment of the present application, the master database is a storage space in a master data storage server, and the slave database is a storage space in a slave data storage server, wherein the request receiving server cluster 7001 and/or the request processing server cluster 7002 further include a sending module, wherein,
the sending module is used for sending the first data processing information to the master data storage server so that the master data storage server performs corresponding data processing operation in the master database based on the first data processing information, generates second data processing information and sends the second data processing information to each slave data storage server, and each slave data storage server performs corresponding data processing operation in the corresponding slave database based on the second data processing information;
wherein the data processing operation comprises at least one of a data write operation, a data delete operation, or a data update operation.
For the embodiments of the present application, reference may be made to the above-mentioned related descriptions related to the system architecture and the method embodiments, which have similar implementation principles and are not described herein again.
The embodiment of the application provides a service processing server cluster, and the service processing server cluster acquires service requests sent by various clients through a request receiving server cluster, stores the service requests into a to-be-processed request storage space, and stores concurrent service requests into the to-be-processed request storage space; the request processing server cluster reads the service request from the to-be-processed request storage space and processes the read service request to obtain a processing result, and sends the processing result to the corresponding client to realize serial reading and processing of the service request from the to-be-processed request storage space, so that decoupling between the acquisition of the service request and the processing of the service request is realized, serial service request processing is performed on concurrent service requests, the pressure of processing the service request by the server at high concurrency is effectively relieved, and the cost input by a company is reduced.
The service processing server cluster of the present application is described above from the perspective of a virtual device, and the electronic device of the present application is described below from the perspective of a physical device.
An embodiment of the present application provides an electronic device, as shown in fig. 8, an electronic device 4000 shown in fig. 8 includes: a processor 4001 and a memory 4003. Processor 4001 is coupled to memory 4003, such as via bus 4002. Optionally, the electronic device 4000 may further comprise a transceiver 4004. In addition, the transceiver 4004 is not limited to one in practical applications, and the structure of the electronic device 4000 is not limited to the embodiment of the present application.
Processor 4001 may be a CPU, general purpose processor, DSP, ASIC, FPGA or other programmable logic device, transistor logic device, hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor 4001 may also be a combination that performs a computational function, including, for example, a combination of one or more microprocessors, a combination of a DSP and a microprocessor, or the like.
Bus 4002 may include a path that carries information between the aforementioned components. Bus 4002 may be a PCI bus, EISA bus, or the like. The bus 4002 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 8, but this is not intended to represent only one bus or type of bus.
Memory 4003 may be, but is not limited to, a ROM or other type of static storage device that can store static information and instructions, a RAM or other type of dynamic storage device that can store information and instructions, an EEPROM, a CD-ROM or other optical disk storage, an optical disk storage (including compact disk, laser disk, optical disk, digital versatile disk, blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
The memory 4003 is used for storing application codes for executing the scheme of the present application, and the execution is controlled by the processor 4001. Processor 4001 is configured to execute application code stored in memory 4003 to implement what is shown in any of the foregoing method embodiments.
An embodiment of the present application provides an electronic device, where the electronic device includes: a memory and a processor; at least one program stored in the memory for execution by the processor to perform: acquiring service requests sent by each client through a request receiving server cluster, storing each service request into a to-be-processed request storage space, and storing concurrent service requests into the to-be-processed request storage space; the request processing server cluster reads the service request from the to-be-processed request storage space and processes the read service request to obtain a processing result, and sends the processing result to the corresponding client to realize serial reading and processing of the service request from the to-be-processed request storage space, so that decoupling between the acquisition of the service request and the processing of the service request is realized, serial service request processing is performed on concurrent service requests, the pressure of processing the service request by the server at high concurrency is effectively relieved, and the cost input by a company is reduced.
The electronic device of the present application is described above from the perspective of a physical device, and the computer-readable storage medium of the present application is described below from the perspective of a storage medium.
The present application provides a computer-readable storage medium, on which a computer program is stored, which, when running on a computer, enables the computer to execute the corresponding content in the foregoing method embodiments. Acquiring service requests sent by each client through a request receiving server cluster, storing each service request into a to-be-processed request storage space, and storing concurrent service requests into the to-be-processed request storage space; the request processing server cluster reads the service request from the to-be-processed request storage space and processes the read service request to obtain a processing result, and sends the processing result to the corresponding client to realize serial reading and processing of the service request from the to-be-processed request storage space, so that decoupling between the acquisition of the service request and the processing of the service request is realized, serial service request processing is performed on concurrent service requests, the pressure of processing the service request by the server at high concurrency is effectively relieved, and the cost input by a company is reduced.
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
The foregoing is only a partial embodiment of the present application, and it should be noted that, for those skilled in the art, several modifications and decorations can be made without departing from the principle of the present application, and these modifications and decorations should also be regarded as the protection scope of the present application.

Claims (10)

1. A method for processing service requests, the method being performed by service processing server clusters, the service processing server clusters including a request receiving server cluster and a request processing server cluster, the method comprising:
the request receiving server cluster acquires the service requests sent by the clients and stores the service requests to a to-be-processed request storage space;
the request processing server cluster reads the service request from the to-be-processed request storage space and processes the read service request to obtain a processing result;
and the request processing server cluster sends the processing result to the corresponding client.
2. The method according to claim 1, wherein the requesting the receiving server cluster to obtain the service request sent by each client includes:
the request receiving server cluster receives each service request sent by the proxy server cluster;
the service request is sent to the request receiving server cluster by the proxy server cluster after the service request is received from the client and when the request type of the received service request is the same as the request type corresponding to the service processing server cluster.
3. The method of claim 1, wherein the cluster of business processing servers is a order placing business processing server cluster, the request receiving server cluster is an order placing request receiving server cluster, the request processing server cluster is an order placing request processing server cluster, and the business request is an order placing request, wherein,
the method for acquiring the service requests sent by the clients and storing the service requests to the storage space of the requests to be processed by the request receiving server cluster comprises the following steps:
the order placing request receiving server cluster obtains the order placing requests sent by the clients and stores the order placing requests to a to-be-processed request storage space;
the request processing server cluster reads the service request from the to-be-processed request storage space and processes the read service request, and the method comprises the following steps:
the order placing request processing server cluster acquires information of an order to be processed and processes the information of the order to be processed;
the order information to be processed is acquired through any one of the following:
for any order placing request, the order placing request receiving server cluster inquires relevant information of the order placing request in a database, generates to-be-processed order information according to the order placing request and the relevant information, and stores the to-be-processed order information into a to-be-processed request storage space; the order placing request processing server cluster reads the information of the order to be processed from the storage space of the request to be processed;
and the order placing request processing server cluster reads the order placing request from the storage space to be processed, inquires related information of the order placing request in a database, and generates order information to be processed according to the order placing request and the related information.
4. The method according to any of claims 1 to 3, wherein the pending request memory space comprises at least two memory spaces;
the method for storing each service request to a pending request storage space by the request receiving server cluster comprises the following steps:
for any service request, the request receiving server cluster determines a storage space corresponding to the service request according to the user identification information of the service request;
and the request receiving server cluster stores each service request into a corresponding storage space respectively.
5. The method of claim 4, wherein the at least two storage spaces are configured based on a hash partitioning rule;
the method for determining the storage space corresponding to the service request by the request receiving server cluster according to the user identification information of the service request comprises the following steps:
the request receiving server cluster determines a hash value corresponding to the service request according to the user identification information of the service request;
and the request receiving server cluster determines a storage space corresponding to the service request according to the hash value.
6. The method of claim 3, wherein the database comprises a master database and a slave database;
the step of querying the relevant information of the order placing request in a database by the order placing request receiving server cluster or the order placing request processing server cluster comprises:
the order placing request receiving server cluster or the order placing request processing server cluster inquires relevant information of the order placing request from the slave database;
the method for processing the order placing request includes the steps that the order placing request processing server cluster obtains information of an order to be processed, and after the information of the order to be processed is processed, the method further includes the following steps:
and the order placing request processing server cluster stores the information of the order to be processed into the main database.
7. A service request processing system, comprising a service processing server cluster including a request receiving server cluster and a request processing server cluster, wherein,
the request receiving server cluster is configured to:
acquiring service requests sent by each client, and storing each service request to a to-be-processed request storage space;
the cluster of request processing servers is to:
and reading the service request from the storage space of the request to be processed, processing the read service request to obtain a processing result, and sending the processing result to a corresponding client.
8. The system of claim 7, further comprising a proxy cluster, wherein the proxy cluster is configured to:
and receiving service requests sent by all the clients, and sending all the service requests to the request receiving server cluster.
9. The system according to claim 8, wherein the system comprises at least two service processing server clusters corresponding to different request types, and the proxy server cluster is specifically configured to:
and receiving service requests sent by each client, and sending the service requests to corresponding service processing server clusters according to the request types of the service requests.
10. An electronic device, comprising:
one or more processors;
a memory;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to: the method for processing the service request according to any one of claims 1 to 6 is executed.
CN202010442333.5A 2020-05-22 2020-05-22 Service request processing method and system and electronic equipment Pending CN113704295A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010442333.5A CN113704295A (en) 2020-05-22 2020-05-22 Service request processing method and system and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010442333.5A CN113704295A (en) 2020-05-22 2020-05-22 Service request processing method and system and electronic equipment

Publications (1)

Publication Number Publication Date
CN113704295A true CN113704295A (en) 2021-11-26

Family

ID=78646413

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010442333.5A Pending CN113704295A (en) 2020-05-22 2020-05-22 Service request processing method and system and electronic equipment

Country Status (1)

Country Link
CN (1) CN113704295A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114189525A (en) * 2021-12-02 2022-03-15 建信金融科技有限责任公司 Service request method and device and electronic equipment
CN117176743A (en) * 2023-11-03 2023-12-05 腾讯科技(深圳)有限公司 Data processing method, apparatus, device, readable storage medium, and program product

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114189525A (en) * 2021-12-02 2022-03-15 建信金融科技有限责任公司 Service request method and device and electronic equipment
CN114189525B (en) * 2021-12-02 2023-06-20 建信金融科技有限责任公司 Service request method and device and electronic equipment
CN117176743A (en) * 2023-11-03 2023-12-05 腾讯科技(深圳)有限公司 Data processing method, apparatus, device, readable storage medium, and program product
CN117176743B (en) * 2023-11-03 2024-02-06 腾讯科技(深圳)有限公司 Data processing method, apparatus, device, readable storage medium, and program product

Similar Documents

Publication Publication Date Title
US11093148B1 (en) Accelerated volumes
CN109995881B (en) Load balancing method and device of cache server
CN112929401B (en) Registration method and device
US20200120039A1 (en) Systems and methods for controlling access to broker resources
CN111327613B (en) Distributed service authority control method and device and computer readable storage medium
CN110784498B (en) Personalized data disaster tolerance method and device
CN113704295A (en) Service request processing method and system and electronic equipment
WO2022218227A1 (en) Blockchain-based deposit method and apparatus, and electronic device
CN112866421B (en) Intelligent contract operation method and device based on distributed cache and NSQ
CN102045399A (en) Cloud computing mode file system and file reading method
CN110781441A (en) New retail business middle desk based on micro-service framework
CN111400301A (en) Data query method, device and equipment
CN113282589A (en) Data acquisition method and device
CN113077260A (en) Data access method and device based on block chain and electronic equipment
CN107357557B (en) Information updating method and device
CN115271861A (en) Request filtering method, device, equipment and storage medium
CN107526530B (en) Data processing method and device
CN112988874A (en) Data processing method, system, computing device and readable storage medium
CN112825045B (en) Payment request processing method, system and storage medium
CN112637201A (en) Request processing method, device, equipment and system of web server
JP5530893B2 (en) Function expansion method of service providing system
US20220129455A1 (en) Techniques for in-memory data searching
CN115098528B (en) Service processing method, device, electronic equipment and computer readable storage medium
JP7463606B1 (en) Connection switching server and connection switching method
US20230237051A1 (en) Techniques for in-memory data searching

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